001// $ANTLR 2.7.5 (20050128): "../src/csheets/core/formula/compiler/FormulaCompiler.g" -> "FormulaLexer.java"$ 002package csheets.core.formula.compiler; 003import java.io.InputStream; 004import antlr.TokenStreamException; 005import antlr.TokenStreamIOException; 006import antlr.TokenStreamRecognitionException; 007import antlr.CharStreamException; 008import antlr.CharStreamIOException; 009import antlr.ANTLRException; 010import java.io.Reader; 011import java.util.Hashtable; 012import antlr.CharScanner; 013import antlr.InputBuffer; 014import antlr.ByteBuffer; 015import antlr.CharBuffer; 016import antlr.Token; 017import antlr.CommonToken; 018import antlr.RecognitionException; 019import antlr.NoViableAltForCharException; 020import antlr.MismatchedCharException; 021import antlr.TokenStream; 022import antlr.ANTLRHashString; 023import antlr.LexerSharedInputState; 024import antlr.collections.impl.BitSet; 025import antlr.SemanticException; 026import csheets.core.formula.lang.Language; 027 028/** 029 * A lexer that splits a string into a list of lexical tokens. 030 * @author Einar Pehrson 031 */ 032@SuppressWarnings("all") 033public class FormulaLexer extends antlr.CharScanner implements FormulaParserTokenTypes, TokenStream 034 { 035public FormulaLexer(InputStream in) { 036 this(new ByteBuffer(in)); 037} 038public FormulaLexer(Reader in) { 039 this(new CharBuffer(in)); 040} 041public FormulaLexer(InputBuffer ib) { 042 this(new LexerSharedInputState(ib)); 043} 044public FormulaLexer(LexerSharedInputState state) { 045 super(state); 046 caseSensitiveLiterals = false; 047 setCaseSensitive(false); 048 literals = new Hashtable(); 049} 050 051public Token nextToken() throws TokenStreamException { 052 Token theRetToken=null; 053tryAgain: 054 for (;;) { 055 Token _token = null; 056 int _ttype = Token.INVALID_TYPE; 057 resetText(); 058 try { // for char stream error handling 059 try { // for lexical error handling 060 switch ( LA(1)) { 061 case '$': case 'a': case 'b': case 'c': 062 case 'd': case 'e': case 'f': case 'g': 063 case 'h': case 'i': case 'j': case 'k': 064 case 'l': case 'm': case 'n': case 'o': 065 case 'p': case 'q': case 'r': case 's': 066 case 't': case 'u': case 'v': case 'w': 067 case 'x': case 'y': case 'z': 068 { 069 mALPHABETICAL(true); 070 theRetToken=_returnToken; 071 break; 072 } 073 case '(': 074 { 075 mLPAR(true); 076 theRetToken=_returnToken; 077 break; 078 } 079 case '"': 080 { 081 mSTRING(true); 082 theRetToken=_returnToken; 083 break; 084 } 085 case '0': case '1': case '2': case '3': 086 case '4': case '5': case '6': case '7': 087 case '8': case '9': 088 { 089 mNUMBER(true); 090 theRetToken=_returnToken; 091 break; 092 } 093 case ',': 094 { 095 mCOMMA(true); 096 theRetToken=_returnToken; 097 break; 098 } 099 case '=': 100 { 101 mEQ(true); 102 theRetToken=_returnToken; 103 break; 104 } 105 case '&': 106 { 107 mAMP(true); 108 theRetToken=_returnToken; 109 break; 110 } 111 case '+': 112 { 113 mPLUS(true); 114 theRetToken=_returnToken; 115 break; 116 } 117 case '-': 118 { 119 mMINUS(true); 120 theRetToken=_returnToken; 121 break; 122 } 123 case '*': 124 { 125 mMULTI(true); 126 theRetToken=_returnToken; 127 break; 128 } 129 case '/': 130 { 131 mDIV(true); 132 theRetToken=_returnToken; 133 break; 134 } 135 case '^': 136 { 137 mPOWER(true); 138 theRetToken=_returnToken; 139 break; 140 } 141 case '%': 142 { 143 mPERCENT(true); 144 theRetToken=_returnToken; 145 break; 146 } 147 case ':': 148 { 149 mCOLON(true); 150 theRetToken=_returnToken; 151 break; 152 } 153 case ';': 154 { 155 mSEMI(true); 156 theRetToken=_returnToken; 157 break; 158 } 159 case ')': 160 { 161 mRPAR(true); 162 theRetToken=_returnToken; 163 break; 164 } 165 case '\t': case '\n': case '\r': case ' ': 166 { 167 mWS(true); 168 theRetToken=_returnToken; 169 break; 170 } 171 default: 172 if ((LA(1)=='<') && (LA(2)=='>')) { 173 mNEQ(true); 174 theRetToken=_returnToken; 175 } 176 else if ((LA(1)=='<') && (LA(2)=='=')) { 177 mLTEQ(true); 178 theRetToken=_returnToken; 179 } 180 else if ((LA(1)=='>') && (LA(2)=='=')) { 181 mGTEQ(true); 182 theRetToken=_returnToken; 183 } 184 else if ((LA(1)=='>') && (true)) { 185 mGT(true); 186 theRetToken=_returnToken; 187 } 188 else if ((LA(1)=='<') && (true)) { 189 mLT(true); 190 theRetToken=_returnToken; 191 } 192 else { 193 if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);} 194 else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 195 } 196 } 197 if ( _returnToken==null ) continue tryAgain; // found SKIP token 198 _ttype = _returnToken.getType(); 199 _ttype = testLiteralsTable(_ttype); 200 _returnToken.setType(_ttype); 201 return _returnToken; 202 } 203 catch (RecognitionException e) { 204 throw new TokenStreamRecognitionException(e); 205 } 206 } 207 catch (CharStreamException cse) { 208 if ( cse instanceof CharStreamIOException ) { 209 throw new TokenStreamIOException(((CharStreamIOException)cse).io); 210 } 211 else { 212 throw new TokenStreamException(cse.getMessage()); 213 } 214 } 215 } 216} 217 218 protected final void mLETTER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 219 int _ttype; Token _token=null; int _begin=text.length(); 220 _ttype = LETTER; 221 int _saveIndex; 222 223 { 224 matchRange('a','z'); 225 } 226 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 227 _token = makeToken(_ttype); 228 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 229 } 230 _returnToken = _token; 231 } 232 233 public final void mALPHABETICAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 234 int _ttype; Token _token=null; int _begin=text.length(); 235 _ttype = ALPHABETICAL; 236 int _saveIndex; 237 238 boolean synPredMatched37 = false; 239 if ((((LA(1) >= 'a' && LA(1) <= 'z')) && (_tokenSet_0.member(LA(2))) && (true) && (true))) { 240 int _m37 = mark(); 241 synPredMatched37 = true; 242 inputState.guessing++; 243 try { 244 { 245 { 246 int _cnt36=0; 247 _loop36: 248 do { 249 if (((LA(1) >= 'a' && LA(1) <= 'z'))) { 250 mLETTER(false); 251 } 252 else { 253 if ( _cnt36>=1 ) { break _loop36; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 254 } 255 256 _cnt36++; 257 } while (true); 258 } 259 mLPAR(false); 260 } 261 } 262 catch (RecognitionException pe) { 263 synPredMatched37 = false; 264 } 265 rewind(_m37); 266 inputState.guessing--; 267 } 268 if ( synPredMatched37 ) { 269 { 270 int _cnt39=0; 271 _loop39: 272 do { 273 if (((LA(1) >= 'a' && LA(1) <= 'z'))) { 274 mLETTER(false); 275 } 276 else { 277 if ( _cnt39>=1 ) { break _loop39; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 278 } 279 280 _cnt39++; 281 } while (true); 282 } 283 _saveIndex=text.length(); 284 mLPAR(false); 285 text.setLength(_saveIndex); 286 if ( inputState.guessing==0 ) { 287 288 try { 289 Language.getInstance().getFunction(getText()); 290 _ttype = FUNCTION; 291 } catch (Exception ex) { 292 throw new RecognitionException(ex.toString()); 293 } 294 295 } 296 } 297 else if ((_tokenSet_1.member(LA(1))) && (_tokenSet_2.member(LA(2))) && (true) && (true)) { 298 { 299 switch ( LA(1)) { 300 case '$': 301 { 302 mABS(false); 303 break; 304 } 305 case 'a': case 'b': case 'c': case 'd': 306 case 'e': case 'f': case 'g': case 'h': 307 case 'i': case 'j': case 'k': case 'l': 308 case 'm': case 'n': case 'o': case 'p': 309 case 'q': case 'r': case 's': case 't': 310 case 'u': case 'v': case 'w': case 'x': 311 case 'y': case 'z': 312 { 313 break; 314 } 315 default: 316 { 317 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 318 } 319 } 320 } 321 mLETTER(false); 322 { 323 switch ( LA(1)) { 324 case 'a': case 'b': case 'c': case 'd': 325 case 'e': case 'f': case 'g': case 'h': 326 case 'i': case 'j': case 'k': case 'l': 327 case 'm': case 'n': case 'o': case 'p': 328 case 'q': case 'r': case 's': case 't': 329 case 'u': case 'v': case 'w': case 'x': 330 case 'y': case 'z': 331 { 332 mLETTER(false); 333 break; 334 } 335 case '$': case '0': case '1': case '2': 336 case '3': case '4': case '5': case '6': 337 case '7': case '8': case '9': 338 { 339 break; 340 } 341 default: 342 { 343 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 344 } 345 } 346 } 347 { 348 switch ( LA(1)) { 349 case '$': 350 { 351 mABS(false); 352 break; 353 } 354 case '0': case '1': case '2': case '3': 355 case '4': case '5': case '6': case '7': 356 case '8': case '9': 357 { 358 break; 359 } 360 default: 361 { 362 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 363 } 364 } 365 } 366 { 367 int _cnt44=0; 368 _loop44: 369 do { 370 if (((LA(1) >= '0' && LA(1) <= '9'))) { 371 mDIGIT(false); 372 } 373 else { 374 if ( _cnt44>=1 ) { break _loop44; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 375 } 376 377 _cnt44++; 378 } while (true); 379 } 380 if ( inputState.guessing==0 ) { 381 382 _ttype = CELL_REF; 383 384 } 385 } 386 else { 387 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 388 } 389 390 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 391 _token = makeToken(_ttype); 392 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 393 } 394 _returnToken = _token; 395 } 396 397 public final void mLPAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 398 int _ttype; Token _token=null; int _begin=text.length(); 399 _ttype = LPAR; 400 int _saveIndex; 401 402 match('('); 403 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 404 _token = makeToken(_ttype); 405 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 406 } 407 _returnToken = _token; 408 } 409 410 protected final void mABS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 411 int _ttype; Token _token=null; int _begin=text.length(); 412 _ttype = ABS; 413 int _saveIndex; 414 415 match('$'); 416 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 417 _token = makeToken(_ttype); 418 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 419 } 420 _returnToken = _token; 421 } 422 423 protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 424 int _ttype; Token _token=null; int _begin=text.length(); 425 _ttype = DIGIT; 426 int _saveIndex; 427 428 matchRange('0','9'); 429 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 430 _token = makeToken(_ttype); 431 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 432 } 433 _returnToken = _token; 434 } 435 436 public final void mSTRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 437 int _ttype; Token _token=null; int _begin=text.length(); 438 _ttype = STRING; 439 int _saveIndex; 440 441 _saveIndex=text.length(); 442 mQUOT(false); 443 text.setLength(_saveIndex); 444 { 445 _loop47: 446 do { 447 // nongreedy exit test 448 if ((LA(1)=='"') && (true)) break _loop47; 449 if (((LA(1) >= '\u0000' && LA(1) <= '\u007f')) && ((LA(2) >= '\u0000' && LA(2) <= '\u007f'))) { 450 matchNot(EOF_CHAR); 451 } 452 else { 453 break _loop47; 454 } 455 456 } while (true); 457 } 458 _saveIndex=text.length(); 459 mQUOT(false); 460 text.setLength(_saveIndex); 461 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 462 _token = makeToken(_ttype); 463 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 464 } 465 _returnToken = _token; 466 } 467 468 protected final void mQUOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 469 int _ttype; Token _token=null; int _begin=text.length(); 470 _ttype = QUOT; 471 int _saveIndex; 472 473 match('"'); 474 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 475 _token = makeToken(_ttype); 476 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 477 } 478 _returnToken = _token; 479 } 480 481 public final void mNUMBER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 482 int _ttype; Token _token=null; int _begin=text.length(); 483 _ttype = NUMBER; 484 int _saveIndex; 485 486 { 487 int _cnt51=0; 488 _loop51: 489 do { 490 if (((LA(1) >= '0' && LA(1) <= '9'))) { 491 mDIGIT(false); 492 } 493 else { 494 if ( _cnt51>=1 ) { break _loop51; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 495 } 496 497 _cnt51++; 498 } while (true); 499 } 500 { 501 if ((LA(1)==',')) { 502 mCOMMA(false); 503 { 504 int _cnt54=0; 505 _loop54: 506 do { 507 if (((LA(1) >= '0' && LA(1) <= '9'))) { 508 mDIGIT(false); 509 } 510 else { 511 if ( _cnt54>=1 ) { break _loop54; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 512 } 513 514 _cnt54++; 515 } while (true); 516 } 517 } 518 else { 519 } 520 521 } 522 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 523 _token = makeToken(_ttype); 524 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 525 } 526 _returnToken = _token; 527 } 528 529 public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 530 int _ttype; Token _token=null; int _begin=text.length(); 531 _ttype = COMMA; 532 int _saveIndex; 533 534 match(','); 535 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 536 _token = makeToken(_ttype); 537 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 538 } 539 _returnToken = _token; 540 } 541 542 public final void mEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 543 int _ttype; Token _token=null; int _begin=text.length(); 544 _ttype = EQ; 545 int _saveIndex; 546 547 match("="); 548 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 549 _token = makeToken(_ttype); 550 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 551 } 552 _returnToken = _token; 553 } 554 555 public final void mNEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 556 int _ttype; Token _token=null; int _begin=text.length(); 557 _ttype = NEQ; 558 int _saveIndex; 559 560 match("<>"); 561 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 562 _token = makeToken(_ttype); 563 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 564 } 565 _returnToken = _token; 566 } 567 568 public final void mLTEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 569 int _ttype; Token _token=null; int _begin=text.length(); 570 _ttype = LTEQ; 571 int _saveIndex; 572 573 match("<="); 574 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 575 _token = makeToken(_ttype); 576 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 577 } 578 _returnToken = _token; 579 } 580 581 public final void mGTEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 582 int _ttype; Token _token=null; int _begin=text.length(); 583 _ttype = GTEQ; 584 int _saveIndex; 585 586 match(">="); 587 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 588 _token = makeToken(_ttype); 589 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 590 } 591 _returnToken = _token; 592 } 593 594 public final void mGT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 595 int _ttype; Token _token=null; int _begin=text.length(); 596 _ttype = GT; 597 int _saveIndex; 598 599 match('>'); 600 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 601 _token = makeToken(_ttype); 602 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 603 } 604 _returnToken = _token; 605 } 606 607 public final void mLT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 608 int _ttype; Token _token=null; int _begin=text.length(); 609 _ttype = LT; 610 int _saveIndex; 611 612 match('<'); 613 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 614 _token = makeToken(_ttype); 615 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 616 } 617 _returnToken = _token; 618 } 619 620 public final void mAMP(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 621 int _ttype; Token _token=null; int _begin=text.length(); 622 _ttype = AMP; 623 int _saveIndex; 624 625 match('&'); 626 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 627 _token = makeToken(_ttype); 628 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 629 } 630 _returnToken = _token; 631 } 632 633 public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 634 int _ttype; Token _token=null; int _begin=text.length(); 635 _ttype = PLUS; 636 int _saveIndex; 637 638 match('+'); 639 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 640 _token = makeToken(_ttype); 641 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 642 } 643 _returnToken = _token; 644 } 645 646 public final void mMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 647 int _ttype; Token _token=null; int _begin=text.length(); 648 _ttype = MINUS; 649 int _saveIndex; 650 651 match('-'); 652 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 653 _token = makeToken(_ttype); 654 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 655 } 656 _returnToken = _token; 657 } 658 659 public final void mMULTI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 660 int _ttype; Token _token=null; int _begin=text.length(); 661 _ttype = MULTI; 662 int _saveIndex; 663 664 match('*'); 665 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 666 _token = makeToken(_ttype); 667 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 668 } 669 _returnToken = _token; 670 } 671 672 public final void mDIV(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 673 int _ttype; Token _token=null; int _begin=text.length(); 674 _ttype = DIV; 675 int _saveIndex; 676 677 match('/'); 678 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 679 _token = makeToken(_ttype); 680 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 681 } 682 _returnToken = _token; 683 } 684 685 public final void mPOWER(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 686 int _ttype; Token _token=null; int _begin=text.length(); 687 _ttype = POWER; 688 int _saveIndex; 689 690 match('^'); 691 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 692 _token = makeToken(_ttype); 693 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 694 } 695 _returnToken = _token; 696 } 697 698 public final void mPERCENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 699 int _ttype; Token _token=null; int _begin=text.length(); 700 _ttype = PERCENT; 701 int _saveIndex; 702 703 match('%'); 704 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 705 _token = makeToken(_ttype); 706 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 707 } 708 _returnToken = _token; 709 } 710 711 protected final void mEXCL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 712 int _ttype; Token _token=null; int _begin=text.length(); 713 _ttype = EXCL; 714 int _saveIndex; 715 716 match('!'); 717 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 718 _token = makeToken(_ttype); 719 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 720 } 721 _returnToken = _token; 722 } 723 724 public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 725 int _ttype; Token _token=null; int _begin=text.length(); 726 _ttype = COLON; 727 int _saveIndex; 728 729 match(':'); 730 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 731 _token = makeToken(_ttype); 732 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 733 } 734 _returnToken = _token; 735 } 736 737 public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 738 int _ttype; Token _token=null; int _begin=text.length(); 739 _ttype = SEMI; 740 int _saveIndex; 741 742 match(';'); 743 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 744 _token = makeToken(_ttype); 745 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 746 } 747 _returnToken = _token; 748 } 749 750 public final void mRPAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 751 int _ttype; Token _token=null; int _begin=text.length(); 752 _ttype = RPAR; 753 int _saveIndex; 754 755 match(')'); 756 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 757 _token = makeToken(_ttype); 758 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 759 } 760 _returnToken = _token; 761 } 762 763 public final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 764 int _ttype; Token _token=null; int _begin=text.length(); 765 _ttype = WS; 766 int _saveIndex; 767 768 { 769 switch ( LA(1)) { 770 case ' ': 771 { 772 match(' '); 773 break; 774 } 775 case '\r': 776 { 777 match('\r'); 778 match('\n'); 779 break; 780 } 781 case '\n': 782 { 783 match('\n'); 784 break; 785 } 786 case '\t': 787 { 788 match('\t'); 789 break; 790 } 791 default: 792 { 793 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 794 } 795 } 796 } 797 if ( inputState.guessing==0 ) { 798 _ttype = Token.SKIP; 799 } 800 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 801 _token = makeToken(_ttype); 802 _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); 803 } 804 _returnToken = _token; 805 } 806 807 808 private static final long[] mk_tokenSet_0() { 809 long[] data = { 1099511627776L, 576460743713488896L, 0L, 0L}; 810 return data; 811 } 812 public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); 813 private static final long[] mk_tokenSet_1() { 814 long[] data = { 68719476736L, 576460743713488896L, 0L, 0L}; 815 return data; 816 } 817 public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); 818 private static final long[] mk_tokenSet_2() { 819 long[] data = { 287948969894477824L, 576460743713488896L, 0L, 0L}; 820 return data; 821 } 822 public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); 823 824 }