View Javadoc
1 // $ANTLR 2.7.2: "javadoc2.g" -> "JavaDocLexer.java"$ 2 /* FOREGEJ - FOrmatting REfactoring GEnerating Java 3 * 4 * Copyright (C) 2003 Andreas Arrgard 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2.1 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 */ 20 package com.octagroup.foregej.java.doc; 21 import java.io.InputStream; 22 import antlr.TokenStreamException; 23 import antlr.TokenStreamIOException; 24 import antlr.TokenStreamRecognitionException; 25 import antlr.CharStreamException; 26 import antlr.CharStreamIOException; 27 import java.io.Reader; 28 import java.util.Hashtable; 29 import antlr.InputBuffer; 30 import antlr.ByteBuffer; 31 import antlr.CharBuffer; 32 import antlr.Token; 33 import antlr.RecognitionException; 34 import antlr.NoViableAltForCharException; 35 import antlr.TokenStream; 36 import antlr.ANTLRHashString; 37 import antlr.LexerSharedInputState; 38 import antlr.collections.impl.BitSet; 39 public class JavaDocLexer extends JavaDocLexerBase implements JavaDocTokenTypes, 40 TokenStream 41 { 42 public JavaDocLexer(InputStream in) 43 { 44 this(new ByteBuffer(in)); 45 } 46 public JavaDocLexer(Reader in) 47 { 48 this(new CharBuffer(in)); 49 } 50 public JavaDocLexer(InputBuffer ib) 51 { 52 this(new LexerSharedInputState(ib)); 53 } 54 public JavaDocLexer(LexerSharedInputState state) 55 { 56 super(state); 57 caseSensitiveLiterals=true; 58 setCaseSensitive(false); 59 literals=new Hashtable(); 60 literals.put(new ANTLRHashString("author", this), new Integer(23)); 61 literals.put(new ANTLRHashString("return", this), new Integer(22)); 62 literals.put(new ANTLRHashString("param", this), new Integer(21)); 63 } 64 /*** 65 * @return 66 */ 67 public Token nextToken() throws TokenStreamException 68 { 69 Token theRetToken=null; 70 tryAgain: 71 72 for(; ; ){ 73 Token _token=null; 74 int _ttype=Token.INVALID_TYPE; 75 resetText(); 76 try{ 77 // for char stream error handling 78 try{ 79 // for lexical error handling 80 switch(LA(1)) { 81 case '.': 82 case '_': 83 case 'a': 84 case 'b': 85 case 'c': 86 case 'd': 87 case 'e': 88 case 'f': 89 case 'g': 90 case 'h': 91 case 'i': 92 case 'j': 93 case 'k': 94 case 'l': 95 case 'm': 96 case 'n': 97 case 'o': 98 case 'p': 99 case 'q': 100 case 'r': 101 case 's': 102 case 't': 103 case 'u': 104 case 'v': 105 case 'w': 106 case 'x': 107 case 'y': 108 case 'z': 109 110 { 111 mWORD(true); 112 theRetToken=_returnToken; 113 break; 114 } 115 case '0': 116 case '1': 117 case '2': 118 case '3': 119 case '4': 120 case '5': 121 case '6': 122 case '7': 123 case '8': 124 case '9': 125 126 { 127 mINT(true); 128 theRetToken=_returnToken; 129 break; 130 } 131 case '@': 132 133 { 134 mAT(true); 135 theRetToken=_returnToken; 136 break; 137 } 138 case '>': 139 140 { 141 mGT(true); 142 theRetToken=_returnToken; 143 break; 144 } 145 case '=': 146 147 { 148 mEQUAL(true); 149 theRetToken=_returnToken; 150 break; 151 } 152 case '-': 153 154 { 155 mMINUS(true); 156 theRetToken=_returnToken; 157 break; 158 } 159 case '\'': 160 161 { 162 mSQUOTE(true); 163 theRetToken=_returnToken; 164 break; 165 } 166 case '"': 167 168 { 169 mDQUOTE(true); 170 theRetToken=_returnToken; 171 break; 172 } 173 case '\t': 174 case '\n': 175 case '\r': 176 case ' ': 177 178 { 179 mWS(true); 180 theRetToken=_returnToken; 181 break; 182 } 183 default: 184 185 if(LA(1)=='<'&&LA(2)=='/'&&LA(3)=='p'&& 186 LA(4)=='r') { 187 mCPRE(true); 188 theRetToken=_returnToken; 189 } else if(LA(1)=='<'&&LA(2)=='b'&&LA(3)=='r') { 190 mOBR(true); 191 theRetToken=_returnToken; 192 } else if(LA(1)=='<'&&LA(2)=='/'&& 193 LA(3)=='p'&&true) { 194 mCPARA(true); 195 theRetToken=_returnToken; 196 } else if(LA(1)=='<'&&LA(2)=='p'&&LA(3)=='r') { 197 mOPRE(true); 198 theRetToken=_returnToken; 199 } else if(LA(1)=='<'&&LA(2)=='/'&&LA(3)=='c') { 200 mCCODE(true); 201 theRetToken=_returnToken; 202 } else if(LA(1)=='<'&&LA(2)=='/'&&LA(3)=='a') { 203 mCANCHOR(true); 204 theRetToken=_returnToken; 205 } else if(LA(1)=='<'&&LA(2)=='/'&&LA(3)=='i') { 206 mCITALIC(true); 207 theRetToken=_returnToken; 208 } else if(LA(1)=='<'&&LA(2)=='/'&&LA(3)=='b') { 209 mCBOLD(true); 210 theRetToken=_returnToken; 211 } else if(LA(1)=='<'&&LA(2)=='/'&&LA(3)=='u') { 212 mCUNDER(true); 213 theRetToken=_returnToken; 214 } else if(LA(1)=='/'&&LA(2)=='*') { 215 mOJAVADOC(true); 216 theRetToken=_returnToken; 217 } else if(LA(1)=='*'&&LA(2)=='/') { 218 mCJAVADOC(true); 219 theRetToken=_returnToken; 220 } else if(LA(1)=='<'&&LA(2)=='p'&&true) { 221 mOPARA(true); 222 theRetToken=_returnToken; 223 } else if(LA(1)=='<'&&LA(2)=='c') { 224 mOCODE(true); 225 theRetToken=_returnToken; 226 } else if(LA(1)=='<'&&LA(2)=='a') { 227 mOANCHOR(true); 228 theRetToken=_returnToken; 229 } else if(LA(1)=='<'&&LA(2)=='i') { 230 mOITALIC(true); 231 theRetToken=_returnToken; 232 } else if(LA(1)=='<'&&LA(2)=='b'&&true) { 233 mOBOLD(true); 234 theRetToken=_returnToken; 235 } else if(LA(1)=='<'&&LA(2)=='u') { 236 mOUNDER(true); 237 theRetToken=_returnToken; 238 } else if(LA(1)=='<'&&LA(2)=='!') { 239 mCOMMENT(true); 240 theRetToken=_returnToken; 241 } else if(_tokenSet_0.member(LA(1))&&true) { 242 mOTHER_TOKEN(true); 243 theRetToken=_returnToken; 244 } else { 245 if(LA(1)==EOF_CHAR) { 246 uponEOF(); 247 _returnToken=makeToken(Token.EOF_TYPE); 248 } else { 249 throw new NoViableAltForCharException((char)LA(1), 250 getFilename(), getLine(), getColumn()); 251 } 252 } 253 } 254 if(_returnToken==null) continue tryAgain; 255 // found SKIP token 256 _ttype=_returnToken.getType(); 257 _ttype=testLiteralsTable(_ttype); 258 _returnToken.setType(_ttype); 259 return _returnToken; 260 }catch (RecognitionException e) { 261 throw new TokenStreamRecognitionException(e); 262 } 263 }catch (CharStreamException cse) { 264 if(cse instanceof CharStreamIOException) { 265 throw new TokenStreamIOException(((CharStreamIOException)cse).io); 266 } else { 267 throw new TokenStreamException(cse.getMessage()); 268 } 269 } 270 } 271 272 } 273 /*** 274 * @param _createToken 275 */ 276 public final void mOJAVADOC(boolean _createToken) throws RecognitionException, 277 CharStreamException, TokenStreamException 278 { 279 int _ttype; 280 Token _token=null; 281 int _begin=text.length(); 282 _ttype=OJAVADOC; 283 int _saveIndex; 284 match("/**"); 285 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 286 _token=makeToken(_ttype); 287 _token.setText(new String(text.getBuffer(), _begin, 288 text.length()-_begin)); 289 } 290 _returnToken=_token; 291 } 292 /*** 293 * @param _createToken 294 */ 295 public final void mCJAVADOC(boolean _createToken) throws RecognitionException, 296 CharStreamException, TokenStreamException 297 { 298 int _ttype; 299 Token _token=null; 300 int _begin=text.length(); 301 _ttype=CJAVADOC; 302 int _saveIndex; 303 match("*/"); 304 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 305 _token=makeToken(_ttype); 306 _token.setText(new String(text.getBuffer(), _begin, 307 text.length()-_begin)); 308 } 309 _returnToken=_token; 310 } 311 /*** 312 * @param _createToken 313 */ 314 public final void mOBR(boolean _createToken) throws RecognitionException, 315 CharStreamException, TokenStreamException 316 { 317 int _ttype; 318 Token _token=null; 319 int _begin=text.length(); 320 _ttype=OBR; 321 int _saveIndex; 322 match("<br"); 323 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 324 _token=makeToken(_ttype); 325 _token.setText(new String(text.getBuffer(), _begin, 326 text.length()-_begin)); 327 } 328 _returnToken=_token; 329 } 330 /*** 331 * @param _createToken 332 */ 333 public final void mOPARA(boolean _createToken) throws RecognitionException, 334 CharStreamException, TokenStreamException 335 { 336 int _ttype; 337 Token _token=null; 338 int _begin=text.length(); 339 _ttype=OPARA; 340 int _saveIndex; 341 match("<p"); 342 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 343 _token=makeToken(_ttype); 344 _token.setText(new String(text.getBuffer(), _begin, 345 text.length()-_begin)); 346 } 347 _returnToken=_token; 348 } 349 /*** 350 * @param _createToken 351 */ 352 public final void mCPARA(boolean _createToken) throws RecognitionException, 353 CharStreamException, TokenStreamException 354 { 355 int _ttype; 356 Token _token=null; 357 int _begin=text.length(); 358 _ttype=CPARA; 359 int _saveIndex; 360 match("</p"); 361 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 362 _token=makeToken(_ttype); 363 _token.setText(new String(text.getBuffer(), _begin, 364 text.length()-_begin)); 365 } 366 _returnToken=_token; 367 } 368 /*** 369 * @param _createToken 370 */ 371 public final void mOPRE(boolean _createToken) throws RecognitionException, 372 CharStreamException, TokenStreamException 373 { 374 int _ttype; 375 Token _token=null; 376 int _begin=text.length(); 377 _ttype=OPRE; 378 int _saveIndex; 379 match("<pre"); 380 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 381 _token=makeToken(_ttype); 382 _token.setText(new String(text.getBuffer(), _begin, 383 text.length()-_begin)); 384 } 385 _returnToken=_token; 386 } 387 /*** 388 * @param _createToken 389 */ 390 public final void mCPRE(boolean _createToken) throws RecognitionException, 391 CharStreamException, TokenStreamException 392 { 393 int _ttype; 394 Token _token=null; 395 int _begin=text.length(); 396 _ttype=CPRE; 397 int _saveIndex; 398 match("</pre"); 399 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 400 _token=makeToken(_ttype); 401 _token.setText(new String(text.getBuffer(), _begin, 402 text.length()-_begin)); 403 } 404 _returnToken=_token; 405 } 406 /*** 407 * @param _createToken 408 */ 409 public final void mOCODE(boolean _createToken) throws RecognitionException, 410 CharStreamException, TokenStreamException 411 { 412 int _ttype; 413 Token _token=null; 414 int _begin=text.length(); 415 _ttype=OCODE; 416 int _saveIndex; 417 match("<code"); 418 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 419 _token=makeToken(_ttype); 420 _token.setText(new String(text.getBuffer(), _begin, 421 text.length()-_begin)); 422 } 423 _returnToken=_token; 424 } 425 /*** 426 * @param _createToken 427 */ 428 public final void mCCODE(boolean _createToken) throws RecognitionException, 429 CharStreamException, TokenStreamException 430 { 431 int _ttype; 432 Token _token=null; 433 int _begin=text.length(); 434 _ttype=CCODE; 435 int _saveIndex; 436 match("</code"); 437 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 438 _token=makeToken(_ttype); 439 _token.setText(new String(text.getBuffer(), _begin, 440 text.length()-_begin)); 441 } 442 _returnToken=_token; 443 } 444 /*** 445 * @param _createToken 446 */ 447 public final void mOANCHOR(boolean _createToken) throws RecognitionException, 448 CharStreamException, TokenStreamException 449 { 450 int _ttype; 451 Token _token=null; 452 int _begin=text.length(); 453 _ttype=OANCHOR; 454 int _saveIndex; 455 match("<a"); 456 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 457 _token=makeToken(_ttype); 458 _token.setText(new String(text.getBuffer(), _begin, 459 text.length()-_begin)); 460 } 461 _returnToken=_token; 462 } 463 /*** 464 * @param _createToken 465 */ 466 public final void mCANCHOR(boolean _createToken) throws RecognitionException, 467 CharStreamException, TokenStreamException 468 { 469 int _ttype; 470 Token _token=null; 471 int _begin=text.length(); 472 _ttype=CANCHOR; 473 int _saveIndex; 474 match("</a"); 475 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 476 _token=makeToken(_ttype); 477 _token.setText(new String(text.getBuffer(), _begin, 478 text.length()-_begin)); 479 } 480 _returnToken=_token; 481 } 482 /*** 483 * @param _createToken 484 */ 485 public final void mOITALIC(boolean _createToken) throws RecognitionException, 486 CharStreamException, TokenStreamException 487 { 488 int _ttype; 489 Token _token=null; 490 int _begin=text.length(); 491 _ttype=OITALIC; 492 int _saveIndex; 493 match("<i"); 494 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 495 _token=makeToken(_ttype); 496 _token.setText(new String(text.getBuffer(), _begin, 497 text.length()-_begin)); 498 } 499 _returnToken=_token; 500 } 501 /*** 502 * @param _createToken 503 */ 504 public final void mCITALIC(boolean _createToken) throws RecognitionException, 505 CharStreamException, TokenStreamException 506 { 507 int _ttype; 508 Token _token=null; 509 int _begin=text.length(); 510 _ttype=CITALIC; 511 int _saveIndex; 512 match("</i"); 513 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 514 _token=makeToken(_ttype); 515 _token.setText(new String(text.getBuffer(), _begin, 516 text.length()-_begin)); 517 } 518 _returnToken=_token; 519 } 520 /*** 521 * @param _createToken 522 */ 523 public final void mOBOLD(boolean _createToken) throws RecognitionException, 524 CharStreamException, TokenStreamException 525 { 526 int _ttype; 527 Token _token=null; 528 int _begin=text.length(); 529 _ttype=OBOLD; 530 int _saveIndex; 531 match("<b"); 532 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 533 _token=makeToken(_ttype); 534 _token.setText(new String(text.getBuffer(), _begin, 535 text.length()-_begin)); 536 } 537 _returnToken=_token; 538 } 539 /*** 540 * @param _createToken 541 */ 542 public final void mCBOLD(boolean _createToken) throws RecognitionException, 543 CharStreamException, TokenStreamException 544 { 545 int _ttype; 546 Token _token=null; 547 int _begin=text.length(); 548 _ttype=CBOLD; 549 int _saveIndex; 550 match("</b"); 551 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 552 _token=makeToken(_ttype); 553 _token.setText(new String(text.getBuffer(), _begin, 554 text.length()-_begin)); 555 } 556 _returnToken=_token; 557 } 558 /*** 559 * @param _createToken 560 */ 561 public final void mOUNDER(boolean _createToken) throws RecognitionException, 562 CharStreamException, TokenStreamException 563 { 564 int _ttype; 565 Token _token=null; 566 int _begin=text.length(); 567 _ttype=OUNDER; 568 int _saveIndex; 569 match("<u"); 570 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 571 _token=makeToken(_ttype); 572 _token.setText(new String(text.getBuffer(), _begin, 573 text.length()-_begin)); 574 } 575 _returnToken=_token; 576 } 577 /*** 578 * @param _createToken 579 */ 580 public final void mCUNDER(boolean _createToken) throws RecognitionException, 581 CharStreamException, TokenStreamException 582 { 583 int _ttype; 584 Token _token=null; 585 int _begin=text.length(); 586 _ttype=CUNDER; 587 int _saveIndex; 588 match("</u"); 589 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 590 _token=makeToken(_ttype); 591 _token.setText(new String(text.getBuffer(), _begin, 592 text.length()-_begin)); 593 } 594 _returnToken=_token; 595 } 596 /*** 597 * @param _createToken 598 */ 599 protected final void mCOMMENT_DATA(boolean _createToken) throws RecognitionException, 600 CharStreamException, TokenStreamException 601 { 602 int _ttype; 603 Token _token=null; 604 int _begin=text.length(); 605 _ttype=COMMENT_DATA; 606 int _saveIndex; 607 { 608 _loop134: 609 610 do { 611 if(LA(1)=='-'&&LA(2)>='\u0003'&&LA(2)<='\u00ff'&& 612 LA(3)>='\u0003'&&LA(3)<='\u00ff'&&LA(4)>='\u0003'&& 613 LA(4)<='\u00ff'&&LA(2)!='-'&&LA(3)!='>') { 614 match('-'); 615 } else if(LA(1)=='\r'&&LA(2)=='\n'&&LA(3)>='\u0003'&& 616 LA(3)<='\u00ff'&&LA(4)>='\u0003'&& 617 LA(4)<='\u00ff') { 618 match('\r'); 619 match('\n'); 620 newline(); 621 } else if(LA(1)=='\r'&&LA(2)>='\u0003'&& 622 LA(2)<='\u00ff'&&LA(3)>='\u0003'&& 623 LA(3)<='\u00ff'&&LA(4)>='\u0003'&& 624 LA(4)<='\u00ff') { 625 match('\r'); 626 newline(); 627 } else if(LA(1)=='\n') { 628 match('\n'); 629 newline(); 630 } else if(_tokenSet_1.member(LA(1))) { 631 { 632 match(_tokenSet_1); 633 } 634 } else { 635 break _loop134; 636 } 637 } while(true); 638 639 } 640 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 641 _token=makeToken(_ttype); 642 _token.setText(new String(text.getBuffer(), _begin, 643 text.length()-_begin)); 644 } 645 _returnToken=_token; 646 } 647 /*** 648 * @param _createToken 649 */ 650 public final void mCOMMENT(boolean _createToken) throws RecognitionException, 651 CharStreamException, TokenStreamException 652 { 653 int _ttype; 654 Token _token=null; 655 int _begin=text.length(); 656 _ttype=COMMENT; 657 int _saveIndex; 658 match("<!--"); 659 mCOMMENT_DATA(false); 660 match("-->"); 661 _ttype=Token.SKIP; 662 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 663 _token=makeToken(_ttype); 664 _token.setText(new String(text.getBuffer(), _begin, 665 text.length()-_begin)); 666 } 667 _returnToken=_token; 668 } 669 /*** 670 * @param _createToken 671 */ 672 public final void mWORD(boolean _createToken) throws RecognitionException, 673 CharStreamException, TokenStreamException 674 { 675 int _ttype; 676 Token _token=null; 677 int _begin=text.length(); 678 _ttype=WORD; 679 int _saveIndex; 680 { 681 switch(LA(1)) { 682 case 'a': 683 case 'b': 684 case 'c': 685 case 'd': 686 case 'e': 687 case 'f': 688 case 'g': 689 case 'h': 690 case 'i': 691 case 'j': 692 case 'k': 693 case 'l': 694 case 'm': 695 case 'n': 696 case 'o': 697 case 'p': 698 case 'q': 699 case 'r': 700 case 's': 701 case 't': 702 case 'u': 703 case 'v': 704 case 'w': 705 case 'x': 706 case 'y': 707 case 'z': 708 709 { 710 mLCLETTER(false); 711 break; 712 } 713 case '.': 714 715 { 716 match('.'); 717 break; 718 } 719 case '_': 720 721 { 722 match('_'); 723 break; 724 } 725 default: 726 727 { 728 throw new NoViableAltForCharException((char)LA(1), 729 getFilename(), getLine(), getColumn()); 730 } 731 } 732 } 733 { 734 _loop139: 735 736 do { 737 switch(LA(1)) { 738 case 'a': 739 case 'b': 740 case 'c': 741 case 'd': 742 case 'e': 743 case 'f': 744 case 'g': 745 case 'h': 746 case 'i': 747 case 'j': 748 case 'k': 749 case 'l': 750 case 'm': 751 case 'n': 752 case 'o': 753 case 'p': 754 case 'q': 755 case 'r': 756 case 's': 757 case 't': 758 case 'u': 759 case 'v': 760 case 'w': 761 case 'x': 762 case 'y': 763 case 'z': 764 765 { 766 mLCLETTER(false); 767 break; 768 } 769 case '0': 770 case '1': 771 case '2': 772 case '3': 773 case '4': 774 case '5': 775 case '6': 776 case '7': 777 case '8': 778 case '9': 779 780 { 781 mDIGIT(false); 782 break; 783 } 784 case '.': 785 786 { 787 match('.'); 788 break; 789 } 790 case '_': 791 792 { 793 match('_'); 794 break; 795 } 796 default: 797 798 { 799 break _loop139; 800 } 801 } 802 } while(true); 803 804 } 805 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 806 _token=makeToken(_ttype); 807 _token.setText(new String(text.getBuffer(), _begin, 808 text.length()-_begin)); 809 } 810 _returnToken=_token; 811 } 812 /*** 813 * @param _createToken 814 */ 815 protected final void mLCLETTER(boolean _createToken) throws RecognitionException, 816 CharStreamException, TokenStreamException 817 { 818 int _ttype; 819 Token _token=null; 820 int _begin=text.length(); 821 _ttype=LCLETTER; 822 int _saveIndex; 823 matchRange('a', 'z'); 824 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 825 _token=makeToken(_ttype); 826 _token.setText(new String(text.getBuffer(), _begin, 827 text.length()-_begin)); 828 } 829 _returnToken=_token; 830 } 831 /*** 832 * @param _createToken 833 */ 834 protected final void mDIGIT(boolean _createToken) throws RecognitionException, 835 CharStreamException, TokenStreamException 836 { 837 int _ttype; 838 Token _token=null; 839 int _begin=text.length(); 840 _ttype=DIGIT; 841 int _saveIndex; 842 matchRange('0', '9'); 843 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 844 _token=makeToken(_ttype); 845 _token.setText(new String(text.getBuffer(), _begin, 846 text.length()-_begin)); 847 } 848 _returnToken=_token; 849 } 850 /*** 851 * @param _createToken 852 */ 853 protected final void mWSCHARS(boolean _createToken) throws RecognitionException, 854 CharStreamException, TokenStreamException 855 { 856 int _ttype; 857 Token _token=null; 858 int _begin=text.length(); 859 _ttype=WSCHARS; 860 int _saveIndex; 861 switch(LA(1)) { 862 case ' ': 863 864 { 865 match(' '); 866 break; 867 } 868 case '\t': 869 870 { 871 match('\t'); 872 break; 873 } 874 case '\n': 875 876 { 877 match('\n'); 878 break; 879 } 880 case '\r': 881 882 { 883 match('\r'); 884 break; 885 } 886 default: 887 888 { 889 throw new NoViableAltForCharException((char)LA(1), 890 getFilename(), getLine(), getColumn()); 891 } 892 } 893 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 894 _token=makeToken(_ttype); 895 _token.setText(new String(text.getBuffer(), _begin, 896 text.length()-_begin)); 897 } 898 _returnToken=_token; 899 } 900 /*** 901 * @param _createToken 902 */ 903 protected final void mSPECIAL(boolean _createToken) throws RecognitionException, 904 CharStreamException, TokenStreamException 905 { 906 int _ttype; 907 Token _token=null; 908 int _begin=text.length(); 909 _ttype=SPECIAL; 910 int _saveIndex; 911 switch(LA(1)) { 912 case '<': 913 914 { 915 match('<'); 916 break; 917 } 918 case '~': 919 920 { 921 match('~'); 922 break; 923 } 924 default: 925 926 { 927 throw new NoViableAltForCharException((char)LA(1), 928 getFilename(), getLine(), getColumn()); 929 } 930 } 931 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 932 _token=makeToken(_ttype); 933 _token.setText(new String(text.getBuffer(), _begin, 934 text.length()-_begin)); 935 } 936 _returnToken=_token; 937 } 938 /*** 939 * @param _createToken 940 */ 941 public final void mINT(boolean _createToken) throws RecognitionException, 942 CharStreamException, TokenStreamException 943 { 944 int _ttype; 945 Token _token=null; 946 int _begin=text.length(); 947 _ttype=INT; 948 int _saveIndex; 949 { 950 int _cnt144=0; 951 _loop144: 952 953 do { 954 if(LA(1)>='0'&&LA(1)<='9') { 955 mDIGIT(false); 956 } else { 957 if(_cnt144>=1) { 958 break _loop144; 959 } else { 960 throw new NoViableAltForCharException((char)LA(1), 961 getFilename(), getLine(), getColumn()); 962 } 963 } 964 _cnt144++; 965 } while(true); 966 967 } 968 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 969 _token=makeToken(_ttype); 970 _token.setText(new String(text.getBuffer(), _begin, 971 text.length()-_begin)); 972 } 973 _returnToken=_token; 974 } 975 /*** 976 * @param _createToken 977 */ 978 protected final void mHEXINT(boolean _createToken) throws RecognitionException, 979 CharStreamException, TokenStreamException 980 { 981 int _ttype; 982 Token _token=null; 983 int _begin=text.length(); 984 _ttype=HEXINT; 985 int _saveIndex; 986 { 987 int _cnt147=0; 988 _loop147: 989 990 do { 991 if(_tokenSet_2.member(LA(1))) { 992 mHEXDIGIT(false); 993 } else { 994 if(_cnt147>=1) { 995 break _loop147; 996 } else { 997 throw new NoViableAltForCharException((char)LA(1), 998 getFilename(), getLine(), getColumn()); 999 } 1000 } 1001 _cnt147++; 1002 } while(true); 1003 1004 } 1005 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 1006 _token=makeToken(_ttype); 1007 _token.setText(new String(text.getBuffer(), _begin, 1008 text.length()-_begin)); 1009 } 1010 _returnToken=_token; 1011 } 1012 /*** 1013 * @param _createToken 1014 */ 1015 protected final void mHEXDIGIT(boolean _createToken) throws RecognitionException, 1016 CharStreamException, TokenStreamException 1017 { 1018 int _ttype; 1019 Token _token=null; 1020 int _begin=text.length(); 1021 _ttype=HEXDIGIT; 1022 int _saveIndex; 1023 switch(LA(1)) { 1024 case '0': 1025 case '1': 1026 case '2': 1027 case '3': 1028 case '4': 1029 case '5': 1030 case '6': 1031 case '7': 1032 case '8': 1033 case '9': 1034 1035 { 1036 matchRange('0', '9'); 1037 break; 1038 } 1039 case 'a': 1040 case 'b': 1041 case 'c': 1042 case 'd': 1043 case 'e': 1044 case 'f': 1045 1046 { 1047 matchRange('a', 'f'); 1048 break; 1049 } 1050 default: 1051 1052 { 1053 throw new NoViableAltForCharException((char)LA(1), 1054 getFilename(), getLine(), getColumn()); 1055 } 1056 } 1057 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 1058 _token=makeToken(_ttype); 1059 _token.setText(new String(text.getBuffer(), _begin, 1060 text.length()-_begin)); 1061 } 1062 _returnToken=_token; 1063 } 1064 /*** 1065 * @param _createToken 1066 */ 1067 public final void mAT(boolean _createToken) throws RecognitionException, 1068 CharStreamException, TokenStreamException 1069 { 1070 int _ttype; 1071 Token _token=null; 1072 int _begin=text.length(); 1073 _ttype=AT; 1074 int _saveIndex; 1075 match("@"); 1076 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 1077 _token=makeToken(_ttype); 1078 _token.setText(new String(text.getBuffer(), _begin, 1079 text.length()-_begin)); 1080 } 1081 _returnToken=_token; 1082 } 1083 /*** 1084 * @param _createToken 1085 */ 1086 public final void mGT(boolean _createToken) throws RecognitionException, 1087 CharStreamException, TokenStreamException 1088 { 1089 int _ttype; 1090 Token _token=null; 1091 int _begin=text.length(); 1092 _ttype=GT; 1093 int _saveIndex; 1094 match(">"); 1095 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 1096 _token=makeToken(_ttype); 1097 _token.setText(new String(text.getBuffer(), _begin, 1098 text.length()-_begin)); 1099 } 1100 _returnToken=_token; 1101 } 1102 /*** 1103 * @param _createToken 1104 */ 1105 public final void mEQUAL(boolean _createToken) throws RecognitionException, 1106 CharStreamException, TokenStreamException 1107 { 1108 int _ttype; 1109 Token _token=null; 1110 int _begin=text.length(); 1111 _ttype=EQUAL; 1112 int _saveIndex; 1113 match('='); 1114 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 1115 _token=makeToken(_ttype); 1116 _token.setText(new String(text.getBuffer(), _begin, 1117 text.length()-_begin)); 1118 } 1119 _returnToken=_token; 1120 } 1121 /*** 1122 * @param _createToken 1123 */ 1124 public final void mMINUS(boolean _createToken) throws RecognitionException, 1125 CharStreamException, TokenStreamException 1126 { 1127 int _ttype; 1128 Token _token=null; 1129 int _begin=text.length(); 1130 _ttype=MINUS; 1131 int _saveIndex; 1132 match('-'); 1133 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 1134 _token=makeToken(_ttype); 1135 _token.setText(new String(text.getBuffer(), _begin, 1136 text.length()-_begin)); 1137 } 1138 _returnToken=_token; 1139 } 1140 /*** 1141 * @param _createToken 1142 */ 1143 public final void mSQUOTE(boolean _createToken) throws RecognitionException, 1144 CharStreamException, TokenStreamException 1145 { 1146 int _ttype; 1147 Token _token=null; 1148 int _begin=text.length(); 1149 _ttype=SQUOTE; 1150 int _saveIndex; 1151 match('\''); 1152 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 1153 _token=makeToken(_ttype); 1154 _token.setText(new String(text.getBuffer(), _begin, 1155 text.length()-_begin)); 1156 } 1157 _returnToken=_token; 1158 } 1159 /*** 1160 * @param _createToken 1161 */ 1162 public final void mDQUOTE(boolean _createToken) throws RecognitionException, 1163 CharStreamException, TokenStreamException 1164 { 1165 int _ttype; 1166 Token _token=null; 1167 int _begin=text.length(); 1168 _ttype=DQUOTE; 1169 int _saveIndex; 1170 match('"'); 1171 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 1172 _token=makeToken(_ttype); 1173 _token.setText(new String(text.getBuffer(), _begin, 1174 text.length()-_begin)); 1175 } 1176 _returnToken=_token; 1177 } 1178 /*** 1179 * @param _createToken 1180 */ 1181 public final void mOTHER_TOKEN(boolean _createToken) throws RecognitionException, 1182 CharStreamException, TokenStreamException 1183 { 1184 int _ttype; 1185 Token _token=null; 1186 int _begin=text.length(); 1187 _ttype=OTHER_TOKEN; 1188 int _saveIndex; 1189 switch(LA(1)) { 1190 case '!': 1191 1192 { 1193 match('!'); 1194 break; 1195 } 1196 case ',': 1197 1198 { 1199 match(','); 1200 break; 1201 } 1202 case '|': 1203 1204 { 1205 match('|'); 1206 break; 1207 } 1208 case '/': 1209 1210 { 1211 match('/'); 1212 break; 1213 } 1214 case ':': 1215 1216 { 1217 match(':'); 1218 break; 1219 } 1220 case '\u00a7': 1221 1222 { 1223 match('§'); 1224 break; 1225 } 1226 case ';': 1227 1228 { 1229 match(';'); 1230 break; 1231 } 1232 case '+': 1233 1234 { 1235 match('+'); 1236 break; 1237 } 1238 case '?': 1239 1240 { 1241 match('?'); 1242 break; 1243 } 1244 case '*': 1245 1246 { 1247 match('*'); 1248 break; 1249 } 1250 case '\u00b4': 1251 1252 { 1253 match('´'); 1254 break; 1255 } 1256 case '`': 1257 1258 { 1259 match('`'); 1260 break; 1261 } 1262 case '#': 1263 1264 { 1265 match('#'); 1266 break; 1267 } 1268 case '$': 1269 1270 { 1271 match('$'); 1272 break; 1273 } 1274 case '(': 1275 1276 { 1277 match('('); 1278 break; 1279 } 1280 case ')': 1281 1282 { 1283 match(')'); 1284 break; 1285 } 1286 case '[': 1287 1288 { 1289 match('['); 1290 break; 1291 } 1292 case ']': 1293 1294 { 1295 match(']'); 1296 break; 1297 } 1298 case '{': 1299 1300 { 1301 match('{'); 1302 break; 1303 } 1304 case '}': 1305 1306 { 1307 match('}'); 1308 break; 1309 } 1310 case '%': 1311 1312 { 1313 match('%'); 1314 break; 1315 } 1316 case '<': 1317 1318 { 1319 match('<'); 1320 break; 1321 } 1322 case '&': 1323 1324 { 1325 match('&'); 1326 break; 1327 } 1328 case '~': 1329 1330 { 1331 match('~'); 1332 break; 1333 } 1334 default: 1335 1336 { 1337 throw new NoViableAltForCharException((char)LA(1), 1338 getFilename(), getLine(), getColumn()); 1339 } 1340 } 1341 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 1342 _token=makeToken(_ttype); 1343 _token.setText(new String(text.getBuffer(), _begin, 1344 text.length()-_begin)); 1345 } 1346 _returnToken=_token; 1347 } 1348 /*** 1349 * @param _createToken 1350 */ 1351 public final void mWS(boolean _createToken) throws RecognitionException, 1352 CharStreamException, TokenStreamException 1353 { 1354 int _ttype; 1355 Token _token=null; 1356 int _begin=text.length(); 1357 _ttype=WS; 1358 int _saveIndex; 1359 boolean newLine=false; 1360 { 1361 int _cnt165=0; 1362 _loop165: 1363 1364 do { 1365 switch(LA(1)) { 1366 case ' ': 1367 1368 { 1369 match(' '); 1370 { 1371 if(LA(1)=='*'&&newLine&&LA(2)!='/') { 1372 match('*'); 1373 newLine=false; 1374 } else { 1375 } 1376 } 1377 break; 1378 } 1379 case '\t': 1380 1381 { 1382 match('\t'); 1383 { 1384 if(LA(1)=='*'&&newLine&&LA(2)!='/') { 1385 match('*'); 1386 newLine=false; 1387 } else { 1388 } 1389 } 1390 break; 1391 } 1392 case '\n': 1393 1394 { 1395 match('\n'); 1396 newline(); 1397 newLine=true; 1398 { 1399 if(LA(1)=='*'&&newLine&&LA(2)!='/') { 1400 match('*'); 1401 newLine=false; 1402 } else { 1403 } 1404 } 1405 break; 1406 } 1407 default: 1408 1409 if(LA(1)=='\r'&&LA(2)=='\n'&&true&&true) { 1410 match("\r\n"); 1411 newline(); 1412 newLine=true; 1413 { 1414 if(LA(1)=='*'&&newLine&&LA(2)!='/') { 1415 match('*'); 1416 newLine=false; 1417 } else { 1418 } 1419 } 1420 } else if(LA(1)=='\r'&&true&&true&&true) { 1421 match('\r'); 1422 newline(); 1423 newLine=true; 1424 { 1425 if(LA(1)=='*'&&newLine&&LA(2)!='/') { 1426 match('*'); 1427 newLine=false; 1428 } else { 1429 } 1430 } 1431 } else { 1432 if(_cnt165>=1) { 1433 break _loop165; 1434 } else { 1435 throw new NoViableAltForCharException((char)LA(1), 1436 getFilename(), getLine(), getColumn()); 1437 } 1438 } 1439 } 1440 _cnt165++; 1441 } while(true); 1442 1443 } 1444 if(_createToken&&_token==null&&_ttype!=Token.SKIP) { 1445 _token=makeToken(_ttype); 1446 _token.setText(new String(text.getBuffer(), _begin, 1447 text.length()-_begin)); 1448 } 1449 _returnToken=_token; 1450 } 1451 /*** 1452 * @return 1453 */ 1454 private static final long[] mk_tokenSet_0() 1455 { 1456 long[] data={-7205584057457967104L,8646911289517408256L, 1457 4504149383184384L,0L,0L,0L}; 1458 return data; 1459 } 1460 public static final BitSet _tokenSet_0=new BitSet(mk_tokenSet_0()); 1461 /*** 1462 * @return 1463 */ 1464 private static final long[] mk_tokenSet_1() 1465 { 1466 long[] data=new long[8]; 1467 data[0]=-35184372098056L; 1468 for(int i=1; i<=3; i++){ 1469 data[i]=-1L; 1470 } 1471 return data; 1472 } 1473 public static final BitSet _tokenSet_1=new BitSet(mk_tokenSet_1()); 1474 /*** 1475 * @return 1476 */ 1477 private static final long[] mk_tokenSet_2() 1478 { 1479 long[] data={287948901175001088L,541165879296L,0L,0L,0L}; 1480 return data; 1481 } 1482 public static final BitSet _tokenSet_2=new BitSet(mk_tokenSet_2()); 1483 }

This page was automatically generated by Maven