-
Notifications
You must be signed in to change notification settings - Fork 0
/
lexer.h
66 lines (59 loc) · 1.09 KB
/
lexer.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Keywords
#define T_PROGRAM 1
#define T_CONST 2
#define T_TYPE 3
#define T_ARRAY 4
#define T_SET 5
#define T_OF 6
#define T_RECORD 7
#define T_VAR 8
#define T_FORWARD 9
#define T_FUNCTION 10
#define T_PROCEDURE 11
#define T_INTEGER 12
#define T_REAL 13
#define T_BOOLEAN 14
#define T_CHAR 15
#define T_BEGIN 16
#define T_END 17
#define T_IF 18
#define T_THEN 19
#define T_ELSE 20
#define T_WHILE 21
#define T_DO 22
#define T_FOR 23
#define T_DOWNTO 24
#define T_TO 25
#define T_WITH 26
#define T_READ 27
#define T_WRITE 28
// Identifiers
#define T_ID 29
// Constants
#define T_ICONST 30
#define T_RCONST 31
#define T_BCONST 32
#define T_CCONST 33
// Operators
#define T_RELOP 34
#define T_ADDOP 35
#define T_OROP 36
#define T_MULDIVANDOP 37
#define T_NOTOP 38
#define T_INOP 39
// Strings
#define T_STRING 40
// Other tokens
#define T_LPAREN 41
#define T_RPAREN 42
#define T_SEMI 43
#define T_DOT 44
#define T_COMMA 45
#define T_EQU 46
#define T_COLON 47
#define T_LBRACK 48
#define T_RBRACK 49
#define T_ASSIGN 50
#define T_DOTDOT 51
// EOF
#define T_EOF 0