1 using System;
2
3 namespace LexerFileTokens
4 {
5 public const int END = 0;
6
7 public const int CLASSMAP = 1;
8
9 public const int TOKENS = 2;
10
11 public const int KEYWORDS = 3;
12
13 public const int EXPRESSIONS = 4;
14
15 public const int LEXER = 5;
16
17 public const int VARIABLES = 6;
18
19 public const int ACTIONS = 7;
20
21 public const int DOLLAR = 8;
22
23 public const int ASSERT = 9;
24
25 public const int ELIF = 10;
26
27 public const int ENDIF = 11;
28
29 public const int BOOL = 12;
30
31 public const int TRUE = 13;
32
33 public const int FALSE = 14;
34
35 public const int SBYTE = 15;
36
37 public const int BYTE = 16;
38
39 public const int SHORT = 17;
40
41 public const int USHORT = 18;
42
43 public const int INT = 19;
44
45 public const int UINT = 20;
46
47 public const int LONG = 21;
48
49 public const int ULONG = 22;
50
51 public const int FLOAT = 23;
52
53 public const int DOUBLE = 24;
54
55 public const int CHAR = 25;
56
57 public const int WCHAR = 26;
58
59 public const int UCHAR = 27;
60
61 public const int VOID = 28;
62
63 public const int ENUM = 29;
64
65 public const int CAST = 30;
66
67 public const int INTERFACE = 31;
68
69 public const int NAMESPACE = 32;
70
71 public const int USING = 33;
72
73 public const int STATIC = 34;
74
75 public const int EXTERN = 35;
76
77 public const int AS = 36;
78
79 public const int IS = 37;
80
81 public const int EXPLICIT = 38;
82
83 public const int DELEGATE = 39;
84
85 public const int INLINE = 40;
86
87 public const int CDECL = 41;
88
89 public const int NOTHROW = 42;
90
91 public const int PUBLIC = 43;
92
93 public const int PROTECTED = 44;
94
95 public const int PRIVATE = 45;
96
97 public const int INTERNAL = 46;
98
99 public const int VIRTUAL = 47;
100
101 public const int ABSTRACT = 48;
102
103 public const int OVERRIDE = 49;
104
105 public const int SUPPRESS = 50;
106
107 public const int OPERATOR = 51;
108
109 public const int CLASS = 52;
110
111 public const int RETURN = 53;
112
113 public const int IF = 54;
114
115 public const int ELSE = 55;
116
117 public const int SWITCH = 56;
118
119 public const int CASE = 57;
120
121 public const int DEFAULT = 58;
122
123 public const int WHILE = 59;
124
125 public const int DO = 60;
126
127 public const int FOR = 61;
128
129 public const int BREAK = 62;
130
131 public const int CONTINUE = 63;
132
133 public const int GOTO = 64;
134
135 public const int TYPEDEF = 65;
136
137 public const int TYPENAME = 66;
138
139 public const int TYPEID = 67;
140
141 public const int CONST = 68;
142
143 public const int CONSTEXPR = 69;
144
145 public const int NULLLIT = 70;
146
147 public const int THIS = 71;
148
149 public const int BASE = 72;
150
151 public const int CONSTRUCT = 73;
152
153 public const int DESTROY = 74;
154
155 public const int NEW = 75;
156
157 public const int DELETE = 76;
158
159 public const int SIZEOF = 77;
160
161 public const int TRY = 78;
162
163 public const int CATCH = 79;
164
165 public const int THROW = 80;
166
167 public const int CONCEPT = 81;
168
169 public const int WHERE = 82;
170
171 public const int AXIOM = 83;
172
173 public const int AND = 84;
174
175 public const int OR = 85;
176
177 public const int EXCLAMATION = 86;
178
179 public const int UNIT_TEST = 87;
180
181 public const int ID = 88;
182
183 public const int FLOATINGLIT = 89;
184
185 public const int INTLIT = 90;
186
187 public const int CHARLIT = 91;
188
189 public const int STRINGLIT = 92;
190
191 public const int EQUIVALENCE = 93;
192
193 public const int IMPLICATION = 94;
194
195 public const int DISJUNCTION = 95;
196
197 public const int AMPAMP = 96;
198
199 public const int BITOR = 97;
200
201 public const int BITXOR = 98;
202
203 public const int AMP = 99;
204
205 public const int EQ = 100;
206
207 public const int NEQ = 101;
208
209 public const int LEQ = 102;
210
211 public const int GEQ = 103;
212
213 public const int SHIFTLEFT = 104;
214
215 public const int SHIFTRIGHT = 105;
216
217 public const int PLUS = 106;
218
219 public const int MINUS = 107;
220
221 public const int STAR = 108;
222
223 public const int DIV = 109;
224
225 public const int REM = 110;
226
227 public const int PLUSPLUS = 111;
228
229 public const int MINUSMINUS = 112;
230
231 public const int CPL = 113;
232
233 public const int DOT = 114;
234
235 public const int ARROW = 115;
236
237 public const int LBRACKET = 116;
238
239 public const int RBRACKET = 117;
240
241 public const int LPAREN = 118;
242
243 public const int RPAREN = 119;
244
245 public const int LANGLE = 120;
246
247 public const int RANGLE = 121;
248
249 public const int LBRACE = 122;
250
251 public const int RBRACE = 123;
252
253 public const int COMMA = 124;
254
255 public const int ASSIGN = 125;
256
257 public const int COLON = 126;
258
259 public const int SEMICOLON = 127;
260
261 public const int HASH = 128u;
262
263 internal class TokenMap
264 {
265 static TokenMap() :
266 instance(new TokenMap())
267 {
268 }
269 public static TokenMap& Instance()
270 {
271 return *instance;
272 }
273 public int GetTokenId(const ustring& tokenName)
274 {
275 System.Collections.Map<ustring, int>.ConstIterator it = tokenIdMap.CFind(tokenName);
276 if (it != tokenIdMap.CEnd())
277 {
278 return it->second;
279 }
280 else
281 {
282 return -1;
283 }
284 }
285 public ustring GetTokenName(int tokenId)
286 {
287 return tokenNameList[tokenId];
288 }
289 public ustring GetTokenInfo(int tokenId)
290 {
291 return tokenInfoList[tokenId];
292 }
293 private TokenMap()
294 {
295 tokenIdMap[u"ABSTRACT"] = 48;
296 tokenIdMap[u"ACTIONS"] = 7;
297 tokenIdMap[u"AMP"] = 99;
298 tokenIdMap[u"AMPAMP"] = 96;
299 tokenIdMap[u"AND"] = 84;
300 tokenIdMap[u"ARROW"] = 115;
301 tokenIdMap[u"AS"] = 36;
302 tokenIdMap[u"ASSERT"] = 9;
303 tokenIdMap[u"ASSIGN"] = 125;
304 tokenIdMap[u"AXIOM"] = 83;
305 tokenIdMap[u"BASE"] = 72;
306 tokenIdMap[u"BITOR"] = 97;
307 tokenIdMap[u"BITXOR"] = 98;
308 tokenIdMap[u"BOOL"] = 12;
309 tokenIdMap[u"BREAK"] = 62;
310 tokenIdMap[u"BYTE"] = 16;
311 tokenIdMap[u"CASE"] = 57;
312 tokenIdMap[u"CAST"] = 30;
313 tokenIdMap[u"CATCH"] = 79;
314 tokenIdMap[u"CDECL"] = 41;
315 tokenIdMap[u"CHAR"] = 25;
316 tokenIdMap[u"CHARLIT"] = 91;
317 tokenIdMap[u"CLASS"] = 52;
318 tokenIdMap[u"CLASSMAP"] = 1;
319 tokenIdMap[u"COLON"] = 126;
320 tokenIdMap[u"COMMA"] = 124;
321 tokenIdMap[u"CONCEPT"] = 81;
322 tokenIdMap[u"CONST"] = 68;
323 tokenIdMap[u"CONSTEXPR"] = 69;
324 tokenIdMap[u"CONSTRUCT"] = 73;
325 tokenIdMap[u"CONTINUE"] = 63;
326 tokenIdMap[u"CPL"] = 113;
327 tokenIdMap[u"DEFAULT"] = 58;
328 tokenIdMap[u"DELEGATE"] = 39;
329 tokenIdMap[u"DELETE"] = 76;
330 tokenIdMap[u"DESTROY"] = 74;
331 tokenIdMap[u"DISJUNCTION"] = 95;
332 tokenIdMap[u"DIV"] = 109;
333 tokenIdMap[u"DO"] = 60;
334 tokenIdMap[u"DOLLAR"] = 8;
335 tokenIdMap[u"DOT"] = 114;
336 tokenIdMap[u"DOUBLE"] = 24;
337 tokenIdMap[u"ELIF"] = 10;
338 tokenIdMap[u"ELSE"] = 55;
339 tokenIdMap[u"ENDIF"] = 11;
340 tokenIdMap[u"ENUM"] = 29;
341 tokenIdMap[u"EQ"] = 100;
342 tokenIdMap[u"EQUIVALENCE"] = 93;
343 tokenIdMap[u"EXCLAMATION"] = 86;
344 tokenIdMap[u"EXPLICIT"] = 38;
345 tokenIdMap[u"EXPRESSIONS"] = 4;
346 tokenIdMap[u"EXTERN"] = 35;
347 tokenIdMap[u"FALSE"] = 14;
348 tokenIdMap[u"FLOAT"] = 23;
349 tokenIdMap[u"FLOATINGLIT"] = 89;
350 tokenIdMap[u"FOR"] = 61;
351 tokenIdMap[u"GEQ"] = 103;
352 tokenIdMap[u"GOTO"] = 64;
353 tokenIdMap[u"HASH"] = 128u;
354 tokenIdMap[u"ID"] = 88;
355 tokenIdMap[u"IF"] = 54;
356 tokenIdMap[u"IMPLICATION"] = 94;
357 tokenIdMap[u"INLINE"] = 40;
358 tokenIdMap[u"INT"] = 19;
359 tokenIdMap[u"INTERFACE"] = 31;
360 tokenIdMap[u"INTERNAL"] = 46;
361 tokenIdMap[u"INTLIT"] = 90;
362 tokenIdMap[u"IS"] = 37;
363 tokenIdMap[u"KEYWORDS"] = 3;
364 tokenIdMap[u"LANGLE"] = 120;
365 tokenIdMap[u"LBRACE"] = 122;
366 tokenIdMap[u"LBRACKET"] = 116;
367 tokenIdMap[u"LEQ"] = 102;
368 tokenIdMap[u"LEXER"] = 5;
369 tokenIdMap[u"LONG"] = 21;
370 tokenIdMap[u"LPAREN"] = 118;
371 tokenIdMap[u"MINUS"] = 107;
372 tokenIdMap[u"MINUSMINUS"] = 112;
373 tokenIdMap[u"NAMESPACE"] = 32;
374 tokenIdMap[u"NEQ"] = 101;
375 tokenIdMap[u"NEW"] = 75;
376 tokenIdMap[u"NOTHROW"] = 42;
377 tokenIdMap[u"NULLLIT"] = 70;
378 tokenIdMap[u"OPERATOR"] = 51;
379 tokenIdMap[u"OR"] = 85;
380 tokenIdMap[u"OVERRIDE"] = 49;
381 tokenIdMap[u"PLUS"] = 106;
382 tokenIdMap[u"PLUSPLUS"] = 111;
383 tokenIdMap[u"PRIVATE"] = 45;
384 tokenIdMap[u"PROTECTED"] = 44;
385 tokenIdMap[u"PUBLIC"] = 43;
386 tokenIdMap[u"RANGLE"] = 121;
387 tokenIdMap[u"RBRACE"] = 123;
388 tokenIdMap[u"RBRACKET"] = 117;
389 tokenIdMap[u"REM"] = 110;
390 tokenIdMap[u"RETURN"] = 53;
391 tokenIdMap[u"RPAREN"] = 119;
392 tokenIdMap[u"SBYTE"] = 15;
393 tokenIdMap[u"SEMICOLON"] = 127;
394 tokenIdMap[u"SHIFTLEFT"] = 104;
395 tokenIdMap[u"SHIFTRIGHT"] = 105;
396 tokenIdMap[u"SHORT"] = 17;
397 tokenIdMap[u"SIZEOF"] = 77;
398 tokenIdMap[u"STAR"] = 108;
399 tokenIdMap[u"STATIC"] = 34;
400 tokenIdMap[u"STRINGLIT"] = 92;
401 tokenIdMap[u"SUPPRESS"] = 50;
402 tokenIdMap[u"SWITCH"] = 56;
403 tokenIdMap[u"THIS"] = 71;
404 tokenIdMap[u"THROW"] = 80;
405 tokenIdMap[u"TOKENS"] = 2;
406 tokenIdMap[u"TRUE"] = 13;
407 tokenIdMap[u"TRY"] = 78;
408 tokenIdMap[u"TYPEDEF"] = 65;
409 tokenIdMap[u"TYPEID"] = 67;
410 tokenIdMap[u"TYPENAME"] = 66;
411 tokenIdMap[u"UCHAR"] = 27;
412 tokenIdMap[u"UINT"] = 20;
413 tokenIdMap[u"ULONG"] = 22;
414 tokenIdMap[u"UNIT_TEST"] = 87;
415 tokenIdMap[u"USHORT"] = 18;
416 tokenIdMap[u"USING"] = 33;
417 tokenIdMap[u"VARIABLES"] = 6;
418 tokenIdMap[u"VIRTUAL"] = 47;
419 tokenIdMap[u"VOID"] = 28;
420 tokenIdMap[u"WCHAR"] = 26;
421 tokenIdMap[u"WHERE"] = 82;
422 tokenIdMap[u"WHILE"] = 59;
423 tokenNameList.Add(u"END");
424 tokenInfoList.Add(u"end of file");
425 tokenNameList.Add(u"CLASSMAP");
426 tokenInfoList.Add(u"\'classmap\'");
427 tokenNameList.Add(u"TOKENS");
428 tokenInfoList.Add(u"\'tokens\'");
429 tokenNameList.Add(u"KEYWORDS");
430 tokenInfoList.Add(u"\'keywords\'");
431 tokenNameList.Add(u"EXPRESSIONS");
432 tokenInfoList.Add(u"\'expressions\'");
433 tokenNameList.Add(u"LEXER");
434 tokenInfoList.Add(u"\'lexer\'");
435 tokenNameList.Add(u"VARIABLES");
436 tokenInfoList.Add(u"\'\'variables\'");
437 tokenNameList.Add(u"ACTIONS");
438 tokenInfoList.Add(u"\'actions\'");
439 tokenNameList.Add(u"DOLLAR");
440 tokenInfoList.Add(u"\'$\'");
441 tokenNameList.Add(u"ASSERT");
442 tokenInfoList.Add(u"\'assert\'");
443 tokenNameList.Add(u"ELIF");
444 tokenInfoList.Add(u"\'elif\'");
445 tokenNameList.Add(u"ENDIF");
446 tokenInfoList.Add(u"\'endif\'");
447 tokenNameList.Add(u"BOOL");
448 tokenInfoList.Add(u"\'bool\'");
449 tokenNameList.Add(u"TRUE");
450 tokenInfoList.Add(u"\'true\'");
451 tokenNameList.Add(u"FALSE");
452 tokenInfoList.Add(u"\'false\'");
453 tokenNameList.Add(u"SBYTE");
454 tokenInfoList.Add(u"\'sbyte\'");
455 tokenNameList.Add(u"BYTE");
456 tokenInfoList.Add(u"\'byte\'");
457 tokenNameList.Add(u"SHORT");
458 tokenInfoList.Add(u"\'short\'");
459 tokenNameList.Add(u"USHORT");
460 tokenInfoList.Add(u"\'ushort\'");
461 tokenNameList.Add(u"INT");
462 tokenInfoList.Add(u"\'int\'");
463 tokenNameList.Add(u"UINT");
464 tokenInfoList.Add(u"\'uint\'");
465 tokenNameList.Add(u"LONG");
466 tokenInfoList.Add(u"\'long\'");
467 tokenNameList.Add(u"ULONG");
468 tokenInfoList.Add(u"\'ulong\'");
469 tokenNameList.Add(u"FLOAT");
470 tokenInfoList.Add(u"\'float\'");
471 tokenNameList.Add(u"DOUBLE");
472 tokenInfoList.Add(u"\'double\'");
473 tokenNameList.Add(u"CHAR");
474 tokenInfoList.Add(u"\'char\'");
475 tokenNameList.Add(u"WCHAR");
476 tokenInfoList.Add(u"\'wchar\'");
477 tokenNameList.Add(u"UCHAR");
478 tokenInfoList.Add(u"\'uchar\'");
479 tokenNameList.Add(u"VOID");
480 tokenInfoList.Add(u"\'void\'");
481 tokenNameList.Add(u"ENUM");
482 tokenInfoList.Add(u"\'enum\'");
483 tokenNameList.Add(u"CAST");
484 tokenInfoList.Add(u"\'cast\'");
485 tokenNameList.Add(u"INTERFACE");
486 tokenInfoList.Add(u"\'interface\'");
487 tokenNameList.Add(u"NAMESPACE");
488 tokenInfoList.Add(u"\'namespace\'");
489 tokenNameList.Add(u"USING");
490 tokenInfoList.Add(u"\'using\'");
491 tokenNameList.Add(u"STATIC");
492 tokenInfoList.Add(u"\'static\'");
493 tokenNameList.Add(u"EXTERN");
494 tokenInfoList.Add(u"\'extern\'");
495 tokenNameList.Add(u"AS");
496 tokenInfoList.Add(u"\'as\'");
497 tokenNameList.Add(u"IS");
498 tokenInfoList.Add(u"\'is\'");
499 tokenNameList.Add(u"EXPLICIT");
500 tokenInfoList.Add(u"\'explicit\'");
501 tokenNameList.Add(u"DELEGATE");
502 tokenInfoList.Add(u"\'delegate\'");
503 tokenNameList.Add(u"INLINE");
504 tokenInfoList.Add(u"\'inline\'");
505 tokenNameList.Add(u"CDECL");
506 tokenInfoList.Add(u"\'cdecl\'");
507 tokenNameList.Add(u"NOTHROW");
508 tokenInfoList.Add(u"\'nothrow\'");
509 tokenNameList.Add(u"PUBLIC");
510 tokenInfoList.Add(u"\'public\'");
511 tokenNameList.Add(u"PROTECTED");
512 tokenInfoList.Add(u"\'protected\'");
513 tokenNameList.Add(u"PRIVATE");
514 tokenInfoList.Add(u"\'private\'");
515 tokenNameList.Add(u"INTERNAL");
516 tokenInfoList.Add(u"\'internal\'");
517 tokenNameList.Add(u"VIRTUAL");
518 tokenInfoList.Add(u"\'virtual\'");
519 tokenNameList.Add(u"ABSTRACT");
520 tokenInfoList.Add(u"\'abstract\'");
521 tokenNameList.Add(u"OVERRIDE");
522 tokenInfoList.Add(u"\'override\'");
523 tokenNameList.Add(u"SUPPRESS");
524 tokenInfoList.Add(u"\'suppress\'");
525 tokenNameList.Add(u"OPERATOR");
526 tokenInfoList.Add(u"\'operator\'");
527 tokenNameList.Add(u"CLASS");
528 tokenInfoList.Add(u"\'class\'");
529 tokenNameList.Add(u"RETURN");
530 tokenInfoList.Add(u"\'return\'");
531 tokenNameList.Add(u"IF");
532 tokenInfoList.Add(u"\'if\'");
533 tokenNameList.Add(u"ELSE");
534 tokenInfoList.Add(u"\'else\'");
535 tokenNameList.Add(u"SWITCH");
536 tokenInfoList.Add(u"\'switch\'");
537 tokenNameList.Add(u"CASE");
538 tokenInfoList.Add(u"\'case\'");
539 tokenNameList.Add(u"DEFAULT");
540 tokenInfoList.Add(u"\'default\'");
541 tokenNameList.Add(u"WHILE");
542 tokenInfoList.Add(u"\'while\'");
543 tokenNameList.Add(u"DO");
544 tokenInfoList.Add(u"\'do\'");
545 tokenNameList.Add(u"FOR");
546 tokenInfoList.Add(u"\'for\'");
547 tokenNameList.Add(u"BREAK");
548 tokenInfoList.Add(u"\'break\'");
549 tokenNameList.Add(u"CONTINUE");
550 tokenInfoList.Add(u"\'continue\'");
551 tokenNameList.Add(u"GOTO");
552 tokenInfoList.Add(u"\'goto\'");
553 tokenNameList.Add(u"TYPEDEF");
554 tokenInfoList.Add(u"\'typedef\'");
555 tokenNameList.Add(u"TYPENAME");
556 tokenInfoList.Add(u"\'typename\'");
557 tokenNameList.Add(u"TYPEID");
558 tokenInfoList.Add(u"\'typeid\'");
559 tokenNameList.Add(u"CONST");
560 tokenInfoList.Add(u"\'const\'");
561 tokenNameList.Add(u"CONSTEXPR");
562 tokenInfoList.Add(u"\'constexpr\'");
563 tokenNameList.Add(u"NULLLIT");
564 tokenInfoList.Add(u"\'null\'");
565 tokenNameList.Add(u"THIS");
566 tokenInfoList.Add(u"\'this\'");
567 tokenNameList.Add(u"BASE");
568 tokenInfoList.Add(u"\'base\'");
569 tokenNameList.Add(u"CONSTRUCT");
570 tokenInfoList.Add(u"\'construct\'");
571 tokenNameList.Add(u"DESTROY");
572 tokenInfoList.Add(u"\'destroy\'");
573 tokenNameList.Add(u"NEW");
574 tokenInfoList.Add(u"\'new\'");
575 tokenNameList.Add(u"DELETE");
576 tokenInfoList.Add(u"\'delete\'");
577 tokenNameList.Add(u"SIZEOF");
578 tokenInfoList.Add(u"\'sizeof\'");
579 tokenNameList.Add(u"TRY");
580 tokenInfoList.Add(u"\'try\'");
581 tokenNameList.Add(u"CATCH");
582 tokenInfoList.Add(u"\'catch\'");
583 tokenNameList.Add(u"THROW");
584 tokenInfoList.Add(u"\'throw\'");
585 tokenNameList.Add(u"CONCEPT");
586 tokenInfoList.Add(u"\'concept\'");
587 tokenNameList.Add(u"WHERE");
588 tokenInfoList.Add(u"\'where\'");
589 tokenNameList.Add(u"AXIOM");
590 tokenInfoList.Add(u"\'axiom\'");
591 tokenNameList.Add(u"AND");
592 tokenInfoList.Add(u"\'and\'");
593 tokenNameList.Add(u"OR");
594 tokenInfoList.Add(u"\'or\'");
595 tokenNameList.Add(u"EXCLAMATION");
596 tokenInfoList.Add(u"\'!\'");
597 tokenNameList.Add(u"UNIT_TEST");
598 tokenInfoList.Add(u"\'unit_test\'");
599 tokenNameList.Add(u"ID");
600 tokenInfoList.Add(u"identifier");
601 tokenNameList.Add(u"FLOATINGLIT");
602 tokenInfoList.Add(u"floating literal");
603 tokenNameList.Add(u"INTLIT");
604 tokenInfoList.Add(u"integer literal");
605 tokenNameList.Add(u"CHARLIT");
606 tokenInfoList.Add(u"character literal");
607 tokenNameList.Add(u"STRINGLIT");
608 tokenInfoList.Add(u"string literal");
609 tokenNameList.Add(u"EQUIVALENCE");
610 tokenInfoList.Add(u"\'<=>\'");
611 tokenNameList.Add(u"IMPLICATION");
612 tokenInfoList.Add(u"\'=>\'");
613 tokenNameList.Add(u"DISJUNCTION");
614 tokenInfoList.Add(u"\'||\'");
615 tokenNameList.Add(u"AMPAMP");
616 tokenInfoList.Add(u"\'&&\'");
617 tokenNameList.Add(u"BITOR");
618 tokenInfoList.Add(u"\'|\'");
619 tokenNameList.Add(u"BITXOR");
620 tokenInfoList.Add(u"\'^\'");
621 tokenNameList.Add(u"AMP");
622 tokenInfoList.Add(u"\'&\'");
623 tokenNameList.Add(u"EQ");
624 tokenInfoList.Add(u"\'==\'");
625 tokenNameList.Add(u"NEQ");
626 tokenInfoList.Add(u"\'!=\'");
627 tokenNameList.Add(u"LEQ");
628 tokenInfoList.Add(u"\'<=\'");
629 tokenNameList.Add(u"GEQ");
630 tokenInfoList.Add(u"\'>=\'");
631 tokenNameList.Add(u"SHIFTLEFT");
632 tokenInfoList.Add(u"\'<<\'");
633 tokenNameList.Add(u"SHIFTRIGHT");
634 tokenInfoList.Add(u"\'>>\'");
635 tokenNameList.Add(u"PLUS");
636 tokenInfoList.Add(u"\'+\'");
637 tokenNameList.Add(u"MINUS");
638 tokenInfoList.Add(u"\'-\'");
639 tokenNameList.Add(u"STAR");
640 tokenInfoList.Add(u"\'*\'");
641 tokenNameList.Add(u"DIV");
642 tokenInfoList.Add(u"\'/\'");
643 tokenNameList.Add(u"REM");
644 tokenInfoList.Add(u"\'%\'");
645 tokenNameList.Add(u"PLUSPLUS");
646 tokenInfoList.Add(u"\'++\'");
647 tokenNameList.Add(u"MINUSMINUS");
648 tokenInfoList.Add(u"\'--\'");
649 tokenNameList.Add(u"CPL");
650 tokenInfoList.Add(u"\'~\'");
651 tokenNameList.Add(u"DOT");
652 tokenInfoList.Add(u"\'.\'");
653 tokenNameList.Add(u"ARROW");
654 tokenInfoList.Add(u"\'->\'");
655 tokenNameList.Add(u"LBRACKET");
656 tokenInfoList.Add(u"\'[\'");
657 tokenNameList.Add(u"RBRACKET");
658 tokenInfoList.Add(u"\']\'");
659 tokenNameList.Add(u"LPAREN");
660 tokenInfoList.Add(u"\'(\'");
661 tokenNameList.Add(u"RPAREN");
662 tokenInfoList.Add(u"\')\'");
663 tokenNameList.Add(u"LANGLE");
664 tokenInfoList.Add(u"\'<\'");
665 tokenNameList.Add(u"RANGLE");
666 tokenInfoList.Add(u"\'>\'");
667 tokenNameList.Add(u"LBRACE");
668 tokenInfoList.Add(u"\'{\'");
669 tokenNameList.Add(u"RBRACE");
670 tokenInfoList.Add(u"\'}\'");
671 tokenNameList.Add(u"COMMA");
672 tokenInfoList.Add(u"\',\'");
673 tokenNameList.Add(u"ASSIGN");
674 tokenInfoList.Add(u"\'=\'");
675 tokenNameList.Add(u"COLON");
676 tokenInfoList.Add(u"\':\'");
677 tokenNameList.Add(u"SEMICOLON");
678 tokenInfoList.Add(u"\';\'");
679 tokenNameList.Add(u"HASH");
680 tokenInfoList.Add(u"\'#\'");
681 }
682 private static System.UniquePtr<TokenMap> instance;
683 private System.Collections.Map<ustring, int> tokenIdMap;
684 private System.Collections.List<ustring> tokenNameList;
685 private System.Collections.List<ustring> tokenInfoList;
686 }
687
688 public int GetTokenId(const ustring& tokenName)
689 {
690 return TokenMap.Instance().GetTokenId(tokenName);
691 }
692
693 public ustring GetTokenName(int tokenId)
694 {
695 return TokenMap.Instance().GetTokenName(tokenId);
696 }
697
698 public ustring GetTokenInfo(int tokenId)
699 {
700 return TokenMap.Instance().GetTokenInfo(tokenId);
701 }
702 }