| 1 3 package com.jofti.parser; 4 5 import java.io.InputStream ; 6 import antlr.TokenStreamException; 7 import antlr.TokenStreamIOException; 8 import antlr.TokenStreamRecognitionException; 9 import antlr.CharStreamException; 10 import antlr.CharStreamIOException; 11 import antlr.ANTLRException; 12 import java.io.Reader ; 13 import java.util.Hashtable ; 14 import antlr.CharScanner; 15 import antlr.InputBuffer; 16 import antlr.ByteBuffer; 17 import antlr.CharBuffer; 18 import antlr.Token; 19 import antlr.CommonToken; 20 import antlr.RecognitionException; 21 import antlr.NoViableAltForCharException; 22 import antlr.MismatchedCharException; 23 import antlr.TokenStream; 24 import antlr.ANTLRHashString; 25 import antlr.LexerSharedInputState; 26 import antlr.collections.impl.BitSet; 27 import antlr.SemanticException; 28 29 public class CommonLexer extends antlr.CharScanner implements CommonLexerTokenTypes, TokenStream 30 { 31 public CommonLexer(InputStream in) { 32 this(new ByteBuffer(in)); 33 } 34 public CommonLexer(Reader in) { 35 this(new CharBuffer(in)); 36 } 37 public CommonLexer(InputBuffer ib) { 38 this(new LexerSharedInputState(ib)); 39 } 40 public CommonLexer(LexerSharedInputState state) { 41 super(state); 42 caseSensitiveLiterals = false; 43 setCaseSensitive(false); 44 literals = new Hashtable (); 45 literals.put(new ANTLRHashString("select", this), new Integer (4)); 46 literals.put(new ANTLRHashString("like", this), new Integer (13)); 47 literals.put(new ANTLRHashString("namespace", this), new Integer (15)); 48 literals.put(new ANTLRHashString("asc", this), new Integer (18)); 49 literals.put(new ANTLRHashString("in", this), new Integer (14)); 50 literals.put(new ANTLRHashString("or", this), new Integer (8)); 51 literals.put(new ANTLRHashString("from", this), new Integer (11)); 52 literals.put(new ANTLRHashString("desc", this), new Integer (19)); 53 literals.put(new ANTLRHashString("by", this), new Integer (17)); 54 literals.put(new ANTLRHashString("and", this), new Integer (7)); 55 literals.put(new ANTLRHashString("not", this), new Integer (9)); 56 literals.put(new ANTLRHashString("as", this), new Integer (6)); 57 literals.put(new ANTLRHashString("value", this), new Integer (10)); 58 literals.put(new ANTLRHashString("is", this), new Integer (12)); 59 literals.put(new ANTLRHashString("order", this), new Integer (16)); 60 literals.put(new ANTLRHashString("where", this), new Integer (5)); 61 } 62 63 public Token nextToken() throws TokenStreamException { 64 Token theRetToken=null; 65 tryAgain: 66 for (;;) { 67 Token _token = null; 68 int _ttype = Token.INVALID_TYPE; 69 resetText(); 70 try { try { switch ( LA(1)) { 73 case ',': 74 { 75 mCOMMA(true); 76 theRetToken=_returnToken; 77 break; 78 } 79 case ';': 80 { 81 mSEMICOLON(true); 82 theRetToken=_returnToken; 83 break; 84 } 85 case '(': 86 { 87 mLPAREN(true); 88 theRetToken=_returnToken; 89 break; 90 } 91 case ')': 92 { 93 mRPAREN(true); 94 theRetToken=_returnToken; 95 break; 96 } 97 case '\\': 98 { 99 mBACKSLASH(true); 100 theRetToken=_returnToken; 101 break; 102 } 103 case '/': 104 { 105 mFORWARDSLASH(true); 106 theRetToken=_returnToken; 107 break; 108 } 109 case '-': 110 { 111 mDASH(true); 112 theRetToken=_returnToken; 113 break; 114 } 115 case '+': 116 { 117 mPLUS(true); 118 theRetToken=_returnToken; 119 break; 120 } 121 case '=': 122 { 123 mASSIGNEQUAL(true); 124 theRetToken=_returnToken; 125 break; 126 } 127 case '$': case '.': case '0': case '1': 128 case '2': case '3': case '4': case '5': 129 case '6': case '7': case '8': case '9': 130 case ':': case '?': case '[': case ']': 131 case '_': case 'a': case 'b': case 'c': 132 case 'd': case 'e': case 'f': case 'g': 133 case 'h': case 'i': case 'j': case 'k': 134 case 'l': case 'm': case 'n': case 'o': 135 case 'p': case 'q': case 'r': case 's': 136 case 't': case 'u': case 'v': case 'w': 137 case 'x': case 'y': case 'z': 138 { 139 mIdentifier(true); 140 theRetToken=_returnToken; 141 break; 142 } 143 case '\t': case '\n': case '\u000c': case '\r': 144 case ' ': 145 { 146 mWS(true); 147 theRetToken=_returnToken; 148 break; 149 } 150 default: 151 if ((LA(1)=='<') && (LA(2)=='>')) { 152 mNOTEQUAL1(true); 153 theRetToken=_returnToken; 154 } 155 else if ((LA(1)=='!') && (LA(2)=='=')) { 156 mNOTEQUAL2(true); 157 theRetToken=_returnToken; 158 } 159 else if ((LA(1)=='<') && (LA(2)=='=')) { 160 mLESSTHANOREQUALTO1(true); 161 theRetToken=_returnToken; 162 } 163 else if ((LA(1)=='!') && (LA(2)=='>')) { 164 mLESSTHANOREQUALTO2(true); 165 theRetToken=_returnToken; 166 } 167 else if ((LA(1)=='>') && (LA(2)=='=')) { 168 mGREATERTHANOREQUALTO1(true); 169 theRetToken=_returnToken; 170 } 171 else if ((LA(1)=='!') && (LA(2)=='<')) { 172 mGREATERTHANOREQUALTO2(true); 173 theRetToken=_returnToken; 174 } 175 else if ((LA(1)=='\'') && ((LA(2) >= '\u0000' && LA(2) <= '\u007f'))) { 176 mPredicateIdentifier(true); 177 theRetToken=_returnToken; 178 } 179 else if ((LA(1)=='\'') && (true)) { 180 mSINGLE_QUOTE(true); 181 theRetToken=_returnToken; 182 } 183 else if ((LA(1)=='<') && (true)) { 184 mLESSTHAN(true); 185 theRetToken=_returnToken; 186 } 187 else if ((LA(1)=='>') && (true)) { 188 mGREATERTHAN(true); 189 theRetToken=_returnToken; 190 } 191 else { 192 if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);} 193 else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 194 } 195 } 196 if ( _returnToken==null ) continue tryAgain; _ttype = _returnToken.getType(); 198 _ttype = testLiteralsTable(_ttype); 199 _returnToken.setType(_ttype); 200 return _returnToken; 201 } 202 catch (RecognitionException e) { 203 throw new TokenStreamRecognitionException(e); 204 } 205 } 206 catch (CharStreamException cse) { 207 if ( cse instanceof CharStreamIOException ) { 208 throw new TokenStreamIOException(((CharStreamIOException)cse).io); 209 } 210 else { 211 throw new TokenStreamException(cse.getMessage()); 212 } 213 } 214 } 215 } 216 217 protected final void mPACKAGE_SEPERATOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 218 int _ttype; Token _token=null; int _begin=text.length(); 219 _ttype = PACKAGE_SEPERATOR; 220 int _saveIndex; 221 222 match('.'); 223 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 224 _token = makeToken(_ttype); 225 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 226 } 227 _returnToken = _token; 228 } 229 230 public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 231 int _ttype; Token _token=null; int _begin=text.length(); 232 _ttype = COMMA; 233 int _saveIndex; 234 235 match(','); 236 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 237 _token = makeToken(_ttype); 238 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 239 } 240 _returnToken = _token; 241 } 242 243 public final void mSEMICOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 244 int _ttype; Token _token=null; int _begin=text.length(); 245 _ttype = SEMICOLON; 246 int _saveIndex; 247 248 match(';'); 249 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 250 _token = makeToken(_ttype); 251 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 252 } 253 _returnToken = _token; 254 } 255 256 public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 257 int _ttype; Token _token=null; int _begin=text.length(); 258 _ttype = LPAREN; 259 int _saveIndex; 260 261 match('('); 262 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 263 _token = makeToken(_ttype); 264 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 265 } 266 _returnToken = _token; 267 } 268 269 public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 270 int _ttype; Token _token=null; int _begin=text.length(); 271 _ttype = RPAREN; 272 int _saveIndex; 273 274 match(')'); 275 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 276 _token = makeToken(_ttype); 277 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 278 } 279 _returnToken = _token; 280 } 281 282 public final void mSINGLE_QUOTE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 283 int _ttype; Token _token=null; int _begin=text.length(); 284 _ttype = SINGLE_QUOTE; 285 int _saveIndex; 286 287 match('\''); 288 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 289 _token = makeToken(_ttype); 290 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 291 } 292 _returnToken = _token; 293 } 294 295 public final void mBACKSLASH(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 296 int _ttype; Token _token=null; int _begin=text.length(); 297 _ttype = BACKSLASH; 298 int _saveIndex; 299 300 match('\\'); 301 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 302 _token = makeToken(_ttype); 303 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 304 } 305 _returnToken = _token; 306 } 307 308 public final void mFORWARDSLASH(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 309 int _ttype; Token _token=null; int _begin=text.length(); 310 _ttype = FORWARDSLASH; 311 int _saveIndex; 312 313 match('/'); 314 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 315 _token = makeToken(_ttype); 316 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 317 } 318 _returnToken = _token; 319 } 320 321 public final void mDASH(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 322 int _ttype; Token _token=null; int _begin=text.length(); 323 _ttype = DASH; 324 int _saveIndex; 325 326 match('-'); 327 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 328 _token = makeToken(_ttype); 329 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 330 } 331 _returnToken = _token; 332 } 333 334 public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 335 int _ttype; Token _token=null; int _begin=text.length(); 336 _ttype = PLUS; 337 int _saveIndex; 338 339 match("+"); 340 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 341 _token = makeToken(_ttype); 342 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 343 } 344 _returnToken = _token; 345 } 346 347 public final void mASSIGNEQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 348 int _ttype; Token _token=null; int _begin=text.length(); 349 _ttype = ASSIGNEQUAL; 350 int _saveIndex; 351 352 match('='); 353 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 354 _token = makeToken(_ttype); 355 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 356 } 357 _returnToken = _token; 358 } 359 360 public final void mNOTEQUAL1(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 361 int _ttype; Token _token=null; int _begin=text.length(); 362 _ttype = NOTEQUAL1; 363 int _saveIndex; 364 365 match("<>"); 366 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 367 _token = makeToken(_ttype); 368 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 369 } 370 _returnToken = _token; 371 } 372 373 public final void mNOTEQUAL2(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 374 int _ttype; Token _token=null; int _begin=text.length(); 375 _ttype = NOTEQUAL2; 376 int _saveIndex; 377 378 match("!="); 379 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 380 _token = makeToken(_ttype); 381 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 382 } 383 _returnToken = _token; 384 } 385 386 public final void mLESSTHANOREQUALTO1(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 387 int _ttype; Token _token=null; int _begin=text.length(); 388 _ttype = LESSTHANOREQUALTO1; 389 int _saveIndex; 390 391 match("<="); 392 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 393 _token = makeToken(_ttype); 394 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 395 } 396 _returnToken = _token; 397 } 398 399 public final void mLESSTHANOREQUALTO2(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 400 int _ttype; Token _token=null; int _begin=text.length(); 401 _ttype = LESSTHANOREQUALTO2; 402 int _saveIndex; 403 404 match("!>"); 405 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 406 _token = makeToken(_ttype); 407 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 408 } 409 _returnToken = _token; 410 } 411 412 public final void mLESSTHAN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 413 int _ttype; Token _token=null; int _begin=text.length(); 414 _ttype = LESSTHAN; 415 int _saveIndex; 416 417 match("<"); 418 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 419 _token = makeToken(_ttype); 420 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 421 } 422 _returnToken = _token; 423 } 424 425 public final void mGREATERTHANOREQUALTO1(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 426 int _ttype; Token _token=null; int _begin=text.length(); 427 _ttype = GREATERTHANOREQUALTO1; 428 int _saveIndex; 429 430 match(">="); 431 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 432 _token = makeToken(_ttype); 433 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 434 } 435 _returnToken = _token; 436 } 437 438 public final void mGREATERTHANOREQUALTO2(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 439 int _ttype; Token _token=null; int _begin=text.length(); 440 _ttype = GREATERTHANOREQUALTO2; 441 int _saveIndex; 442 443 match("!<"); 444 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 445 _token = makeToken(_ttype); 446 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 447 } 448 _returnToken = _token; 449 } 450 451 public final void mGREATERTHAN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 452 int _ttype; Token _token=null; int _begin=text.length(); 453 _ttype = GREATERTHAN; 454 int _saveIndex; 455 456 match(">"); 457 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 458 _token = makeToken(_ttype); 459 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 460 } 461 _returnToken = _token; 462 } 463 464 protected final void mLBRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 465 int _ttype; Token _token=null; int _begin=text.length(); 466 _ttype = LBRACKET; 467 int _saveIndex; 468 469 match('['); 470 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 471 _token = makeToken(_ttype); 472 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 473 } 474 _returnToken = _token; 475 } 476 477 protected final void mRBRACKET(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 478 int _ttype; Token _token=null; int _begin=text.length(); 479 _ttype = RBRACKET; 480 int _saveIndex; 481 482 match(']'); 483 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 484 _token = makeToken(_ttype); 485 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 486 } 487 _returnToken = _token; 488 } 489 490 protected final void mLetter(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 491 int _ttype; Token _token=null; int _begin=text.length(); 492 _ttype = Letter; 493 int _saveIndex; 494 495 switch ( LA(1)) { 496 case 'a': case 'b': case 'c': case 'd': 497 case 'e': case 'f': case 'g': case 'h': 498 case 'i': case 'j': case 'k': case 'l': 499 case 'm': case 'n': case 'o': case 'p': 500 case 'q': case 'r': case 's': case 't': 501 case 'u': case 'v': case 'w': case 'x': 502 case 'y': case 'z': 503 { 504 matchRange('a','z'); 505 break; 506 } 507 case '_': 508 { 509 match('_'); 510 break; 511 } 512 case '$': 513 { 514 match('$'); 515 break; 516 } 517 case ':': 518 { 519 match(':'); 520 break; 521 } 522 case '?': 523 { 524 match('?'); 525 break; 526 } 527 default: 528 { 529 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 530 } 531 } 532 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 533 _token = makeToken(_ttype); 534 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 535 } 536 _returnToken = _token; 537 } 538 539 protected final void mDigit(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 540 int _ttype; Token _token=null; int _begin=text.length(); 541 _ttype = Digit; 542 int _saveIndex; 543 544 matchRange('0','9'); 545 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 546 _token = makeToken(_ttype); 547 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 548 } 549 _returnToken = _token; 550 } 551 552 protected final void mSPACE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 553 int _ttype; Token _token=null; int _begin=text.length(); 554 _ttype = SPACE; 555 int _saveIndex; 556 557 match(' '); 558 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 559 _token = makeToken(_ttype); 560 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 561 } 562 _returnToken = _token; 563 } 564 565 public final void mIdentifier(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 566 int _ttype; Token _token=null; int _begin=text.length(); 567 _ttype = Identifier; 568 int _saveIndex; 569 570 { 571 int _cnt27=0; 572 _loop27: 573 do { 574 switch ( LA(1)) { 575 case '$': case ':': case '?': case '_': 576 case 'a': case 'b': case 'c': case 'd': 577 case 'e': case 'f': case 'g': case 'h': 578 case 'i': case 'j': case 'k': case 'l': 579 case 'm': case 'n': case 'o': case 'p': 580 case 'q': case 'r': case 's': case 't': 581 case 'u': case 'v': case 'w': case 'x': 582 case 'y': case 'z': 583 { 584 mLetter(false); 585 break; 586 } 587 case '0': case '1': case '2': case '3': 588 case '4': case '5': case '6': case '7': 589 case '8': case '9': 590 { 591 mDigit(false); 592 break; 593 } 594 case '.': 595 { 596 mPACKAGE_SEPERATOR(false); 597 break; 598 } 599 case '[': 600 { 601 mLBRACKET(false); 602 break; 603 } 604 case ']': 605 { 606 mRBRACKET(false); 607 break; 608 } 609 default: 610 { 611 if ( _cnt27>=1 ) { break _loop27; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 612 } 613 } 614 _cnt27++; 615 } while (true); 616 } 617 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 618 _token = makeToken(_ttype); 619 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 620 } 621 _returnToken = _token; 622 } 623 624 protected final void mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 625 int _ttype; Token _token=null; int _begin=text.length(); 626 _ttype = ESC; 627 int _saveIndex; 628 629 boolean synPredMatched30 = false; 630 if (((LA(1)=='\\') && (LA(2)=='\''||LA(2)=='\\'))) { 631 int _m30 = mark(); 632 synPredMatched30 = true; 633 inputState.guessing++; 634 try { 635 { 636 match('\\'); 637 } 638 } 639 catch (RecognitionException pe) { 640 synPredMatched30 = false; 641 } 642 rewind(_m30); 643 inputState.guessing--; 644 } 645 if ( synPredMatched30 ) { 646 _saveIndex=text.length(); 647 match('\\'); 648 text.setLength(_saveIndex); 649 { 650 switch ( LA(1)) { 651 case '\'': 652 { 653 match('\''); 654 break; 655 } 656 case '\\': 657 { 658 match('\\'); 659 break; 660 } 661 default: 662 { 663 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 664 } 665 } 666 } 667 } 668 else if ((LA(1)=='\\') && ((LA(2) >= '\u0000' && LA(2) <= '\u007f'))) { 669 match('\\'); 670 } 671 else { 672 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 673 } 674 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 protected final void mNONESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 683 int _ttype; Token _token=null; int _begin=text.length(); 684 _ttype = NONESC; 685 int _saveIndex; 686 687 { 688 match(_tokenSet_0); 689 } 690 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 691 _token = makeToken(_ttype); 692 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 693 } 694 _returnToken = _token; 695 } 696 697 public final void mPredicateIdentifier(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 698 int _ttype; Token _token=null; int _begin=text.length(); 699 _ttype = PredicateIdentifier; 700 int _saveIndex; 701 702 _saveIndex=text.length(); 703 mSINGLE_QUOTE(false); 704 text.setLength(_saveIndex); 705 { 706 _loop36: 707 do { 708 switch ( LA(1)) { 709 case '\\': 710 { 711 mESC(false); 712 break; 713 } 714 case '\u0000': case '\u0001': case '\u0002': case '\u0003': 715 case '\u0004': case '\u0005': case '\u0006': case '\u0007': 716 case '\u0008': case '\t': case '\n': case '\u000b': 717 case '\u000c': case '\r': case '\u000e': case '\u000f': 718 case '\u0010': case '\u0011': case '\u0012': case '\u0013': 719 case '\u0014': case '\u0015': case '\u0016': case '\u0017': 720 case '\u0018': case '\u0019': case '\u001a': case '\u001b': 721 case '\u001c': case '\u001d': case '\u001e': case '\u001f': 722 case ' ': case '!': case '"': case '#': 723 case '$': case '%': case '&': case '(': 724 case ')': case '*': case '+': case ',': 725 case '-': case '.': case '/': case '0': 726 case '1': case '2': case '3': case '4': 727 case '5': case '6': case '7': case '8': 728 case '9': case ':': case ';': case '<': 729 case '=': case '>': case '?': case '@': 730 case 'A': case 'B': case 'C': case 'D': 731 case 'E': case 'F': case 'G': case 'H': 732 case 'I': case 'J': case 'K': case 'L': 733 case 'M': case 'N': case 'O': case 'P': 734 case 'Q': case 'R': case 'S': case 'T': 735 case 'U': case 'V': case 'W': case 'X': 736 case 'Y': case 'Z': case '[': case ']': 737 case '^': case '_': case '`': case 'a': 738 case 'b': case 'c': case 'd': case 'e': 739 case 'f': case 'g': case 'h': case 'i': 740 case 'j': case 'k': case 'l': case 'm': 741 case 'n': case 'o': case 'p': case 'q': 742 case 'r': case 's': case 't': case 'u': 743 case 'v': case 'w': case 'x': case 'y': 744 case 'z': case '{': case '|': case '}': 745 case '~': case '\u007f': 746 { 747 mNONESC(false); 748 break; 749 } 750 default: 751 { 752 break _loop36; 753 } 754 } 755 } while (true); 756 } 757 _saveIndex=text.length(); 758 mSINGLE_QUOTE(false); 759 text.setLength(_saveIndex); 760 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 761 _token = makeToken(_ttype); 762 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 763 } 764 _returnToken = _token; 765 } 766 767 public final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 768 int _ttype; Token _token=null; int _begin=text.length(); 769 _ttype = WS; 770 int _saveIndex; 771 772 { 773 int _cnt40=0; 774 _loop40: 775 do { 776 switch ( LA(1)) { 777 case ' ': 778 { 779 mSPACE(false); 780 break; 781 } 782 case '\t': 783 { 784 match('\t'); 785 break; 786 } 787 case '\u000c': 788 { 789 match('\f'); 790 break; 791 } 792 case '\n': case '\r': 793 { 794 { 795 if ((LA(1)=='\r') && (LA(2)=='\n')) { 796 match("\r\n"); 797 } 798 else if ((LA(1)=='\r') && (true)) { 799 match('\r'); 800 } 801 else if ((LA(1)=='\n')) { 802 match('\n'); 803 } 804 else { 805 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 806 } 807 808 } 809 if ( inputState.guessing==0 ) { 810 newline(); 811 } 812 break; 813 } 814 default: 815 { 816 if ( _cnt40>=1 ) { break _loop40; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 817 } 818 } 819 _cnt40++; 820 } while (true); 821 } 822 if ( inputState.guessing==0 ) { 823 _ttype = Token.SKIP; 824 } 825 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 826 _token = makeToken(_ttype); 827 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 828 } 829 _returnToken = _token; 830 } 831 832 833 private static final long[] mk_tokenSet_0() { 834 long[] data = { -549755813889L, -268435457L, 0L, 0L}; 835 return data; 836 } 837 public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); 838 839 } 840 | Popular Tags |