1 * ANTLR-generated file resulting from grammar preproc.g
3 *
4 * Terence Parr, MageLang Institute
5 * with John Lilley, Empathy Software
6 * ANTLR Version 2.5.0; 1996,1997
7 */
8
9 package antlr.preprocessor;
10
11 import java.io.InputStream;
12 import java.io.Reader;
13 import java.io.IOException;
14 import java.util.Hashtable;
15 import antlr.CharScanner;
16 import antlr.InputBuffer;
17 import antlr.ByteBuffer;
18 import antlr.CharBuffer;
19 import antlr.Token;
20 import antlr.CommonToken;
21 import antlr.ScannerException;
22 import antlr.Tokenizer;
23 import antlr.ANTLRHashString;
24 import antlr.collections.impl.BitSet;
25 public class PreprocessorLexer extends CharScannercanner implements PreprocessorTokenTypes, Tokenizer
26 {
27 public PreprocessorLexer(InputStream in) {
28 this(new ByteBuffer(in));
29 }
30 public PreprocessorLexer(Reader in) {
31 this(new CharBuffer(in));
32 }
33 public PreprocessorLexer(InputBuffer ib) {
34 super(ib);
35 literals = new Hashtable();
36 literals.put(new ANTLRHashString("catch", this), new Integer(27));
37 literals.put(new ANTLRHashString("exception", this), new Integer(26));
38 literals.put(new ANTLRHashString("class", this), new Integer(6));
39 literals.put(new ANTLRHashString("public", this), new Integer(21));
40 literals.put(new ANTLRHashString("tokens", this), new Integer(16));
41 literals.put(new ANTLRHashString("returns", this), new Integer(24));
42 literals.put(new ANTLRHashString("private", this), new Integer(20));
43 literals.put(new ANTLRHashString("protected", this), new Integer(19));
44 literals.put(new ANTLRHashString("extends", this), new Integer(8));
45 caseSensitiveLiterals = true;
46 setCaseSensitive(true);
47 }
48
49 public Token nextToken() throws IOException {
50 Token _rettoken=null;
51 tryAgain:
52 for (;;) {
53 Token _token = null;
54 int _ttype = Token.INVALID_TYPE;
55 resetText();
56 try { switch ( LA(1)) {
58 case ':':
59 {
60 mRULE_BLOCK(true);
61 _rettoken=_returnToken;
62 break;
63 }
64 case '\t': case '\n': case '\r': case ' ':
65 {
66 mWS(true);
67 _rettoken=_returnToken;
68 break;
69 }
70 case '(':
71 {
72 mSUBRULE_BLOCK(true);
73 _rettoken=_returnToken;
74 break;
75 }
76 case '/':
77 {
78 mCOMMENT(true);
79 _rettoken=_returnToken;
80 break;
81 }
82 case '{':
83 {
84 mACTION(true);
85 _rettoken=_returnToken;
86 break;
87 }
88 case '"':
89 {
90 mSTRING_LITERAL(true);
91 _rettoken=_returnToken;
92 break;
93 }
94 case '\'':
95 {
96 mCHAR_LITERAL(true);
97 _rettoken=_returnToken;
98 break;
99 }
100 case '!':
101 {
102 mBANG(true);
103 _rettoken=_returnToken;
104 break;
105 }
106 case ';':
107 {
108 mSEMI(true);
109 _rettoken=_returnToken;
110 break;
111 }
112 case '}':
113 {
114 mRCURLY(true);
115 _rettoken=_returnToken;
116 break;
117 }
118 case 'A': case 'B': case 'C': case 'D':
119 case 'E': case 'F': case 'G': case 'H':
120 case 'I': case 'J': case 'K': case 'L':
121 case 'M': case 'N': case 'O': case 'P':
122 case 'Q': case 'R': case 'S': case 'T':
123 case 'U': case 'V': case 'W': case 'X':
124 case 'Y': case 'Z': case '_': case 'a':
125 case 'b': case 'c': case 'd': case 'e':
126 case 'f': case 'g': case 'h': case 'i':
127 case 'j': case 'k': case 'l': case 'm':
128 case 'n': case 'o': case 'p': case 'q':
129 case 'r': case 's': case 't': case 'u':
130 case 'v': case 'w': case 'x': case 'y':
131 case 'z':
132 {
133 mID_OR_KEYWORD(true);
134 _rettoken=_returnToken;
135 break;
136 }
137 case '=':
138 {
139 mASSIGN_RHS(true);
140 _rettoken=_returnToken;
141 break;
142 }
143 case '[':
144 {
145 mARG_ACTION(true);
146 _rettoken=_returnToken;
147 break;
148 }
149 default:
150 {
151 if (LA(1)==EOF_CHAR) {_returnToken = makeToken(Token.EOF_TYPE);}
152 else {throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());}
153 }
154 }
155 if ( _returnToken==null ) continue tryAgain; _ttype = _returnToken.getType();
157 _ttype = testLiteralsTable(_ttype);
158 _returnToken.setType(_ttype);
159 return _returnToken;
160 }
161 catch (ScannerException e) {
162 reportError(e);
163 consume();
164 }
165 }
166 }
167
168 public final void mRULE_BLOCK(boolean _createToken) throws ScannerException, IOException {
169 int _ttype; Token _token=null; int _begin=text.length();
170 _ttype = RULE_BLOCK;
171 int _saveIndex;
172
173 match(':');
174 {
175 if ((_tokenSet_0.member(LA(1))) && (_tokenSet_1.member(LA(2)))) {
176 _saveIndex=text.length();
177 mWS(false);
178 text.setLength(_saveIndex);
179 }
180 else if ((_tokenSet_1.member(LA(1)))) {
181 }
182 else {
183 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
184 }
185
186 }
187 mALT(false);
188 {
189 switch ( LA(1)) {
190 case '\t': case '\n': case '\r': case ' ':
191 {
192 _saveIndex=text.length();
193 mWS(false);
194 text.setLength(_saveIndex);
195 break;
196 }
197 case ';': case '|':
198 {
199 break;
200 }
201 default:
202 {
203 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
204 }
205 }
206 }
207 {
208 _loop43:
209 do {
210 if ((LA(1)=='|')) {
211 match('|');
212 {
213 if ((_tokenSet_0.member(LA(1))) && (_tokenSet_1.member(LA(2)))) {
214 _saveIndex=text.length();
215 mWS(false);
216 text.setLength(_saveIndex);
217 }
218 else if ((_tokenSet_1.member(LA(1)))) {
219 }
220 else {
221 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
222 }
223
224 }
225 mALT(false);
226 {
227 switch ( LA(1)) {
228 case '\t': case '\n': case '\r': case ' ':
229 {
230 _saveIndex=text.length();
231 mWS(false);
232 text.setLength(_saveIndex);
233 break;
234 }
235 case ';': case '|':
236 {
237 break;
238 }
239 default:
240 {
241 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
242 }
243 }
244 }
245 }
246 else {
247 break _loop43;
248 }
249
250 } while (true);
251 }
252 match(';');
253 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
254 _token = makeToken(_ttype);
255 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
256 }
257 _returnToken = _token;
258 }
259
260 public final void mWS(boolean _createToken) throws ScannerException, IOException {
261 int _ttype; Token _token=null; int _begin=text.length();
262 _ttype = WS;
263 int _saveIndex;
264
265 {
266 int _cnt82=0;
267 _loop82:
268 do {
269 if ((LA(1)==' ')) {
270 match(' ');
271 }
272 else if ((LA(1)=='\t')) {
273 match('\t');
274 }
275 else if ((LA(1)=='\r')) {
276 match('\r');
277 {
278 if ((LA(1)=='\n')) {
279 match('\n');
280 }
281 else {
282 }
283
284 }
285 newline();
286 }
287 else if ((LA(1)=='\n')) {
288 match('\n');
289 newline();
290 }
291 else {
292 if ( _cnt82>=1 ) { break _loop82; } else {throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());}
293 }
294
295 _cnt82++;
296 } while (true);
297 }
298 _ttype = Token.SKIP;
299 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
300 _token = makeToken(_ttype);
301 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
302 }
303 _returnToken = _token;
304 }
305
306 protected final void mALT(boolean _createToken) throws ScannerException, IOException {
307 int _ttype; Token _token=null; int _begin=text.length();
308 _ttype = ALT;
309 int _saveIndex;
310
311 {
312 _loop54:
313 do {
314 if ((_tokenSet_2.member(LA(1))) && ((LA(2) >= '\3' && LA(2) <= '~'))) {
315 mELEMENT(false);
316 }
317 else {
318 break _loop54;
319 }
320
321 } while (true);
322 }
323 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
324 _token = makeToken(_ttype);
325 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
326 }
327 _returnToken = _token;
328 }
329
330 public final void mSUBRULE_BLOCK(boolean _createToken) throws ScannerException, IOException {
331 int _ttype; Token _token=null; int _begin=text.length();
332 _ttype = SUBRULE_BLOCK;
333 int _saveIndex;
334
335 match('(');
336 {
337 if ((_tokenSet_0.member(LA(1))) && (_tokenSet_3.member(LA(2)))) {
338 mWS(false);
339 }
340 else if ((_tokenSet_3.member(LA(1)))) {
341 }
342 else {
343 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
344 }
345
346 }
347 mALT(false);
348 {
349 _loop49:
350 do {
351 if ((_tokenSet_4.member(LA(1))) && (_tokenSet_3.member(LA(2)))) {
352 {
353 switch ( LA(1)) {
354 case '\t': case '\n': case '\r': case ' ':
355 {
356 mWS(false);
357 break;
358 }
359 case '|':
360 {
361 break;
362 }
363 default:
364 {
365 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
366 }
367 }
368 }
369 match('|');
370 {
371 if ((_tokenSet_0.member(LA(1))) && (_tokenSet_3.member(LA(2)))) {
372 mWS(false);
373 }
374 else if ((_tokenSet_3.member(LA(1)))) {
375 }
376 else {
377 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
378 }
379
380 }
381 mALT(false);
382 }
383 else {
384 break _loop49;
385 }
386
387 } while (true);
388 }
389 {
390 switch ( LA(1)) {
391 case '\t': case '\n': case '\r': case ' ':
392 {
393 mWS(false);
394 break;
395 }
396 case ')':
397 {
398 break;
399 }
400 default:
401 {
402 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
403 }
404 }
405 }
406 match(')');
407 {
408 if ((LA(1)=='=') && (LA(2)=='>')) {
409 match("=>");
410 }
411 else if ((LA(1)=='*')) {
412 match('*');
413 }
414 else if ((LA(1)=='+')) {
415 match('+');
416 }
417 else if ((LA(1)=='?')) {
418 match('?');
419 }
420 else {
421 }
422
423 }
424 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
425 _token = makeToken(_ttype);
426 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
427 }
428 _returnToken = _token;
429 }
430
431 protected final void mELEMENT(boolean _createToken) throws ScannerException, IOException {
432 int _ttype; Token _token=null; int _begin=text.length();
433 _ttype = ELEMENT;
434 int _saveIndex;
435
436 switch ( LA(1)) {
437 case '/':
438 {
439 mCOMMENT(false);
440 break;
441 }
442 case '{':
443 {
444 mACTION(false);
445 break;
446 }
447 case '"':
448 {
449 mSTRING_LITERAL(false);
450 break;
451 }
452 case '\'':
453 {
454 mCHAR_LITERAL(false);
455 break;
456 }
457 case '(':
458 {
459 mSUBRULE_BLOCK(false);
460 break;
461 }
462 case '\r':
463 {
464 match('\r');
465 {
466 if ((LA(1)=='\n') && ((LA(2) >= '\3' && LA(2) <= '~'))) {
467 match('\n');
468 }
469 else if (((LA(1) >= '\3' && LA(1) <= '~'))) {
470 }
471 else {
472 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
473 }
474
475 }
476 newline();
477 break;
478 }
479 case '\n':
480 {
481 match('\n');
482 newline();
483 break;
484 }
485 case '\3': case '\4': case '\5': case '\6':
486 case '\7': case '\10': case '\t': case '\13':
487 case '\14': case '\16': case '\17': case '\20':
488 case '\21': case '\22': case '\23': case '\24':
489 case '\25': case '\26': case '\27': case '\30':
490 case '\31': case '\32': case '\33': case '\34':
491 case '\35': case '\36': case '\37': case ' ':
492 case '!': case '#': case '$': case '%':
493 case '&': case '*': case '+': case ',':
494 case '-': case '.': case '0': case '1':
495 case '2': case '3': case '4': case '5':
496 case '6': case '7': case '8': case '9':
497 case ':': case '<': case '=': case '>':
498 case '?': case '@': case 'A': case 'B':
499 case 'C': case 'D': case 'E': case 'F':
500 case 'G': case 'H': case 'I': case 'J':
501 case 'K': case 'L': case 'M': case 'N':
502 case 'O': case 'P': case 'Q': case 'R':
503 case 'S': case 'T': case 'U': case 'V':
504 case 'W': case 'X': case 'Y': case 'Z':
505 case '[': case '\\': case ']': case '^':
506 case '_': case '`': case 'a': case 'b':
507 case 'c': case 'd': case 'e': case 'f':
508 case 'g': case 'h': case 'i': case 'j':
509 case 'k': case 'l': case 'm': case 'n':
510 case 'o': case 'p': case 'q': case 'r':
511 case 's': case 't': case 'u': case 'v':
512 case 'w': case 'x': case 'y': case 'z':
513 case '|': case '}': case '~':
514 {
515 {
516 int _cnt59=0;
517 _loop59:
518 do {
519 if ((_tokenSet_5.member(LA(1))) && ((LA(2) >= '\3' && LA(2) <= '~'))) {
520 {
521 match(_tokenSet_5);
522 }
523 }
524 else {
525 if ( _cnt59>=1 ) { break _loop59; } else {throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());}
526 }
527
528 _cnt59++;
529 } while (true);
530 }
531 break;
532 }
533 default:
534 {
535 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
536 }
537 }
538 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
539 _token = makeToken(_ttype);
540 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
541 }
542 _returnToken = _token;
543 }
544
545 public final void mCOMMENT(boolean _createToken) throws ScannerException, IOException {
546 int _ttype; Token _token=null; int _begin=text.length();
547 _ttype = COMMENT;
548 int _saveIndex;
549
550 {
551 if ((LA(1)=='/') && (LA(2)=='/')) {
552 mSL_COMMENT(false);
553 }
554 else if ((LA(1)=='/') && (LA(2)=='*')) {
555 mML_COMMENT(false);
556 }
557 else {
558 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
559 }
560
561 }
562 _ttype = Token.SKIP;
563 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
564 _token = makeToken(_ttype);
565 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
566 }
567 _returnToken = _token;
568 }
569
570 public final void mACTION(boolean _createToken) throws ScannerException, IOException {
571 int _ttype; Token _token=null; int _begin=text.length();
572 _ttype = ACTION;
573 int _saveIndex;
574
575 match('{');
576 {
577 _loop117:
578 do {
579 switch ( LA(1)) {
580 case '\r':
581 {
582 match('\r');
583 {
584 if ((LA(1)=='\n') && ((LA(2) >= '\3' && LA(2) <= '~'))) {
585 match('\n');
586 }
587 else if (((LA(1) >= '\3' && LA(1) <= '~'))) {
588 }
589 else {
590 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
591 }
592
593 }
594 newline();
595 break;
596 }
597 case '\n':
598 {
599 match('\n');
600 newline();
601 break;
602 }
603 case '{':
604 {
605 mACTION(false);
606 break;
607 }
608 case '\'':
609 {
610 mCHAR_LITERAL(false);
611 break;
612 }
613 case '"':
614 {
615 mSTRING_LITERAL(false);
616 break;
617 }
618 default:
619 if (((LA(1)=='/') && (LA(2)=='*'||LA(2)=='/'))&&(LA(2)=='/'||LA(2)=='*')) {
620 mCOMMENT(false);
621 }
622 else if (((LA(1)=='/') && ((LA(2) >= '\3' && LA(2) <= '~')))&&(true)) {
623 match('/');
624 }
625 else if (((_tokenSet_6.member(LA(1))))&&(true)) {
626 matchNot('}');
627 }
628 else {
629 break _loop117;
630 }
631 }
632 } while (true);
633 }
634 match('}');
635 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
636 _token = makeToken(_ttype);
637 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
638 }
639 _returnToken = _token;
640 }
641
642 public final void mSTRING_LITERAL(boolean _createToken) throws ScannerException, IOException {
643 int _ttype; Token _token=null; int _begin=text.length();
644 _ttype = STRING_LITERAL;
645 int _saveIndex;
646
647 match('"');
648 {
649 _loop100:
650 do {
651 switch ( LA(1)) {
652 case '\\':
653 {
654 mESC(false);
655 break;
656 }
657 case '\3': case '\4': case '\5': case '\6':
658 case '\7': case '\10': case '\t': case '\n':
659 case '\13': case '\14': case '\r': case '\16':
660 case '\17': case '\20': case '\21': case '\22':
661 case '\23': case '\24': case '\25': case '\26':
662 case '\27': case '\30': case '\31': case '\32':
663 case '\33': case '\34': case '\35': case '\36':
664 case '\37': case ' ': case '!': case '#':
665 case '$': case '%': case '&': case '\'':
666 case '(': case ')': case '*': case '+':
667 case ',': case '-': case '.': case '/':
668 case '0': case '1': case '2': case '3':
669 case '4': case '5': case '6': case '7':
670 case '8': case '9': case ':': case ';':
671 case '<': case '=': case '>': case '?':
672 case '@': case 'A': case 'B': case 'C':
673 case 'D': case 'E': case 'F': case 'G':
674 case 'H': case 'I': case 'J': case 'K':
675 case 'L': case 'M': case 'N': case 'O':
676 case 'P': case 'Q': case 'R': case 'S':
677 case 'T': case 'U': case 'V': case 'W':
678 case 'X': case 'Y': case 'Z': case '[':
679 case ']': case '^': case '_': case '`':
680 case 'a': case 'b': case 'c': case 'd':
681 case 'e': case 'f': case 'g': case 'h':
682 case 'i': case 'j': case 'k': case 'l':
683 case 'm': case 'n': case 'o': case 'p':
684 case 'q': case 'r': case 's': case 't':
685 case 'u': case 'v': case 'w': case 'x':
686 case 'y': case 'z': case '{': case '|':
687 case '}': case '~':
688 {
689 matchNot('"');
690 break;
691 }
692 default:
693 {
694 break _loop100;
695 }
696 }
697 } while (true);
698 }
699 match('"');
700 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
701 _token = makeToken(_ttype);
702 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
703 }
704 _returnToken = _token;
705 }
706
707 public final void mCHAR_LITERAL(boolean _createToken) throws ScannerException, IOException {
708 int _ttype; Token _token=null; int _begin=text.length();
709 _ttype = CHAR_LITERAL;
710 int _saveIndex;
711
712 match('\'');
713 {
714 switch ( LA(1)) {
715 case '\\':
716 {
717 mESC(false);
718 break;
719 }
720 case '\3': case '\4': case '\5': case '\6':
721 case '\7': case '\10': case '\t': case '\n':
722 case '\13': case '\14': case '\r': case '\16':
723 case '\17': case '\20': case '\21': case '\22':
724 case '\23': case '\24': case '\25': case '\26':
725 case '\27': case '\30': case '\31': case '\32':
726 case '\33': case '\34': case '\35': case '\36':
727 case '\37': case ' ': case '!': case '"':
728 case '#': case '$': case '%': case '&':
729 case '(': case ')': case '*': case '+':
730 case ',': case '-': case '.': case '/':
731 case '0': case '1': case '2': case '3':
732 case '4': case '5': case '6': case '7':
733 case '8': case '9': case ':': case ';':
734 case '<': case '=': case '>': case '?':
735 case '@': case 'A': case 'B': case 'C':
736 case 'D': case 'E': case 'F': case 'G':
737 case 'H': case 'I': case 'J': case 'K':
738 case 'L': case 'M': case 'N': case 'O':
739 case 'P': case 'Q': case 'R': case 'S':
740 case 'T': case 'U': case 'V': case 'W':
741 case 'X': case 'Y': case 'Z': case '[':
742 case ']': case '^': case '_': case '`':
743 case 'a': case 'b': case 'c': case 'd':
744 case 'e': case 'f': case 'g': case 'h':
745 case 'i': case 'j': case 'k': case 'l':
746 case 'm': case 'n': case 'o': case 'p':
747 case 'q': case 'r': case 's': case 't':
748 case 'u': case 'v': case 'w': case 'x':
749 case 'y': case 'z': case '{': case '|':
750 case '}': case '~':
751 {
752 matchNot('\'');
753 break;
754 }
755 default:
756 {
757 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
758 }
759 }
760 }
761 match('\'');
762 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
763 _token = makeToken(_ttype);
764 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
765 }
766 _returnToken = _token;
767 }
768
769 public final void mBANG(boolean _createToken) throws ScannerException, IOException {
770 int _ttype; Token _token=null; int _begin=text.length();
771 _ttype = BANG;
772 int _saveIndex;
773
774 match('!');
775 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
776 _token = makeToken(_ttype);
777 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
778 }
779 _returnToken = _token;
780 }
781
782 public final void mSEMI(boolean _createToken) throws ScannerException, IOException {
783 int _ttype; Token _token=null; int _begin=text.length();
784 _ttype = SEMI;
785 int _saveIndex;
786
787 match(';');
788 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
789 _token = makeToken(_ttype);
790 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
791 }
792 _returnToken = _token;
793 }
794
795 public final void mRCURLY(boolean _createToken) throws ScannerException, IOException {
796 int _ttype; Token _token=null; int _begin=text.length();
797 _ttype = RCURLY;
798 int _saveIndex;
799
800 match('}');
801 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
802 _token = makeToken(_ttype);
803 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
804 }
805 _returnToken = _token;
806 }
807
808 * handled specially. For example, "header" is the start
810 * of the header action (used to distinguish between options
811 * block and an action). We do not want "header" to go back
812 * to the parser as a simple keyword...it must pick off
813 * the action afterwards.
814 */
815 public final void mID_OR_KEYWORD(boolean _createToken) throws ScannerException, IOException {
816 int _ttype; Token _token=null; int _begin=text.length();
817 _ttype = ID_OR_KEYWORD;
818 int _saveIndex;
819 Token id=null;
820
821 mID(true);
822 id=_returnToken;
823 _ttype = id.getType();
824 {
825 if (((_tokenSet_7.member(LA(1))) && ((LA(2) >= '\3' && LA(2) <= '~')))&&(id.getText().equals("header"))) {
826 {
827 switch ( LA(1)) {
828 case '\t': case '\n': case '\r': case ' ':
829 {
830 mWS(false);
831 break;
832 }
833 case '{':
834 {
835 break;
836 }
837 default:
838 {
839 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
840 }
841 }
842 }
843 mACTION(false);
844 _ttype = HEADER_ACTION;
845 }
846 else if (((_tokenSet_7.member(LA(1))))&&(id.getText().equals("tokens"))) {
847 {
848 switch ( LA(1)) {
849 case '\t': case '\n': case '\r': case ' ':
850 {
851 mWS(false);
852 break;
853 }
854 case '{':
855 {
856 break;
857 }
858 default:
859 {
860 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
861 }
862 }
863 }
864 match('{');
865 _ttype = TOKENS_START;
866 }
867 else if (((_tokenSet_7.member(LA(1))))&&(id.getText().equals("options"))) {
868 {
869 switch ( LA(1)) {
870 case '\t': case '\n': case '\r': case ' ':
871 {
872 mWS(false);
873 break;
874 }
875 case '{':
876 {
877 break;
878 }
879 default:
880 {
881 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
882 }
883 }
884 }
885 match('{');
886 _ttype = OPTIONS_START;
887 }
888 else {
889 }
890
891 }
892 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
893 _token = makeToken(_ttype);
894 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
895 }
896 _returnToken = _token;
897 }
898
899 protected final void mID(boolean _createToken) throws ScannerException, IOException {
900 int _ttype; Token _token=null; int _begin=text.length();
901 _ttype = ID;
902 int _saveIndex;
903
904 {
905 switch ( LA(1)) {
906 case 'a': case 'b': case 'c': case 'd':
907 case 'e': case 'f': case 'g': case 'h':
908 case 'i': case 'j': case 'k': case 'l':
909 case 'm': case 'n': case 'o': case 'p':
910 case 'q': case 'r': case 's': case 't':
911 case 'u': case 'v': case 'w': case 'x':
912 case 'y': case 'z':
913 {
914 matchRange('a','z');
915 break;
916 }
917 case 'A': case 'B': case 'C': case 'D':
918 case 'E': case 'F': case 'G': case 'H':
919 case 'I': case 'J': case 'K': case 'L':
920 case 'M': case 'N': case 'O': case 'P':
921 case 'Q': case 'R': case 'S': case 'T':
922 case 'U': case 'V': case 'W': case 'X':
923 case 'Y': case 'Z':
924 {
925 matchRange('A','Z');
926 break;
927 }
928 case '_':
929 {
930 match('_');
931 break;
932 }
933 default:
934 {
935 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
936 }
937 }
938 }
939 {
940 _loop71:
941 do {
942 switch ( LA(1)) {
943 case 'a': case 'b': case 'c': case 'd':
944 case 'e': case 'f': case 'g': case 'h':
945 case 'i': case 'j': case 'k': case 'l':
946 case 'm': case 'n': case 'o': case 'p':
947 case 'q': case 'r': case 's': case 't':
948 case 'u': case 'v': case 'w': case 'x':
949 case 'y': case 'z':
950 {
951 matchRange('a','z');
952 break;
953 }
954 case 'A': case 'B': case 'C': case 'D':
955 case 'E': case 'F': case 'G': case 'H':
956 case 'I': case 'J': case 'K': case 'L':
957 case 'M': case 'N': case 'O': case 'P':
958 case 'Q': case 'R': case 'S': case 'T':
959 case 'U': case 'V': case 'W': case 'X':
960 case 'Y': case 'Z':
961 {
962 matchRange('A','Z');
963 break;
964 }
965 case '_':
966 {
967 match('_');
968 break;
969 }
970 case '0': case '1': case '2': case '3':
971 case '4': case '5': case '6': case '7':
972 case '8': case '9':
973 {
974 matchRange('0','9');
975 break;
976 }
977 default:
978 {
979 break _loop71;
980 }
981 }
982 } while (true);
983 }
984 _ttype = testLiteralsTable(_ttype);
985 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
986 _token = makeToken(_ttype);
987 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
988 }
989 _returnToken = _token;
990 }
991
992 public final void mASSIGN_RHS(boolean _createToken) throws ScannerException, IOException {
993 int _ttype; Token _token=null; int _begin=text.length();
994 _ttype = ASSIGN_RHS;
995 int _saveIndex;
996
997 _saveIndex=text.length();
998 match('=');
999 text.setLength(_saveIndex);
1000 {
1001 if ((_tokenSet_0.member(LA(1))) && ((LA(2) >= '\3' && LA(2) <= '~'))) {
1002 _saveIndex=text.length();
1003 mWS(false);
1004 text.setLength(_saveIndex);
1005 }
1006 else if (((LA(1) >= '\3' && LA(1) <= '~'))) {
1007 }
1008 else {
1009 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
1010 }
1011
1012 }
1013 {
1014 _loop78:
1015 do {
1016 switch ( LA(1)) {
1017 case '"':
1018 {
1019 mSTRING_LITERAL(false);
1020 break;
1021 }
1022 case '\'':
1023 {
1024 mCHAR_LITERAL(false);
1025 break;
1026 }
1027 case '\3': case '\4': case '\5': case '\6':
1028 case '\7': case '\10': case '\t': case '\n':
1029 case '\13': case '\14': case '\r': case '\16':
1030 case '\17': case '\20': case '\21': case '\22':
1031 case '\23': case '\24': case '\25': case '\26':
1032 case '\27': case '\30': case '\31': case '\32':
1033 case '\33': case '\34': case '\35': case '\36':
1034 case '\37': case ' ': case '!': case '#':
1035 case '$': case '%': case '&': case '(':
1036 case ')': case '*': case '+': case ',':
1037 case '-': case '.': case '/': case '0':
1038 case '1': case '2': case '3': case '4':
1039 case '5': case '6': case '7': case '8':
1040 case '9': case ':': case '<': case '=':
1041 case '>': case '?': case '@': case 'A':
1042 case 'B': case 'C': case 'D': case 'E':
1043 case 'F': case 'G': case 'H': case 'I':
1044 case 'J': case 'K': case 'L': case 'M':
1045 case 'N': case 'O': case 'P': case 'Q':
1046 case 'R': case 'S': case 'T': case 'U':
1047 case 'V': case 'W': case 'X': case 'Y':
1048 case 'Z': case '[': case '\\': case ']':
1049 case '^': case '_': case '`': case 'a':
1050 case 'b': case 'c': case 'd': case 'e':
1051 case 'f': case 'g': case 'h': case 'i':
1052 case 'j': case 'k': case 'l': case 'm':
1053 case 'n': case 'o': case 'p': case 'q':
1054 case 'r': case 's': case 't': case 'u':
1055 case 'v': case 'w': case 'x': case 'y':
1056 case 'z': case '{': case '|': case '}':
1057 case '~':
1058 {
1059 {
1060 int _cnt77=0;
1061 _loop77:
1062 do {
1063 if ((_tokenSet_8.member(LA(1))) && ((LA(2) >= '\3' && LA(2) <= '~'))) {
1064 {
1065 match(_tokenSet_8);
1066 }
1067 }
1068 else {
1069 if ( _cnt77>=1 ) { break _loop77; } else {throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());}
1070 }
1071
1072 _cnt77++;
1073 } while (true);
1074 }
1075 break;
1076 }
1077 default:
1078 {
1079 break _loop78;
1080 }
1081 }
1082 } while (true);
1083 }
1084 match(';');
1085 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1086 _token = makeToken(_ttype);
1087 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
1088 }
1089 _returnToken = _token;
1090 }
1091
1092 protected final void mSL_COMMENT(boolean _createToken) throws ScannerException, IOException {
1093 int _ttype; Token _token=null; int _begin=text.length();
1094 _ttype = SL_COMMENT;
1095 int _saveIndex;
1096
1097 match("//");
1098 {
1099 _loop88:
1100 do {
1101 if ((_tokenSet_9.member(LA(1)))) {
1102 {
1103 match(_tokenSet_9);
1104 }
1105 }
1106 else {
1107 break _loop88;
1108 }
1109
1110 } while (true);
1111 }
1112 {
1113 switch ( LA(1)) {
1114 case '\n':
1115 {
1116 match('\n');
1117 break;
1118 }
1119 case '\r':
1120 {
1121 match('\r');
1122 {
1123 if ((LA(1)=='\n')) {
1124 match('\n');
1125 }
1126 else {
1127 }
1128
1129 }
1130 break;
1131 }
1132 default:
1133 {
1134 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
1135 }
1136 }
1137 }
1138 newline();
1139 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1140 _token = makeToken(_ttype);
1141 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
1142 }
1143 _returnToken = _token;
1144 }
1145
1146 protected final void mML_COMMENT(boolean _createToken) throws ScannerException, IOException {
1147 int _ttype; Token _token=null; int _begin=text.length();
1148 _ttype = ML_COMMENT;
1149 int _saveIndex;
1150
1151 match("/*");
1152 {
1153 _loop95:
1154 do {
1155 switch ( LA(1)) {
1156 case '\r':
1157 {
1158 match('\r');
1159 {
1160 if ((LA(1)=='\n') && ((LA(2) >= '\3' && LA(2) <= '~'))) {
1161 match('\n');
1162 }
1163 else if (((LA(1) >= '\3' && LA(1) <= '~')) && ((LA(2) >= '\3' && LA(2) <= '~'))) {
1164 }
1165 else {
1166 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
1167 }
1168
1169 }
1170 newline();
1171 break;
1172 }
1173 case '\n':
1174 {
1175 match('\n');
1176 newline();
1177 break;
1178 }
1179 case '\3': case '\4': case '\5': case '\6':
1180 case '\7': case '\10': case '\t': case '\13':
1181 case '\14': case '\16': case '\17': case '\20':
1182 case '\21': case '\22': case '\23': case '\24':
1183 case '\25': case '\26': case '\27': case '\30':
1184 case '\31': case '\32': case '\33': case '\34':
1185 case '\35': case '\36': case '\37': case ' ':
1186 case '!': case '"': case '#': case '$':
1187 case '%': case '&': case '\'': case '(':
1188 case ')': case '+': case ',': case '-':
1189 case '.': case '/': case '0': case '1':
1190 case '2': case '3': case '4': case '5':
1191 case '6': case '7': case '8': case '9':
1192 case ':': case ';': case '<': case '=':
1193 case '>': case '?': case '@': case 'A':
1194 case 'B': case 'C': case 'D': case 'E':
1195 case 'F': case 'G': case 'H': case 'I':
1196 case 'J': case 'K': case 'L': case 'M':
1197 case 'N': case 'O': case 'P': case 'Q':
1198 case 'R': case 'S': case 'T': case 'U':
1199 case 'V': case 'W': case 'X': case 'Y':
1200 case 'Z': case '[': case '\\': case ']':
1201 case '^': case '_': case '`': case 'a':
1202 case 'b': case 'c': case 'd': case 'e':
1203 case 'f': case 'g': case 'h': case 'i':
1204 case 'j': case 'k': case 'l': case 'm':
1205 case 'n': case 'o': case 'p': case 'q':
1206 case 'r': case 's': case 't': case 'u':
1207 case 'v': case 'w': case 'x': case 'y':
1208 case 'z': case '{': case '|': case '}':
1209 case '~':
1210 {
1211 {
1212 match(_tokenSet_10);
1213 }
1214 break;
1215 }
1216 default:
1217 if (((LA(1)=='*') && ((LA(2) >= '\3' && LA(2) <= '~')))&&( LA(2)!='/' )) {
1218 match('*');
1219 }
1220 else {
1221 break _loop95;
1222 }
1223 }
1224 } while (true);
1225 }
1226 match("*/");
1227 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1228 _token = makeToken(_ttype);
1229 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
1230 }
1231 _returnToken = _token;
1232 }
1233
1234 protected final void mESC(boolean _createToken) throws ScannerException, IOException {
1235 int _ttype; Token _token=null; int _begin=text.length();
1236 _ttype = ESC;
1237 int _saveIndex;
1238
1239 match('\\');
1240 {
1241 switch ( LA(1)) {
1242 case 'n':
1243 {
1244 match('n');
1245 break;
1246 }
1247 case 'r':
1248 {
1249 match('r');
1250 break;
1251 }
1252 case 't':
1253 {
1254 match('t');
1255 break;
1256 }
1257 case 'b':
1258 {
1259 match('b');
1260 break;
1261 }
1262 case 'f':
1263 {
1264 match('f');
1265 break;
1266 }
1267 case '"':
1268 {
1269 match('"');
1270 break;
1271 }
1272 case '\'':
1273 {
1274 match('\'');
1275 break;
1276 }
1277 case '\\':
1278 {
1279 match('\\');
1280 break;
1281 }
1282 case '0': case '1': case '2': case '3':
1283 {
1284 {
1285 matchRange('0','3');
1286 }
1287 {
1288 if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\3' && LA(2) <= '~'))) {
1289 mDIGIT(false);
1290 {
1291 if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\3' && LA(2) <= '~'))) {
1292 mDIGIT(false);
1293 }
1294 else if (((LA(1) >= '\3' && LA(1) <= '~'))) {
1295 }
1296 else {
1297 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
1298 }
1299
1300 }
1301 }
1302 else if (((LA(1) >= '\3' && LA(1) <= '~'))) {
1303 }
1304 else {
1305 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
1306 }
1307
1308 }
1309 break;
1310 }
1311 case '4': case '5': case '6': case '7':
1312 {
1313 {
1314 matchRange('4','7');
1315 }
1316 {
1317 if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\3' && LA(2) <= '~'))) {
1318 mDIGIT(false);
1319 }
1320 else if (((LA(1) >= '\3' && LA(1) <= '~'))) {
1321 }
1322 else {
1323 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
1324 }
1325
1326 }
1327 break;
1328 }
1329 case 'u':
1330 {
1331 match('u');
1332 mXDIGIT(false);
1333 mXDIGIT(false);
1334 mXDIGIT(false);
1335 mXDIGIT(false);
1336 break;
1337 }
1338 default:
1339 {
1340 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
1341 }
1342 }
1343 }
1344 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1345 _token = makeToken(_ttype);
1346 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
1347 }
1348 _returnToken = _token;
1349 }
1350
1351 protected final void mDIGIT(boolean _createToken) throws ScannerException, IOException {
1352 int _ttype; Token _token=null; int _begin=text.length();
1353 _ttype = DIGIT;
1354 int _saveIndex;
1355
1356 matchRange('0','9');
1357 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1358 _token = makeToken(_ttype);
1359 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
1360 }
1361 _returnToken = _token;
1362 }
1363
1364 protected final void mXDIGIT(boolean _createToken) throws ScannerException, IOException {
1365 int _ttype; Token _token=null; int _begin=text.length();
1366 _ttype = XDIGIT;
1367 int _saveIndex;
1368
1369 switch ( LA(1)) {
1370 case '0': case '1': case '2': case '3':
1371 case '4': case '5': case '6': case '7':
1372 case '8': case '9':
1373 {
1374 matchRange('0','9');
1375 break;
1376 }
1377 case 'a': case 'b': case 'c': case 'd':
1378 case 'e': case 'f':
1379 {
1380 matchRange('a','f');
1381 break;
1382 }
1383 case 'A': case 'B': case 'C': case 'D':
1384 case 'E': case 'F':
1385 {
1386 matchRange('A','F');
1387 break;
1388 }
1389 default:
1390 {
1391 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
1392 }
1393 }
1394 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1395 _token = makeToken(_ttype);
1396 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
1397 }
1398 _returnToken = _token;
1399 }
1400
1401 public final void mARG_ACTION(boolean _createToken) throws ScannerException, IOException {
1402 int _ttype; Token _token=null; int _begin=text.length();
1403 _ttype = ARG_ACTION;
1404 int _saveIndex;
1405
1406 match('[');
1407 {
1408 _loop113:
1409 do {
1410 switch ( LA(1)) {
1411 case '[':
1412 {
1413 mARG_ACTION(false);
1414 break;
1415 }
1416 case '\r':
1417 {
1418 match('\r');
1419 {
1420 if ((LA(1)=='\n') && ((LA(2) >= '\3' && LA(2) <= '~'))) {
1421 match('\n');
1422 }
1423 else if (((LA(1) >= '\3' && LA(1) <= '~'))) {
1424 }
1425 else {
1426 throw new ScannerException("no viable alt for char: "+(char)LA(1),getLine());
1427 }
1428
1429 }
1430 newline();
1431 break;
1432 }
1433 case '\n':
1434 {
1435 match('\n');
1436 newline();
1437 break;
1438 }
1439 case '\'':
1440 {
1441 mCHAR_LITERAL(false);
1442 break;
1443 }
1444 case '"':
1445 {
1446 mSTRING_LITERAL(false);
1447 break;
1448 }
1449 case '\3': case '\4': case '\5': case '\6':
1450 case '\7': case '\10': case '\t': case '\13':
1451 case '\14': case '\16': case '\17': case '\20':
1452 case '\21': case '\22': case '\23': case '\24':
1453 case '\25': case '\26': case '\27': case '\30':
1454 case '\31': case '\32': case '\33': case '\34':
1455 case '\35': case '\36': case '\37': case ' ':
1456 case '!': case '#': case '$': case '%':
1457 case '&': case '(': case ')': case '*':
1458 case '+': case ',': case '-': case '.':
1459 case '/': case '0': case '1': case '2':
1460 case '3': case '4': case '5': case '6':
1461 case '7': case '8': case '9': case ':':
1462 case ';': case '<': case '=': case '>':
1463 case '?': case '@': case 'A': case 'B':
1464 case 'C': case 'D': case 'E': case 'F':
1465 case 'G': case 'H': case 'I': case 'J':
1466 case 'K': case 'L': case 'M': case 'N':
1467 case 'O': case 'P': case 'Q': case 'R':
1468 case 'S': case 'T': case 'U': case 'V':
1469 case 'W': case 'X': case 'Y': case 'Z':
1470 case '\\': case '^': case '_': case '`':
1471 case 'a': case 'b': case 'c': case 'd':
1472 case 'e': case 'f': case 'g': case 'h':
1473 case 'i': case 'j': case 'k': case 'l':
1474 case 'm': case 'n': case 'o': case 'p':
1475 case 'q': case 'r': case 's': case 't':
1476 case 'u': case 'v': case 'w': case 'x':
1477 case 'y': case 'z': case '{': case '|':
1478 case '}': case '~':
1479 {
1480 matchNot(']');
1481 break;
1482 }
1483 default:
1484 {
1485 break _loop113;
1486 }
1487 }
1488 } while (true);
1489 }
1490 match(']');
1491 if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
1492 _token = makeToken(_ttype);
1493 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
1494 }
1495 _returnToken = _token;
1496 }
1497
1498
1499 private static final long _tokenSet_0_data_[] = { 4294977024L, 0L, 0L };
1500 public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
1501 private static final long _tokenSet_1_data_[] = { -2199023255560L, 9223372036854775807L, 0L, 0L };
1502 public static final BitSet _tokenSet_1 = new BitSet(_tokenSet_1_data_);
1503 private static final long _tokenSet_2_data_[] = { -576462951326679048L, 9223372036854775807L, 0L, 0L };
1504 public static final BitSet _tokenSet_2 = new BitSet(_tokenSet_2_data_);
1505 private static final long _tokenSet_3_data_[] = { -576460752303423496L, 9223372036854775807L, 0L, 0L };
1506 public static final BitSet _tokenSet_3 = new BitSet(_tokenSet_3_data_);
1507 private static final long _tokenSet_4_data_[] = { 4294977024L, 1152921504606846976L, 0L, 0L };
1508 public static final BitSet _tokenSet_4 = new BitSet(_tokenSet_4_data_);
1509 private static final long _tokenSet_5_data_[] = { -576605355262354440L, 8646911284551352319L, 0L, 0L };
1510 public static final BitSet _tokenSet_5 = new BitSet(_tokenSet_5_data_);
1511 private static final long _tokenSet_6_data_[] = { -141304424047624L, 6341068275337658367L, 0L, 0L };
1512 public static final BitSet _tokenSet_6 = new BitSet(_tokenSet_6_data_);
1513 private static final long _tokenSet_7_data_[] = { 4294977024L, 576460752303423488L, 0L, 0L };
1514 public static final BitSet _tokenSet_7 = new BitSet(_tokenSet_7_data_);
1515 private static final long _tokenSet_8_data_[] = { -576461319239106568L, 9223372036854775807L, 0L, 0L };
1516 public static final BitSet _tokenSet_8 = new BitSet(_tokenSet_8_data_);
1517 private static final long _tokenSet_9_data_[] = { -9224L, 9223372036854775807L, 0L, 0L };
1518 public static final BitSet _tokenSet_9 = new BitSet(_tokenSet_9_data_);
1519 private static final long _tokenSet_10_data_[] = { -4398046520328L, 9223372036854775807L, 0L, 0L };
1520 public static final BitSet _tokenSet_10 = new BitSet(_tokenSet_10_data_);
1521
1522 }
1523