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