-
Notifications
You must be signed in to change notification settings - Fork 0
/
TOKENS.py
42 lines (39 loc) · 948 Bytes
/
TOKENS.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
TOKENS = {
'IF_TK': r'if',
'ELSE_TK': r'else',
'ELIF_TK': r'elif',
'FOR_TK': r'for',
'WHILE_TK': r'while',
'PRINT_TK': r'print',
'DEF_TK': r'def',
'APPEND_TK': r'append',
'CLASS_TK': r'class',
'RETURN_TK': r'return',
'IS_TK': r'is',
'LEN_TK': r'len',
'EQ_TK': r'==',
'PLUS_TK': r'\+',
'MUL_TK': r'\*',
'MINUS_TK': r'\-',
'SLASH_TK': r'\/',
'HASH_TK': r'#',
'NOT_EQ_TK': r'!=',
'LESS_TK': r'\<',
'GREATER_TK': r'\>',
'LE_TK': r'<=',
'GE_TK': r'>=',
'ASSIGN_TK': r'=',
'DOT_TK': r'\.',
'COLON_TK': r':',
'SEMICOLON_TK': r';',
'COMMA_TK': r',',
'LEFT_PARANTES_TK': r'\(',
'RIGHT_PARANTES_TK': r'\)',
'LEFT_CBRACKET_TK': r'\{',
'RIGHT_CBRACKET_TK': r'\}',
'LEFT_BRACKET_TK': r'\[',
'RIGHT_BRACKET_TK': r'\]',
'CONST_STRING': r'".*?"|\'.*?\'',
'CONST_NUMBER': r'\d+',
'IDENTIFIER': r'([A-Za-z_]\w*)',
}