1
2
3
4 #include <sngcm/cmlexer/LexerFileTokenLexerTokens.hpp>
5 #include <map>
6
7 namespace LexerFileTokenLexerTokens
8 {
9 std::map<std::u32string, int> tokenIdMap;
10
11 void InitTokenIdMap()
12 {
13 tokenIdMap[U"ABSTRACT"] = 48;
14 tokenIdMap[U"ACTIONS"] = 7;
15 tokenIdMap[U"AMP"] = 98;
16 tokenIdMap[U"AMPAMP"] = 95;
17 tokenIdMap[U"AND"] = 84;
18 tokenIdMap[U"ARROW"] = 114;
19 tokenIdMap[U"AS"] = 36;
20 tokenIdMap[U"ASSERT"] = 9;
21 tokenIdMap[U"ASSIGN"] = 124;
22 tokenIdMap[U"AXIOM"] = 83;
23 tokenIdMap[U"BASE"] = 72;
24 tokenIdMap[U"BITOR"] = 96;
25 tokenIdMap[U"BITXOR"] = 97;
26 tokenIdMap[U"BLOCKCOMMENT"] = 130;
27 tokenIdMap[U"BLOCKCOMMENTLINE"] = 131;
28 tokenIdMap[U"BOOL"] = 12;
29 tokenIdMap[U"BREAK"] = 62;
30 tokenIdMap[U"BYTE"] = 16;
31 tokenIdMap[U"CASE"] = 57;
32 tokenIdMap[U"CAST"] = 30;
33 tokenIdMap[U"CATCH"] = 79;
34 tokenIdMap[U"CDECL"] = 41;
35 tokenIdMap[U"CHAR"] = 25;
36 tokenIdMap[U"CHARLIT"] = 90;
37 tokenIdMap[U"CLASS"] = 52;
38 tokenIdMap[U"CLASSMAP"] = 1;
39 tokenIdMap[U"COLON"] = 125;
40 tokenIdMap[U"COMMA"] = 123;
41 tokenIdMap[U"CONCEPT"] = 81;
42 tokenIdMap[U"CONST"] = 68;
43 tokenIdMap[U"CONSTEXPR"] = 69;
44 tokenIdMap[U"CONSTRUCT"] = 73;
45 tokenIdMap[U"CONTINUE"] = 63;
46 tokenIdMap[U"CPL"] = 112;
47 tokenIdMap[U"DEFAULT"] = 58;
48 tokenIdMap[U"DELEGATE"] = 39;
49 tokenIdMap[U"DELETE"] = 76;
50 tokenIdMap[U"DESTROY"] = 74;
51 tokenIdMap[U"DISJUNCTION"] = 94;
52 tokenIdMap[U"DIV"] = 108;
53 tokenIdMap[U"DO"] = 60;
54 tokenIdMap[U"DOLLAR"] = 8;
55 tokenIdMap[U"DOT"] = 113;
56 tokenIdMap[U"DOUBLE"] = 24;
57 tokenIdMap[U"ELIF"] = 10;
58 tokenIdMap[U"ELSE"] = 55;
59 tokenIdMap[U"ENDIF"] = 11;
60 tokenIdMap[U"ENUM"] = 29;
61 tokenIdMap[U"EQ"] = 99;
62 tokenIdMap[U"EQUIVALENCE"] = 92;
63 tokenIdMap[U"EXCLAMATION"] = 86;
64 tokenIdMap[U"EXPLICIT"] = 38;
65 tokenIdMap[U"EXPRESSIONS"] = 4;
66 tokenIdMap[U"EXTERN"] = 35;
67 tokenIdMap[U"FALSE"] = 14;
68 tokenIdMap[U"FLOAT"] = 23;
69 tokenIdMap[U"FLOATINGLIT"] = 88;
70 tokenIdMap[U"FOR"] = 61;
71 tokenIdMap[U"GEQ"] = 102;
72 tokenIdMap[U"GOTO"] = 64;
73 tokenIdMap[U"HASH"] = 127;
74 tokenIdMap[U"ID"] = 133;
75 tokenIdMap[U"IF"] = 54;
76 tokenIdMap[U"IMPLICATION"] = 93;
77 tokenIdMap[U"INLINE"] = 40;
78 tokenIdMap[U"INT"] = 19;
79 tokenIdMap[U"INTERFACE"] = 31;
80 tokenIdMap[U"INTERNAL"] = 46;
81 tokenIdMap[U"INTLIT"] = 89;
82 tokenIdMap[U"IS"] = 37;
83 tokenIdMap[U"KEYWORD"] = 132;
84 tokenIdMap[U"KEYWORDS"] = 3;
85 tokenIdMap[U"LANGLE"] = 119;
86 tokenIdMap[U"LBRACE"] = 121;
87 tokenIdMap[U"LBRACKET"] = 115;
88 tokenIdMap[U"LEQ"] = 101;
89 tokenIdMap[U"LEXER"] = 5;
90 tokenIdMap[U"LINECOMMENT"] = 129;
91 tokenIdMap[U"LONG"] = 21;
92 tokenIdMap[U"LPAREN"] = 117;
93 tokenIdMap[U"MAX"] = 136;
94 tokenIdMap[U"MINUS"] = 106;
95 tokenIdMap[U"MINUSMINUS"] = 111;
96 tokenIdMap[U"NAMESPACE"] = 32;
97 tokenIdMap[U"NEQ"] = 100;
98 tokenIdMap[U"NEW"] = 75;
99 tokenIdMap[U"NOTHROW"] = 42;
100 tokenIdMap[U"NULLLIT"] = 70;
101 tokenIdMap[U"NUMBER"] = 134;
102 tokenIdMap[U"OPERATOR"] = 51;
103 tokenIdMap[U"OR"] = 85;
104 tokenIdMap[U"OTHER"] = 135;
105 tokenIdMap[U"OVERRIDE"] = 49;
106 tokenIdMap[U"PLUS"] = 105;
107 tokenIdMap[U"PLUSPLUS"] = 110;
108 tokenIdMap[U"PRIVATE"] = 45;
109 tokenIdMap[U"PROTECTED"] = 44;
110 tokenIdMap[U"PUBLIC"] = 43;
111 tokenIdMap[U"RANGLE"] = 120;
112 tokenIdMap[U"RBRACE"] = 122;
113 tokenIdMap[U"RBRACKET"] = 116;
114 tokenIdMap[U"REM"] = 109;
115 tokenIdMap[U"RETURN"] = 53;
116 tokenIdMap[U"RPAREN"] = 118;
117 tokenIdMap[U"SBYTE"] = 15;
118 tokenIdMap[U"SEMICOLON"] = 126;
119 tokenIdMap[U"SHIFTLEFT"] = 103;
120 tokenIdMap[U"SHIFTRIGHT"] = 104;
121 tokenIdMap[U"SHORT"] = 17;
122 tokenIdMap[U"SIZEOF"] = 77;
123 tokenIdMap[U"STAR"] = 107;
124 tokenIdMap[U"STATIC"] = 34;
125 tokenIdMap[U"STRINGLIT"] = 91;
126 tokenIdMap[U"SUPPRESS"] = 50;
127 tokenIdMap[U"SWITCH"] = 56;
128 tokenIdMap[U"THIS"] = 71;
129 tokenIdMap[U"THROW"] = 80;
130 tokenIdMap[U"TOKENS"] = 2;
131 tokenIdMap[U"TRUE"] = 13;
132 tokenIdMap[U"TRY"] = 78;
133 tokenIdMap[U"TYPEDEF"] = 65;
134 tokenIdMap[U"TYPEID"] = 67;
135 tokenIdMap[U"TYPENAME"] = 66;
136 tokenIdMap[U"UCHAR"] = 27;
137 tokenIdMap[U"UINT"] = 20;
138 tokenIdMap[U"ULONG"] = 22;
139 tokenIdMap[U"UNIT_TEST"] = 87;
140 tokenIdMap[U"USHORT"] = 18;
141 tokenIdMap[U"USING"] = 33;
142 tokenIdMap[U"VARIABLES"] = 6;
143 tokenIdMap[U"VIRTUAL"] = 47;
144 tokenIdMap[U"VOID"] = 28;
145 tokenIdMap[U"WCHAR"] = 26;
146 tokenIdMap[U"WHERE"] = 82;
147 tokenIdMap[U"WHILE"] = 59;
148 tokenIdMap[U"WS"] = 128;
149 }
150
151 int GetTokenId(const std::u32string& tokenName)
152 {
153 auto it = tokenIdMap.find(tokenName);
154 if (it != tokenIdMap.cend())
155 {
156 return it->second;
157 }
158 else
159 {
160 return -1;
161 }
162 }
163
164 const char* tokenName[] =
165 {
166 "END",
167 "CLASSMAP",
168 "TOKENS",
169 "KEYWORDS",
170 "EXPRESSIONS",
171 "LEXER",
172 "VARIABLES",
173 "ACTIONS",
174 "DOLLAR",
175 "ASSERT",
176 "ELIF",
177 "ENDIF",
178 "BOOL",
179 "TRUE",
180 "FALSE",
181 "SBYTE",
182 "BYTE",
183 "SHORT",
184 "USHORT",
185 "INT",
186 "UINT",
187 "LONG",
188 "ULONG",
189 "FLOAT",
190 "DOUBLE",
191 "CHAR",
192 "WCHAR",
193 "UCHAR",
194 "VOID",
195 "ENUM",
196 "CAST",
197 "INTERFACE",
198 "NAMESPACE",
199 "USING",
200 "STATIC",
201 "EXTERN",
202 "AS",
203 "IS",
204 "EXPLICIT",
205 "DELEGATE",
206 "INLINE",
207 "CDECL",
208 "NOTHROW",
209 "PUBLIC",
210 "PROTECTED",
211 "PRIVATE",
212 "INTERNAL",
213 "VIRTUAL",
214 "ABSTRACT",
215 "OVERRIDE",
216 "SUPPRESS",
217 "OPERATOR",
218 "CLASS",
219 "RETURN",
220 "IF",
221 "ELSE",
222 "SWITCH",
223 "CASE",
224 "DEFAULT",
225 "WHILE",
226 "DO",
227 "FOR",
228 "BREAK",
229 "CONTINUE",
230 "GOTO",
231 "TYPEDEF",
232 "TYPENAME",
233 "TYPEID",
234 "CONST",
235 "CONSTEXPR",
236 "NULLLIT",
237 "THIS",
238 "BASE",
239 "CONSTRUCT",
240 "DESTROY",
241 "NEW",
242 "DELETE",
243 "SIZEOF",
244 "TRY",
245 "CATCH",
246 "THROW",
247 "CONCEPT",
248 "WHERE",
249 "AXIOM",
250 "AND",
251 "OR",
252 "EXCLAMATION",
253 "UNIT_TEST",
254 "FLOATINGLIT",
255 "INTLIT",
256 "CHARLIT",
257 "STRINGLIT",
258 "EQUIVALENCE",
259 "IMPLICATION",
260 "DISJUNCTION",
261 "AMPAMP",
262 "BITOR",
263 "BITXOR",
264 "AMP",
265 "EQ",
266 "NEQ",
267 "LEQ",
268 "GEQ",
269 "SHIFTLEFT",
270 "SHIFTRIGHT",
271 "PLUS",
272 "MINUS",
273 "STAR",
274 "DIV",
275 "REM",
276 "PLUSPLUS",
277 "MINUSMINUS",
278 "CPL",
279 "DOT",
280 "ARROW",
281 "LBRACKET",
282 "RBRACKET",
283 "LPAREN",
284 "RPAREN",
285 "LANGLE",
286 "RANGLE",
287 "LBRACE",
288 "RBRACE",
289 "COMMA",
290 "ASSIGN",
291 "COLON",
292 "SEMICOLON",
293 "HASH",
294 "WS",
295 "LINECOMMENT",
296 "BLOCKCOMMENT",
297 "BLOCKCOMMENTLINE",
298 "KEYWORD",
299 "ID",
300 "NUMBER",
301 "OTHER",
302 "MAX"
303 };
304
305 const char* GetTokenName(int tokenId)
306 {
307 return tokenName[tokenId];
308 }
309
310 const char* tokenInfo[] =
311 {
312 "end of file",
313 "'classmap'",
314 "'tokens'",
315 "'keywords'",
316 "'expressions'",
317 "'lexer'",
318 "''variables'",
319 "'actions'",
320 "'$'",
321 "'assert'",
322 "'elif'",
323 "'endif'",
324 "'bool'",
325 "'true'",
326 "'false'",
327 "'sbyte'",
328 "'byte'",
329 "'short'",
330 "'ushort'",
331 "'int'",
332 "'uint'",
333 "'long'",
334 "'ulong'",
335 "'float'",
336 "'double'",
337 "'char'",
338 "'wchar'",
339 "'uchar'",
340 "'void'",
341 "'enum'",
342 "'cast'",
343 "'interface'",
344 "'namespace'",
345 "'using'",
346 "'static'",
347 "'extern'",
348 "'as'",
349 "'is'",
350 "'explicit'",
351 "'delegate'",
352 "'inline'",
353 "'cdecl'",
354 "'nothrow'",
355 "'public'",
356 "'protected'",
357 "'private'",
358 "'internal'",
359 "'virtual'",
360 "'abstract'",
361 "'override'",
362 "'suppress'",
363 "'operator'",
364 "'class'",
365 "'return'",
366 "'if'",
367 "'else'",
368 "'switch'",
369 "'case'",
370 "'default'",
371 "'while'",
372 "'do'",
373 "'for'",
374 "'break'",
375 "'continue'",
376 "'goto'",
377 "'typedef'",
378 "'typename'",
379 "'typeid'",
380 "'const'",
381 "'constexpr'",
382 "'null'",
383 "'this'",
384 "'base'",
385 "'construct'",
386 "'destroy'",
387 "'new'",
388 "'delete'",
389 "'sizeof'",
390 "'try'",
391 "'catch'",
392 "'throw'",
393 "'concept'",
394 "'where'",
395 "'axiom'",
396 "'and'",
397 "'or'",
398 "'!'",
399 "'unit_test'",
400 "floating literal",
401 "integer literal",
402 "character literal",
403 "string literal",
404 "'<=>'",
405 "'=>'",
406 "'||'",
407 "'&&'",
408 "'|'",
409 "'^'",
410 "'&'",
411 "'=='",
412 "'!='",
413 "'<='",
414 "'>='",
415 "'<<'",
416 "'>>'",
417 "'+'",
418 "'-'",
419 "'*'",
420 "'/'",
421 "'%'",
422 "'++'",
423 "'--'",
424 "'~'",
425 "'.'",
426 "'->'",
427 "'['",
428 "']'",
429 "'('",
430 "')'",
431 "'<'",
432 "'>'",
433 "'{'",
434 "'}'",
435 "','",
436 "'='",
437 "':'",
438 "';'",
439 "'#'",
440 "white space",
441 "line comment",
442 "block comment",
443 "block comment line",
444 "keyword",
445 "identifier",
446 "number",
447 "other",
448 "max"
449 };
450
451 const char* GetTokenInfo(int tokenId)
452 {
453 return tokenInfo[tokenId];
454 }
455
456 struct Initializer
457 {
458 Initializer() { InitTokenIdMap(); }
459 };
460
461 Initializer initializer;
462 }