1
2
3
4 #include <sng2html/sng2html/LexerFileTokens.hpp>
5 #include <map>
6
7 namespace LexerFileTokens
8 {
9 std::map<std::u32string, int> tokenIdMap;
10
11 void InitTokenIdMap()
12 {
13 tokenIdMap[U"ACTIONS"] = 8;
14 tokenIdMap[U"AMP"] = 74;
15 tokenIdMap[U"AMPAMP"] = 69;
16 tokenIdMap[U"ANDASSIGN"] = 114;
17 tokenIdMap[U"API"] = 9;
18 tokenIdMap[U"ARROW"] = 90;
19 tokenIdMap[U"ARROWSTAR"] = 71;
20 tokenIdMap[U"ASSIGN"] = 106;
21 tokenIdMap[U"AUTO"] = 14;
22 tokenIdMap[U"BITOR"] = 72;
23 tokenIdMap[U"BITXOR"] = 73;
24 tokenIdMap[U"BOOL"] = 21;
25 tokenIdMap[U"BREAK"] = 57;
26 tokenIdMap[U"CASE"] = 49;
27 tokenIdMap[U"CATCH"] = 62;
28 tokenIdMap[U"CHAR"] = 19;
29 tokenIdMap[U"CHARLIT"] = 66;
30 tokenIdMap[U"CLASSMAP"] = 1;
31 tokenIdMap[U"COLON"] = 102;
32 tokenIdMap[U"COLONCOLON"] = 101;
33 tokenIdMap[U"COMMA"] = 105;
34 tokenIdMap[U"CONST"] = 31;
35 tokenIdMap[U"CONSTCAST"] = 41;
36 tokenIdMap[U"CONTINUE"] = 58;
37 tokenIdMap[U"CPL"] = 88;
38 tokenIdMap[U"DEFAULT"] = 50;
39 tokenIdMap[U"DELETE"] = 45;
40 tokenIdMap[U"DISJUNCTION"] = 68;
41 tokenIdMap[U"DIV"] = 84;
42 tokenIdMap[U"DIVASSIGN"] = 108;
43 tokenIdMap[U"DO"] = 55;
44 tokenIdMap[U"DOLLAR"] = 12;
45 tokenIdMap[U"DOT"] = 89;
46 tokenIdMap[U"DOTSTAR"] = 70;
47 tokenIdMap[U"DOUBLE"] = 28;
48 tokenIdMap[U"DYNAMICCAST"] = 38;
49 tokenIdMap[U"ELLIPSIS"] = 100;
50 tokenIdMap[U"ELSE"] = 52;
51 tokenIdMap[U"EQ"] = 75;
52 tokenIdMap[U"EXCLAMATION"] = 13;
53 tokenIdMap[U"EXPRESSIONS"] = 5;
54 tokenIdMap[U"EXTERN"] = 17;
55 tokenIdMap[U"FALSE"] = 47;
56 tokenIdMap[U"FILEPATH"] = 11;
57 tokenIdMap[U"FLOAT"] = 27;
58 tokenIdMap[U"FLOATINGLIT"] = 65;
59 tokenIdMap[U"FOR"] = 56;
60 tokenIdMap[U"GEQ"] = 78;
61 tokenIdMap[U"GOTO"] = 60;
62 tokenIdMap[U"HASH"] = 104;
63 tokenIdMap[U"ID"] = 63;
64 tokenIdMap[U"IF"] = 51;
65 tokenIdMap[U"INCLUDE"] = 10;
66 tokenIdMap[U"INT"] = 23;
67 tokenIdMap[U"INTLIT"] = 64;
68 tokenIdMap[U"KEYWORDS"] = 4;
69 tokenIdMap[U"LANGLE"] = 98;
70 tokenIdMap[U"LBRACE"] = 94;
71 tokenIdMap[U"LBRACKET"] = 96;
72 tokenIdMap[U"LEQ"] = 77;
73 tokenIdMap[U"LEXER"] = 6;
74 tokenIdMap[U"LONG"] = 24;
75 tokenIdMap[U"LPAREN"] = 92;
76 tokenIdMap[U"MINUS"] = 82;
77 tokenIdMap[U"MINUSASSIGN"] = 111;
78 tokenIdMap[U"MINUSMINUS"] = 87;
79 tokenIdMap[U"MULASSIGN"] = 107;
80 tokenIdMap[U"MUTABLE"] = 18;
81 tokenIdMap[U"NAMESPACE"] = 34;
82 tokenIdMap[U"NEQ"] = 76;
83 tokenIdMap[U"NEW"] = 44;
84 tokenIdMap[U"NULLPTR"] = 48;
85 tokenIdMap[U"OPERATOR"] = 37;
86 tokenIdMap[U"ORASSIGN"] = 116;
87 tokenIdMap[U"PLUS"] = 81;
88 tokenIdMap[U"PLUSASSIGN"] = 110;
89 tokenIdMap[U"PLUSPLUS"] = 86;
90 tokenIdMap[U"PREFIX"] = 2;
91 tokenIdMap[U"QUEST"] = 91;
92 tokenIdMap[U"RANGLE"] = 99;
93 tokenIdMap[U"RBRACE"] = 95;
94 tokenIdMap[U"RBRACKET"] = 97;
95 tokenIdMap[U"REGISTER"] = 15;
96 tokenIdMap[U"REINTERPRETCAST"] = 40;
97 tokenIdMap[U"REM"] = 85;
98 tokenIdMap[U"REMASSIGN"] = 109;
99 tokenIdMap[U"RETURN"] = 59;
100 tokenIdMap[U"RPAREN"] = 93;
101 tokenIdMap[U"SEMICOLON"] = 103;
102 tokenIdMap[U"SHIFTLEFT"] = 79;
103 tokenIdMap[U"SHIFTLEFTASSIGN"] = 112;
104 tokenIdMap[U"SHIFTRIGHT"] = 80;
105 tokenIdMap[U"SHIFTRIGHTASSIGN"] = 113;
106 tokenIdMap[U"SHORT"] = 22;
107 tokenIdMap[U"SIGNED"] = 25;
108 tokenIdMap[U"SIZEOF"] = 36;
109 tokenIdMap[U"STAR"] = 83;
110 tokenIdMap[U"STATIC"] = 16;
111 tokenIdMap[U"STATICCAST"] = 39;
112 tokenIdMap[U"STRINGLIT"] = 67;
113 tokenIdMap[U"SWITCH"] = 53;
114 tokenIdMap[U"THIS"] = 43;
115 tokenIdMap[U"THROW"] = 35;
116 tokenIdMap[U"TOKENS"] = 3;
117 tokenIdMap[U"TRUE"] = 46;
118 tokenIdMap[U"TRY"] = 61;
119 tokenIdMap[U"TYPEDEF"] = 30;
120 tokenIdMap[U"TYPEID"] = 42;
121 tokenIdMap[U"UNSIGNED"] = 26;
122 tokenIdMap[U"USING"] = 33;
123 tokenIdMap[U"VARIABLES"] = 7;
124 tokenIdMap[U"VOID"] = 29;
125 tokenIdMap[U"VOLATILE"] = 32;
126 tokenIdMap[U"WCHART"] = 20;
127 tokenIdMap[U"WHILE"] = 54;
128 tokenIdMap[U"XORASSIGN"] = 115;
129 }
130
131 int GetTokenId(const std::u32string& tokenName)
132 {
133 auto it = tokenIdMap.find(tokenName);
134 if (it != tokenIdMap.cend())
135 {
136 return it->second;
137 }
138 else
139 {
140 return -1;
141 }
142 }
143
144 const char* tokenName[] =
145 {
146 "END",
147 "CLASSMAP",
148 "PREFIX",
149 "TOKENS",
150 "KEYWORDS",
151 "EXPRESSIONS",
152 "LEXER",
153 "VARIABLES",
154 "ACTIONS",
155 "API",
156 "INCLUDE",
157 "FILEPATH",
158 "DOLLAR",
159 "EXCLAMATION",
160 "AUTO",
161 "REGISTER",
162 "STATIC",
163 "EXTERN",
164 "MUTABLE",
165 "CHAR",
166 "WCHART",
167 "BOOL",
168 "SHORT",
169 "INT",
170 "LONG",
171 "SIGNED",
172 "UNSIGNED",
173 "FLOAT",
174 "DOUBLE",
175 "VOID",
176 "TYPEDEF",
177 "CONST",
178 "VOLATILE",
179 "USING",
180 "NAMESPACE",
181 "THROW",
182 "SIZEOF",
183 "OPERATOR",
184 "DYNAMICCAST",
185 "STATICCAST",
186 "REINTERPRETCAST",
187 "CONSTCAST",
188 "TYPEID",
189 "THIS",
190 "NEW",
191 "DELETE",
192 "TRUE",
193 "FALSE",
194 "NULLPTR",
195 "CASE",
196 "DEFAULT",
197 "IF",
198 "ELSE",
199 "SWITCH",
200 "WHILE",
201 "DO",
202 "FOR",
203 "BREAK",
204 "CONTINUE",
205 "RETURN",
206 "GOTO",
207 "TRY",
208 "CATCH",
209 "ID",
210 "INTLIT",
211 "FLOATINGLIT",
212 "CHARLIT",
213 "STRINGLIT",
214 "DISJUNCTION",
215 "AMPAMP",
216 "DOTSTAR",
217 "ARROWSTAR",
218 "BITOR",
219 "BITXOR",
220 "AMP",
221 "EQ",
222 "NEQ",
223 "LEQ",
224 "GEQ",
225 "SHIFTLEFT",
226 "SHIFTRIGHT",
227 "PLUS",
228 "MINUS",
229 "STAR",
230 "DIV",
231 "REM",
232 "PLUSPLUS",
233 "MINUSMINUS",
234 "CPL",
235 "DOT",
236 "ARROW",
237 "QUEST",
238 "LPAREN",
239 "RPAREN",
240 "LBRACE",
241 "RBRACE",
242 "LBRACKET",
243 "RBRACKET",
244 "LANGLE",
245 "RANGLE",
246 "ELLIPSIS",
247 "COLONCOLON",
248 "COLON",
249 "SEMICOLON",
250 "HASH",
251 "COMMA",
252 "ASSIGN",
253 "MULASSIGN",
254 "DIVASSIGN",
255 "REMASSIGN",
256 "PLUSASSIGN",
257 "MINUSASSIGN",
258 "SHIFTLEFTASSIGN",
259 "SHIFTRIGHTASSIGN",
260 "ANDASSIGN",
261 "XORASSIGN",
262 "ORASSIGN"
263 };
264
265 const char* GetTokenName(int tokenId)
266 {
267 return tokenName[tokenId];
268 }
269
270 const char* tokenInfo[] =
271 {
272 "end of file",
273 "'classmap'",
274 "'prefix'",
275 "'tokens'",
276 "'keywords'",
277 "'expressions'",
278 "'lexer'",
279 "''variables'",
280 "'actions'",
281 "'api'",
282 "'include'",
283 "file path",
284 "'$'",
285 "'!'",
286 "'auto'",
287 "'register'",
288 "'static'",
289 "'extern'",
290 "'mutable'",
291 "'char'",
292 "'wchar_t'",
293 "'bool'",
294 "'short'",
295 "'int'",
296 "'long'",
297 "'signed'",
298 "'unsigned'",
299 "'float'",
300 "'double'",
301 "'void'",
302 "'typedef'",
303 "'const'",
304 "'volatile'",
305 "'using'",
306 "'namespace'",
307 "'throw'",
308 "'sizeof'",
309 "'operator'",
310 "'dynamic_cast'",
311 "'static_cast'",
312 "'reinterpret_cast'",
313 "'const_cast'",
314 "'typeid'",
315 "'this'",
316 "'new'",
317 "'delete'",
318 "'true'",
319 "'false'",
320 "'nullptr'",
321 "'case'",
322 "'default'",
323 "'if'",
324 "'else'",
325 "'switch'",
326 "'while'",
327 "'do'",
328 "'for'",
329 "'break'",
330 "'continue'",
331 "'return'",
332 "'goto'",
333 "'try'",
334 "'catch'",
335 "identifier",
336 "integer literal",
337 "floating literal",
338 "character literal",
339 "string literal",
340 "'||'",
341 "'&&'",
342 "'.*'",
343 "'->*'",
344 "'|'",
345 "'^'",
346 "'&'",
347 "'=='",
348 "'!='",
349 "'<='",
350 "'>='",
351 "'<<'",
352 "'>>'",
353 "'+'",
354 "'-'",
355 "'*'",
356 "'/'",
357 "'%'",
358 "'++'",
359 "'--'",
360 "'~'",
361 "'.'",
362 "'->'",
363 "'?'",
364 "'('",
365 "')'",
366 "'{'",
367 "'}'",
368 "'['",
369 "']'",
370 "'<'",
371 "'>'",
372 "'...'",
373 "'::'",
374 "':'",
375 "';'",
376 "'#'",
377 "','",
378 "'='",
379 "'*='",
380 "'/='",
381 "'%='",
382 "'+='",
383 "'-='",
384 "'<<='",
385 "'>>='",
386 "'&='",
387 "'^='",
388 "'|='"
389 };
390
391 const char* GetTokenInfo(int tokenId)
392 {
393 return tokenInfo[tokenId];
394 }
395
396 struct Initializer
397 {
398 Initializer() { InitTokenIdMap(); }
399 };
400
401 Initializer initializer;
402 }