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