src/tokens.h

changeset 134
eca2fc0acaa2
parent 133
dbbdb870c835
child 135
8b9132fea327
equal deleted inserted replaced
133:dbbdb870c835 134:eca2fc0acaa2
31 31
32 #include <climits> 32 #include <climits>
33 #include "macros.h" 33 #include "macros.h"
34 34
35 // ======================================================= 35 // =======================================================
36 named_enum ETokenType 36 named_enum Token
37 { 37 {
38 // Non-word tokens 38 // Non-word tokens
39 TK_LeftShiftAssign, 39 LeftShiftAssign,
40 TK_RightShiftAssign, 40 RightShiftAssign,
41 TK_Equals, 41 Equals,
42 TK_NotEquals, 42 NotEquals,
43 TK_AddAssign, 43 AddAssign,
44 TK_SubAssign, 44 SubAssign,
45 TK_MultiplyAssign, 45 MultiplyAssign,
46 TK_DivideAssign, 46 DivideAssign,
47 TK_ModulusAssign, 47 ModulusAssign,
48 TK_LeftShift, 48 LeftShift,
49 TK_RightShift, 49 RightShift,
50 TK_AtLeast, 50 AtLeast,
51 TK_AtMost, 51 AtMost,
52 TK_DoubleAmperstand, 52 DoubleAmperstand,
53 TK_DoubleBar, 53 DoubleBar,
54 TK_DoublePlus, 54 DoublePlus,
55 TK_DoubleMinus, 55 DoubleMinus,
56 TK_SingleQuote, 56 SingleQuote,
57 TK_DollarSign, 57 DollarSign,
58 TK_ParenStart, 58 ParenStart,
59 TK_ParenEnd, 59 ParenEnd,
60 TK_BracketStart, 60 BracketStart,
61 TK_BracketEnd, 61 BracketEnd,
62 TK_BraceStart, 62 BraceStart,
63 TK_BraceEnd, 63 BraceEnd,
64 TK_Assign, 64 Assign,
65 TK_Plus, 65 Plus,
66 TK_Minus, 66 Minus,
67 TK_Multiply, 67 Multiply,
68 TK_Divide, 68 Divide,
69 TK_Modulus, 69 Modulus,
70 TK_Comma, 70 Comma,
71 TK_Lesser, 71 Lesser,
72 TK_Greater, 72 Greater,
73 TK_Dot, 73 Dot,
74 TK_Colon, 74 Colon,
75 TK_Semicolon, 75 Semicolon,
76 TK_Hash, 76 Hash,
77 TK_ExclamationMark, 77 ExclamationMark,
78 TK_Amperstand, 78 Amperstand,
79 TK_Bar, 79 Bar,
80 TK_Caret, 80 Caret,
81 TK_QuestionMark, 81 QuestionMark,
82 TK_Arrow, 82 Arrow,
83 83
84 // -------------- 84 // --------------
85 // Named tokens 85 // Named tokens
86 TK_Bool, 86 Bool,
87 TK_Break, 87 Break,
88 TK_Case, 88 Case,
89 TK_Continue, 89 Continue,
90 TK_Const, 90 Const,
91 TK_Constexpr, 91 Constexpr,
92 TK_Default, 92 Default,
93 TK_Do, 93 Do,
94 TK_Else, 94 Else,
95 TK_Event, 95 Event,
96 TK_Eventdef, 96 Eventdef,
97 TK_For, 97 For,
98 TK_Funcdef, 98 Funcdef,
99 TK_If, 99 If,
100 TK_Int, 100 Int,
101 TK_Mainloop, 101 Mainloop,
102 TK_Onenter, 102 Onenter,
103 TK_Onexit, 103 Onexit,
104 TK_State, 104 State,
105 TK_Switch, 105 Switch,
106 TK_Str, 106 Str,
107 TK_Using, 107 Using,
108 TK_Var, 108 Var,
109 TK_Void, 109 Void,
110 TK_While, 110 While,
111 TK_True, 111 True,
112 TK_False, 112 False,
113 113
114 // These ones aren't implemented yet but I plan to do so, thus they are 114 // These ones aren't implemented yet but I plan to do so, thus they are
115 // reserved. Also serves as a to-do list of sorts for me. >:F 115 // reserved. Also serves as a to-do list of sorts for me. >:F
116 TK_Enum, 116 Enum,
117 TK_Func, 117 Func,
118 TK_Return, 118 Return,
119 119
120 // -------------- 120 // --------------
121 // Generic tokens 121 // Generic tokens
122 TK_Symbol, 122 Symbol,
123 TK_Number, 123 Number,
124 TK_String, 124 String,
125 TK_Any, 125 Any,
126
127 FirstNamedToken = Bool,
128 LastNamedToken = Token (int (Symbol) - 1)
126 }; 129 };
127 130
128 static const int gFirstNamedToken = TK_Bool;
129 static const int gLastNamedToken = (int) TK_Symbol - 1;
130
131 #endif 131 #endif

mercurial