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