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