-
Notifications
You must be signed in to change notification settings - Fork 0
/
TokenType.hpp
60 lines (54 loc) · 920 Bytes
/
TokenType.hpp
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
#ifndef tokentype_hpp
#define tokentype_hpp
enum TokenType : int {
// Special Token
tok_eof = 0,
// Operators
tok_plus = 1,
tok_minus = 2,
tok_slash = 3,
tok_star = 4,
tok_equal = 5,
tok_equal_equal = 6,
tok_bang = 7,
tok_bang_equal = 8,
tok_greater = 9,
tok_greater_equal = 10,
tok_less = 11,
tok_less_equal = 12,
tok_left_paren = 13,
tok_right_paren = 14,
tok_left_brace = 15,
tok_right_brace = 16,
tok_comma = 17,
tok_dot = 18,
tok_semicolon = 19,
// Keywords
tok_and = 20,
tok_class = 21,
tok_else = 22,
tok_false = 23,
tok_fun = 24,
tok_for = 25,
tok_if = 26,
tok_nil = 27,
tok_or = 28,
tok_print = 29,
tok_return = 30,
tok_super = 31,
tok_this = 32,
tok_true = 33,
tok_var = 34,
tok_while = 35,
// Primary
tok_identifier = 36,
tok_number = 37,
tok_string = 38,
tok_int = 39,
tok_double = 40,
tok_bool = 41,
// Commands
tok_def = 42,
tok_extern = 43,
};
#endif