View Javadoc
1 /* Generated By:JavaCC: Do not edit this line. SelectorParser.java */ 2 package com.codestreet.selector.parser; 3 4 import java.io.StringReader; 5 6 import java.util.Set; 7 import java.util.HashSet; 8 import java.util.Map; 9 10 public class SelectorParser implements SelectorParserConstants { 11 private Map identifierMap = new java.util.HashMap(); 12 13 /*** 14 * Parse the specified selector. 15 * @param selector Selector. 16 * @param trace Flag to enable/disable tracing. 17 * @return Returns the parse state. The parse state consists of the root 18 * of the parse tree and the identifiers encountered during the parse. 19 */ 20 public static SelectorParseState doParse(final String selector, final boolean trace) throws InvalidSelectorException 21 { 22 try 23 { 24 if (selector == null) 25 throw new NullPointerException("NULL selector"); 26 else if (selector.trim().length() == 0) 27 throw new IllegalArgumentException("Empty selector"); 28 29 return new SelectorParser().parse(selector, trace); 30 } 31 catch (ParseException ex) 32 { 33 throw new InvalidSelectorException(ex); 34 } 35 } 36 37 private SelectorParser() 38 { 39 this(new StringReader("")); 40 } 41 42 private SelectorParseState parse(final String selector) throws ParseException 43 { 44 return parse(selector, false); 45 } 46 47 private SelectorParseState parse(final String selector, final boolean trace) throws ParseException 48 { 49 StringReader sr = new StringReader(selector); 50 ReInit(sr); 51 52 if (trace) 53 { 54 this.enable_tracing(); 55 } 56 else 57 { 58 this.disable_tracing(); 59 } 60 61 return new SelectorParseState(this.expression(), identifierMap); 62 } 63 64 private String stripQuotes(final String image) 65 { 66 return image.substring(1, image.length() - 1); 67 } 68 69 public static class SelectorParseState 70 { 71 public SelectorParseState(final IExpression root, final Map identifiers) 72 { 73 root_ = root; 74 identifiers_ = identifiers; 75 } 76 77 public IExpression getRoot() 78 { 79 return root_; 80 } 81 82 public Map getIdentifiers() 83 { 84 return identifiers_; 85 } 86 87 private final IExpression root_; 88 private final Map identifiers_; 89 } 90 91 /*** Start of the grammar */ 92 final public IExpression expression() throws ParseException { 93 IExpression exp1 = null; 94 exp1 = logicExpression(); 95 jj_consume_token(0); 96 {if (true) return exp1;} 97 throw new Error("Missing return statement in function"); 98 } 99 100 final public IExpression logicExpression() throws ParseException { 101 IExpression exp1 = null; 102 IExpression exp2 = null; 103 exp1 = notExpression(); 104 label_1: 105 while (true) { 106 if (jj_2_1(3)) { 107 ; 108 } else { 109 break label_1; 110 } 111 if (jj_2_2(3)) { 112 jj_consume_token(TK_AND); 113 exp2 = notExpression(); 114 exp1 = new ConditionalOp(ConditionalOpImpl.AND, exp1, exp2); 115 } else if (jj_2_3(3)) { 116 jj_consume_token(TK_OR); 117 exp2 = notExpression(); 118 exp1 = new ConditionalOp(ConditionalOpImpl.OR, exp1, exp2); 119 } else { 120 jj_consume_token(-1); 121 throw new ParseException(); 122 } 123 } 124 {if (true) return exp1;} 125 throw new Error("Missing return statement in function"); 126 } 127 128 final public IExpression notExpression() throws ParseException { 129 IExpression exp1 = null; 130 if (jj_2_4(3)) { 131 exp1 = relationalExpression(); 132 {if (true) return exp1;} 133 } else if (jj_2_5(3)) { 134 jj_consume_token(TK_NOT); 135 exp1 = relationalExpression(); 136 exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, exp1); 137 {if (true) return exp1;} 138 } else { 139 jj_consume_token(-1); 140 throw new ParseException(); 141 } 142 throw new Error("Missing return statement in function"); 143 } 144 145 final public IExpression relationalExpression() throws ParseException { 146 IExpression exp1 = null; 147 IExpression exp2 = null; 148 exp1 = orEqualExpression(); 149 label_2: 150 while (true) { 151 if (jj_2_6(3)) { 152 ; 153 } else { 154 break label_2; 155 } 156 if (jj_2_7(3)) { 157 jj_consume_token(TK_LT); 158 exp2 = orEqualExpression(); 159 exp1 = new ArithCompareOp(ArithCompareOpImpl.LT, exp1, exp2); 160 } else if (jj_2_8(3)) { 161 jj_consume_token(TK_GT); 162 exp2 = orEqualExpression(); 163 exp1 = new ArithCompareOp(ArithCompareOpImpl.GT, exp1, exp2); 164 } else { 165 jj_consume_token(-1); 166 throw new ParseException(); 167 } 168 } 169 {if (true) return exp1;} 170 throw new Error("Missing return statement in function"); 171 } 172 173 final public IExpression orEqualExpression() throws ParseException { 174 IExpression exp1 = null; 175 IExpression exp2 = null; 176 exp1 = equalExpression(); 177 label_3: 178 while (true) { 179 if (jj_2_9(3)) { 180 ; 181 } else { 182 break label_3; 183 } 184 if (jj_2_10(3)) { 185 jj_consume_token(TK_LE); 186 exp2 = equalExpression(); 187 exp1 = new ArithCompareOp(ArithCompareOpImpl.LE, exp1, exp2); 188 } else if (jj_2_11(3)) { 189 jj_consume_token(TK_GE); 190 exp2 = equalExpression(); 191 exp1 = new ArithCompareOp(ArithCompareOpImpl.GE, exp1, exp2); 192 } else { 193 jj_consume_token(-1); 194 throw new ParseException(); 195 } 196 } 197 {if (true) return exp1;} 198 throw new Error("Missing return statement in function"); 199 } 200 201 final public IExpression equalExpression() throws ParseException { 202 IExpression exp1 = null; 203 IExpression exp2 = null; 204 IExpression exp3 = null; 205 Set set = null; 206 exp1 = additiveExpression(); 207 label_4: 208 while (true) { 209 if (jj_2_12(3)) { 210 ; 211 } else { 212 break label_4; 213 } 214 if (jj_2_13(3)) { 215 jj_consume_token(TK_NE); 216 exp2 = additiveExpression(); 217 if (exp1 instanceof IExpressionNumeric || exp2 instanceof IExpressionNumeric) 218 exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, new ArithCompareOp(ArithCompareOpImpl.EQ, exp1, exp2)); 219 else if (exp1 instanceof IExpressionBool || exp2 instanceof IExpressionBool) 220 exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, new OpBoolEQ(exp1, exp2)); 221 else if (exp1 instanceof IExpressionString || exp2 instanceof IExpressionString) 222 exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, new OpStringEQ(exp1, exp2)); 223 else 224 { 225 if (exp1 instanceof Identifier && exp2 instanceof Identifier) 226 {if (true) throw new ParseException("Syntax error: LHS (" + exp1.toString() + ") and RHS (" + exp2.toString() + ") cannot both be identifiers");} 227 else 228 {if (true) throw new ParseException("Syntax error: " + exp1.toString() + " <> " + exp2.toString());} 229 } 230 } else if (jj_2_14(3)) { 231 jj_consume_token(TK_EQ); 232 exp2 = additiveExpression(); 233 if (exp1 instanceof IExpressionNumeric || exp2 instanceof IExpressionNumeric) 234 exp1 = new ArithCompareOp(ArithCompareOpImpl.EQ, exp1, exp2); 235 else if (exp1 instanceof IExpressionBool || exp2 instanceof IExpressionBool) 236 exp1 = new OpBoolEQ(exp1, exp2); 237 else if (exp1 instanceof IExpressionString || exp2 instanceof IExpressionString) 238 exp1 = new OpStringEQ(exp1, exp2); 239 else 240 { 241 if (exp1 instanceof Identifier && exp2 instanceof Identifier) 242 {if (true) throw new ParseException("Syntax error: LHS (" + exp1.toString() + ") and RHS (" + exp2.toString() + ") cannot both be identifiers");} 243 else 244 {if (true) throw new ParseException("Syntax error: " + exp1.toString() + " = " + exp2.toString());} 245 } 246 } else if (jj_2_15(3)) { 247 jj_consume_token(TK_IS); 248 exp1 = nullExp(exp1); 249 } else if (jj_2_16(3)) { 250 jj_consume_token(TK_BETWEEN); 251 exp2 = additiveExpression(); 252 jj_consume_token(TK_AND); 253 exp3 = additiveExpression(); 254 exp1 = new OpBETWEEN(exp1, exp2, exp3); 255 } else if (jj_2_17(3)) { 256 jj_consume_token(TK_IS); 257 exp1 = nullExp(exp1); 258 } else if (jj_2_18(3)) { 259 jj_consume_token(TK_NOT); 260 jj_consume_token(TK_BETWEEN); 261 exp2 = additiveExpression(); 262 jj_consume_token(TK_AND); 263 exp3 = additiveExpression(); 264 exp1 = new OpBETWEEN(exp1, exp2, exp3); 265 exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, exp1); 266 } else if (jj_2_19(3)) { 267 jj_consume_token(TK_LIKE); 268 exp1 = likeExp(exp1); 269 } else if (jj_2_20(3)) { 270 jj_consume_token(TK_NOT); 271 jj_consume_token(TK_LIKE); 272 exp1 = likeExp(exp1); 273 exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, exp1); 274 } else if (jj_2_21(3)) { 275 jj_consume_token(TK_IN); 276 jj_consume_token(TK_LPAREN); 277 set = new HashSet(); 278 stringList(set); 279 jj_consume_token(TK_RPAREN); 280 exp1 = new OpIN(exp1, set); 281 } else if (jj_2_22(3)) { 282 jj_consume_token(TK_NOT); 283 jj_consume_token(TK_IN); 284 jj_consume_token(TK_LPAREN); 285 set = new HashSet(); 286 stringList(set); 287 jj_consume_token(TK_RPAREN); 288 exp1 = new ConditionalOp(ConditionalOpImpl.NOT, null, new OpIN(exp1, set)); 289 } else { 290 jj_consume_token(-1); 291 throw new ParseException(); 292 } 293 } 294 {if (true) return exp1;} 295 throw new Error("Missing return statement in function"); 296 } 297 298 final public IExpression additiveExpression() throws ParseException { 299 IExpression exp1 = null; 300 IExpression exp2 = null; 301 exp1 = multiplicativeExpression(); 302 label_5: 303 while (true) { 304 if (jj_2_23(3)) { 305 ; 306 } else { 307 break label_5; 308 } 309 if (jj_2_24(3)) { 310 jj_consume_token(TK_PLUS); 311 exp2 = multiplicativeExpression(); 312 exp1 = new ArithOp(ArithOpImpl.PLUS, exp1, exp2); 313 } else if (jj_2_25(3)) { 314 jj_consume_token(TK_MINUS); 315 exp2 = multiplicativeExpression(); 316 exp1 = new ArithOp(ArithOpImpl.MINUS, exp1, exp2); 317 } else { 318 jj_consume_token(-1); 319 throw new ParseException(); 320 } 321 } 322 {if (true) return exp1;} 323 throw new Error("Missing return statement in function"); 324 } 325 326 final public IExpression multiplicativeExpression() throws ParseException { 327 IExpression exp1 = null; 328 IExpression exp2 = null; 329 exp1 = unaryExpression(); 330 label_6: 331 while (true) { 332 if (jj_2_26(3)) { 333 ; 334 } else { 335 break label_6; 336 } 337 if (jj_2_27(3)) { 338 jj_consume_token(TK_MULT); 339 exp2 = unaryExpression(); 340 exp1 = new ArithOp(ArithOpImpl.MULT, exp1, exp2); 341 } else if (jj_2_28(3)) { 342 jj_consume_token(TK_DIV); 343 exp2 = unaryExpression(); 344 exp1 = new ArithOp(ArithOpImpl.DIV, exp1, exp2); 345 } else { 346 jj_consume_token(-1); 347 throw new ParseException(); 348 } 349 } 350 {if (true) return exp1;} 351 throw new Error("Missing return statement in function"); 352 } 353 354 final public IExpression unaryExpression() throws ParseException { 355 IExpression exp1 = null; 356 if (jj_2_29(3)) { 357 jj_consume_token(TK_PLUS); 358 exp1 = unaryExpression(); 359 {if (true) return exp1;} 360 } else if (jj_2_30(3)) { 361 jj_consume_token(TK_MINUS); 362 exp1 = unaryExpression(); 363 {if (true) return new ArithOp(ArithOpImpl.NEG, null, exp1);} 364 } else if (jj_2_31(3)) { 365 exp1 = unaryExpressionNotPlusMinus(); 366 {if (true) return exp1;} 367 } else { 368 jj_consume_token(-1); 369 throw new ParseException(); 370 } 371 throw new Error("Missing return statement in function"); 372 } 373 374 final public IExpression unaryExpressionNotPlusMinus() throws ParseException { 375 Token t = null; 376 IExpression exp = null; 377 if (jj_2_32(3)) { 378 t = jj_consume_token(TK_IDENTIFIER); 379 Identifier id = (Identifier)identifierMap.get(t.image); 380 if( id == null ) 381 { 382 id = Identifier.valueOf(t.image); 383 identifierMap.put(t.image, id); 384 } 385 {if (true) return id;} 386 } else if (jj_2_33(3)) { 387 t = jj_consume_token(TK_STRING); 388 {if (true) return LiteralString.valueOf(stripQuotes(t.image));} 389 } else if (jj_2_34(3)) { 390 t = jj_consume_token(TK_DOUBLE); 391 {if (true) return LiteralDouble.valueOf(t.image);} 392 } else if (jj_2_35(3)) { 393 t = jj_consume_token(TK_LONG); 394 {if (true) return LiteralLong.valueOf(t.image);} 395 } else if (jj_2_36(3)) { 396 t = jj_consume_token(TK_TRUE); 397 {if (true) return LiteralBool.valueOf(t.image);} 398 } else if (jj_2_37(3)) { 399 t = jj_consume_token(TK_FALSE); 400 {if (true) return LiteralBool.valueOf(t.image);} 401 } else if (jj_2_38(3)) { 402 jj_consume_token(TK_LPAREN); 403 exp = logicExpression(); 404 jj_consume_token(TK_RPAREN); 405 {if (true) return exp;} 406 } else { 407 jj_consume_token(-1); 408 throw new ParseException(); 409 } 410 throw new Error("Missing return statement in function"); 411 } 412 413 final public IExpression nullExp(IExpression exp1) throws ParseException { 414 Token not = null; 415 if (jj_2_39(3)) { 416 not = jj_consume_token(TK_NOT); 417 } else { 418 ; 419 } 420 jj_consume_token(TK_NULL); 421 if (not == null) 422 {if (true) return new OpNULL(exp1);} 423 else 424 {if (true) return new ConditionalOp(ConditionalOpImpl.NOT, null, new OpNULL(exp1));} 425 throw new Error("Missing return statement in function"); 426 } 427 428 final public IExpression likeExp(IExpression exp1) throws ParseException { 429 IExpression exp2 = null; 430 IExpression exp3 = null; 431 Token esc = null; 432 exp2 = additiveExpression(); 433 if (jj_2_40(3)) { 434 esc = jj_consume_token(TK_ESCAPE); 435 exp3 = additiveExpression(); 436 } else { 437 ; 438 } 439 if( esc == null ) 440 {if (true) return new OpLIKE(exp1, exp2, null);} 441 else 442 {if (true) return new OpLIKE(exp1, exp2, exp3);} 443 throw new Error("Missing return statement in function"); 444 } 445 446 final public void stringList(Set set) throws ParseException { 447 stringToken(set); 448 label_7: 449 while (true) { 450 if (jj_2_41(3)) { 451 ; 452 } else { 453 break label_7; 454 } 455 jj_consume_token(TK_COMMA); 456 stringToken(set); 457 } 458 } 459 460 final public void stringToken(Set set) throws ParseException { 461 Token t = null; 462 if (jj_2_42(3)) { 463 t = jj_consume_token(TK_STRING); 464 } else { 465 ; 466 } 467 if( t != null ) set.add(stripQuotes(t.image)); 468 } 469 470 final private boolean jj_2_1(int xla) { 471 jj_la = xla; jj_lastpos = jj_scanpos = token; 472 boolean retval = !jj_3_1(); 473 jj_save(0, xla); 474 return retval; 475 } 476 477 final private boolean jj_2_2(int xla) { 478 jj_la = xla; jj_lastpos = jj_scanpos = token; 479 boolean retval = !jj_3_2(); 480 jj_save(1, xla); 481 return retval; 482 } 483 484 final private boolean jj_2_3(int xla) { 485 jj_la = xla; jj_lastpos = jj_scanpos = token; 486 boolean retval = !jj_3_3(); 487 jj_save(2, xla); 488 return retval; 489 } 490 491 final private boolean jj_2_4(int xla) { 492 jj_la = xla; jj_lastpos = jj_scanpos = token; 493 boolean retval = !jj_3_4(); 494 jj_save(3, xla); 495 return retval; 496 } 497 498 final private boolean jj_2_5(int xla) { 499 jj_la = xla; jj_lastpos = jj_scanpos = token; 500 boolean retval = !jj_3_5(); 501 jj_save(4, xla); 502 return retval; 503 } 504 505 final private boolean jj_2_6(int xla) { 506 jj_la = xla; jj_lastpos = jj_scanpos = token; 507 boolean retval = !jj_3_6(); 508 jj_save(5, xla); 509 return retval; 510 } 511 512 final private boolean jj_2_7(int xla) { 513 jj_la = xla; jj_lastpos = jj_scanpos = token; 514 boolean retval = !jj_3_7(); 515 jj_save(6, xla); 516 return retval; 517 } 518 519 final private boolean jj_2_8(int xla) { 520 jj_la = xla; jj_lastpos = jj_scanpos = token; 521 boolean retval = !jj_3_8(); 522 jj_save(7, xla); 523 return retval; 524 } 525 526 final private boolean jj_2_9(int xla) { 527 jj_la = xla; jj_lastpos = jj_scanpos = token; 528 boolean retval = !jj_3_9(); 529 jj_save(8, xla); 530 return retval; 531 } 532 533 final private boolean jj_2_10(int xla) { 534 jj_la = xla; jj_lastpos = jj_scanpos = token; 535 boolean retval = !jj_3_10(); 536 jj_save(9, xla); 537 return retval; 538 } 539 540 final private boolean jj_2_11(int xla) { 541 jj_la = xla; jj_lastpos = jj_scanpos = token; 542 boolean retval = !jj_3_11(); 543 jj_save(10, xla); 544 return retval; 545 } 546 547 final private boolean jj_2_12(int xla) { 548 jj_la = xla; jj_lastpos = jj_scanpos = token; 549 boolean retval = !jj_3_12(); 550 jj_save(11, xla); 551 return retval; 552 } 553 554 final private boolean jj_2_13(int xla) { 555 jj_la = xla; jj_lastpos = jj_scanpos = token; 556 boolean retval = !jj_3_13(); 557 jj_save(12, xla); 558 return retval; 559 } 560 561 final private boolean jj_2_14(int xla) { 562 jj_la = xla; jj_lastpos = jj_scanpos = token; 563 boolean retval = !jj_3_14(); 564 jj_save(13, xla); 565 return retval; 566 } 567 568 final private boolean jj_2_15(int xla) { 569 jj_la = xla; jj_lastpos = jj_scanpos = token; 570 boolean retval = !jj_3_15(); 571 jj_save(14, xla); 572 return retval; 573 } 574 575 final private boolean jj_2_16(int xla) { 576 jj_la = xla; jj_lastpos = jj_scanpos = token; 577 boolean retval = !jj_3_16(); 578 jj_save(15, xla); 579 return retval; 580 } 581 582 final private boolean jj_2_17(int xla) { 583 jj_la = xla; jj_lastpos = jj_scanpos = token; 584 boolean retval = !jj_3_17(); 585 jj_save(16, xla); 586 return retval; 587 } 588 589 final private boolean jj_2_18(int xla) { 590 jj_la = xla; jj_lastpos = jj_scanpos = token; 591 boolean retval = !jj_3_18(); 592 jj_save(17, xla); 593 return retval; 594 } 595 596 final private boolean jj_2_19(int xla) { 597 jj_la = xla; jj_lastpos = jj_scanpos = token; 598 boolean retval = !jj_3_19(); 599 jj_save(18, xla); 600 return retval; 601 } 602 603 final private boolean jj_2_20(int xla) { 604 jj_la = xla; jj_lastpos = jj_scanpos = token; 605 boolean retval = !jj_3_20(); 606 jj_save(19, xla); 607 return retval; 608 } 609 610 final private boolean jj_2_21(int xla) { 611 jj_la = xla; jj_lastpos = jj_scanpos = token; 612 boolean retval = !jj_3_21(); 613 jj_save(20, xla); 614 return retval; 615 } 616 617 final private boolean jj_2_22(int xla) { 618 jj_la = xla; jj_lastpos = jj_scanpos = token; 619 boolean retval = !jj_3_22(); 620 jj_save(21, xla); 621 return retval; 622 } 623 624 final private boolean jj_2_23(int xla) { 625 jj_la = xla; jj_lastpos = jj_scanpos = token; 626 boolean retval = !jj_3_23(); 627 jj_save(22, xla); 628 return retval; 629 } 630 631 final private boolean jj_2_24(int xla) { 632 jj_la = xla; jj_lastpos = jj_scanpos = token; 633 boolean retval = !jj_3_24(); 634 jj_save(23, xla); 635 return retval; 636 } 637 638 final private boolean jj_2_25(int xla) { 639 jj_la = xla; jj_lastpos = jj_scanpos = token; 640 boolean retval = !jj_3_25(); 641 jj_save(24, xla); 642 return retval; 643 } 644 645 final private boolean jj_2_26(int xla) { 646 jj_la = xla; jj_lastpos = jj_scanpos = token; 647 boolean retval = !jj_3_26(); 648 jj_save(25, xla); 649 return retval; 650 } 651 652 final private boolean jj_2_27(int xla) { 653 jj_la = xla; jj_lastpos = jj_scanpos = token; 654 boolean retval = !jj_3_27(); 655 jj_save(26, xla); 656 return retval; 657 } 658 659 final private boolean jj_2_28(int xla) { 660 jj_la = xla; jj_lastpos = jj_scanpos = token; 661 boolean retval = !jj_3_28(); 662 jj_save(27, xla); 663 return retval; 664 } 665 666 final private boolean jj_2_29(int xla) { 667 jj_la = xla; jj_lastpos = jj_scanpos = token; 668 boolean retval = !jj_3_29(); 669 jj_save(28, xla); 670 return retval; 671 } 672 673 final private boolean jj_2_30(int xla) { 674 jj_la = xla; jj_lastpos = jj_scanpos = token; 675 boolean retval = !jj_3_30(); 676 jj_save(29, xla); 677 return retval; 678 } 679 680 final private boolean jj_2_31(int xla) { 681 jj_la = xla; jj_lastpos = jj_scanpos = token; 682 boolean retval = !jj_3_31(); 683 jj_save(30, xla); 684 return retval; 685 } 686 687 final private boolean jj_2_32(int xla) { 688 jj_la = xla; jj_lastpos = jj_scanpos = token; 689 boolean retval = !jj_3_32(); 690 jj_save(31, xla); 691 return retval; 692 } 693 694 final private boolean jj_2_33(int xla) { 695 jj_la = xla; jj_lastpos = jj_scanpos = token; 696 boolean retval = !jj_3_33(); 697 jj_save(32, xla); 698 return retval; 699 } 700 701 final private boolean jj_2_34(int xla) { 702 jj_la = xla; jj_lastpos = jj_scanpos = token; 703 boolean retval = !jj_3_34(); 704 jj_save(33, xla); 705 return retval; 706 } 707 708 final private boolean jj_2_35(int xla) { 709 jj_la = xla; jj_lastpos = jj_scanpos = token; 710 boolean retval = !jj_3_35(); 711 jj_save(34, xla); 712 return retval; 713 } 714 715 final private boolean jj_2_36(int xla) { 716 jj_la = xla; jj_lastpos = jj_scanpos = token; 717 boolean retval = !jj_3_36(); 718 jj_save(35, xla); 719 return retval; 720 } 721 722 final private boolean jj_2_37(int xla) { 723 jj_la = xla; jj_lastpos = jj_scanpos = token; 724 boolean retval = !jj_3_37(); 725 jj_save(36, xla); 726 return retval; 727 } 728 729 final private boolean jj_2_38(int xla) { 730 jj_la = xla; jj_lastpos = jj_scanpos = token; 731 boolean retval = !jj_3_38(); 732 jj_save(37, xla); 733 return retval; 734 } 735 736 final private boolean jj_2_39(int xla) { 737 jj_la = xla; jj_lastpos = jj_scanpos = token; 738 boolean retval = !jj_3_39(); 739 jj_save(38, xla); 740 return retval; 741 } 742 743 final private boolean jj_2_40(int xla) { 744 jj_la = xla; jj_lastpos = jj_scanpos = token; 745 boolean retval = !jj_3_40(); 746 jj_save(39, xla); 747 return retval; 748 } 749 750 final private boolean jj_2_41(int xla) { 751 jj_la = xla; jj_lastpos = jj_scanpos = token; 752 boolean retval = !jj_3_41(); 753 jj_save(40, xla); 754 return retval; 755 } 756 757 final private boolean jj_2_42(int xla) { 758 jj_la = xla; jj_lastpos = jj_scanpos = token; 759 boolean retval = !jj_3_42(); 760 jj_save(41, xla); 761 return retval; 762 } 763 764 final private boolean jj_3_21() { 765 if (jj_scan_token(TK_IN)) return true; 766 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 767 if (jj_scan_token(TK_LPAREN)) return true; 768 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 769 if (jj_3R_15()) return true; 770 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 771 if (jj_scan_token(TK_RPAREN)) return true; 772 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 773 return false; 774 } 775 776 final private boolean jj_3_34() { 777 if (jj_scan_token(TK_DOUBLE)) return true; 778 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 779 return false; 780 } 781 782 final private boolean jj_3_8() { 783 if (jj_scan_token(TK_GT)) return true; 784 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 785 if (jj_3R_10()) return true; 786 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 787 return false; 788 } 789 790 final private boolean jj_3_20() { 791 if (jj_scan_token(TK_NOT)) return true; 792 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 793 if (jj_scan_token(TK_LIKE)) return true; 794 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 795 if (jj_3R_14()) return true; 796 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 797 return false; 798 } 799 800 final private boolean jj_3_33() { 801 if (jj_scan_token(TK_STRING)) return true; 802 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 803 return false; 804 } 805 806 final private boolean jj_3_19() { 807 if (jj_scan_token(TK_LIKE)) return true; 808 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 809 if (jj_3R_14()) return true; 810 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 811 return false; 812 } 813 814 final private boolean jj_3_6() { 815 Token xsp; 816 xsp = jj_scanpos; 817 if (jj_3_7()) { 818 jj_scanpos = xsp; 819 if (jj_3_8()) return true; 820 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 821 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 822 return false; 823 } 824 825 final private boolean jj_3_7() { 826 if (jj_scan_token(TK_LT)) return true; 827 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 828 if (jj_3R_10()) return true; 829 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 830 return false; 831 } 832 833 final private boolean jj_3_18() { 834 if (jj_scan_token(TK_NOT)) return true; 835 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 836 if (jj_scan_token(TK_BETWEEN)) return true; 837 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 838 if (jj_3R_12()) return true; 839 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 840 return false; 841 } 842 843 final private boolean jj_3R_9() { 844 if (jj_3R_10()) return true; 845 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 846 Token xsp; 847 while (true) { 848 xsp = jj_scanpos; 849 if (jj_3_6()) { jj_scanpos = xsp; break; } 850 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 851 } 852 return false; 853 } 854 855 final private boolean jj_3_41() { 856 if (jj_scan_token(TK_COMMA)) return true; 857 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 858 if (jj_3R_20()) return true; 859 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 860 return false; 861 } 862 863 final private boolean jj_3_17() { 864 if (jj_scan_token(TK_IS)) return true; 865 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 866 if (jj_3R_13()) return true; 867 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 868 return false; 869 } 870 871 final private boolean jj_3R_18() { 872 Token xsp; 873 xsp = jj_scanpos; 874 if (jj_3_32()) { 875 jj_scanpos = xsp; 876 if (jj_3_33()) { 877 jj_scanpos = xsp; 878 if (jj_3_34()) { 879 jj_scanpos = xsp; 880 if (jj_3_35()) { 881 jj_scanpos = xsp; 882 if (jj_3_36()) { 883 jj_scanpos = xsp; 884 if (jj_3_37()) { 885 jj_scanpos = xsp; 886 if (jj_3_38()) return true; 887 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 888 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 889 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 890 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 891 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 892 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 893 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 894 return false; 895 } 896 897 final private boolean jj_3_32() { 898 if (jj_scan_token(TK_IDENTIFIER)) return true; 899 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 900 return false; 901 } 902 903 final private boolean jj_3_16() { 904 if (jj_scan_token(TK_BETWEEN)) return true; 905 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 906 if (jj_3R_12()) return true; 907 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 908 if (jj_scan_token(TK_AND)) return true; 909 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 910 return false; 911 } 912 913 final private boolean jj_3_15() { 914 if (jj_scan_token(TK_IS)) return true; 915 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 916 if (jj_3R_13()) return true; 917 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 918 return false; 919 } 920 921 final private boolean jj_3_42() { 922 if (jj_scan_token(TK_STRING)) return true; 923 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 924 return false; 925 } 926 927 final private boolean jj_3R_20() { 928 Token xsp; 929 xsp = jj_scanpos; 930 if (jj_3_42()) jj_scanpos = xsp; 931 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 932 return false; 933 } 934 935 final private boolean jj_3_31() { 936 if (jj_3R_18()) return true; 937 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 938 return false; 939 } 940 941 final private boolean jj_3_5() { 942 if (jj_scan_token(TK_NOT)) return true; 943 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 944 if (jj_3R_9()) return true; 945 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 946 return false; 947 } 948 949 final private boolean jj_3_30() { 950 if (jj_scan_token(TK_MINUS)) return true; 951 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 952 if (jj_3R_17()) return true; 953 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 954 return false; 955 } 956 957 final private boolean jj_3R_17() { 958 Token xsp; 959 xsp = jj_scanpos; 960 if (jj_3_29()) { 961 jj_scanpos = xsp; 962 if (jj_3_30()) { 963 jj_scanpos = xsp; 964 if (jj_3_31()) return true; 965 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 966 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 967 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 968 return false; 969 } 970 971 final private boolean jj_3_29() { 972 if (jj_scan_token(TK_PLUS)) return true; 973 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 974 if (jj_3R_17()) return true; 975 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 976 return false; 977 } 978 979 final private boolean jj_3R_15() { 980 if (jj_3R_20()) return true; 981 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 982 Token xsp; 983 while (true) { 984 xsp = jj_scanpos; 985 if (jj_3_41()) { jj_scanpos = xsp; break; } 986 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 987 } 988 return false; 989 } 990 991 final private boolean jj_3R_8() { 992 Token xsp; 993 xsp = jj_scanpos; 994 if (jj_3_4()) { 995 jj_scanpos = xsp; 996 if (jj_3_5()) return true; 997 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 998 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 999 return false; 1000 } 1001 1002 final private boolean jj_3_4() { 1003 if (jj_3R_9()) return true; 1004 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1005 return false; 1006 } 1007 1008 final private boolean jj_3_14() { 1009 if (jj_scan_token(TK_EQ)) return true; 1010 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1011 if (jj_3R_12()) return true; 1012 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1013 return false; 1014 } 1015 1016 final private boolean jj_3_3() { 1017 if (jj_scan_token(TK_OR)) return true; 1018 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1019 if (jj_3R_8()) return true; 1020 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1021 return false; 1022 } 1023 1024 final private boolean jj_3_28() { 1025 if (jj_scan_token(TK_DIV)) return true; 1026 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1027 if (jj_3R_17()) return true; 1028 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1029 return false; 1030 } 1031 1032 final private boolean jj_3_40() { 1033 if (jj_scan_token(TK_ESCAPE)) return true; 1034 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1035 if (jj_3R_12()) return true; 1036 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1037 return false; 1038 } 1039 1040 final private boolean jj_3R_14() { 1041 if (jj_3R_12()) return true; 1042 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1043 Token xsp; 1044 xsp = jj_scanpos; 1045 if (jj_3_40()) jj_scanpos = xsp; 1046 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1047 return false; 1048 } 1049 1050 final private boolean jj_3_1() { 1051 Token xsp; 1052 xsp = jj_scanpos; 1053 if (jj_3_2()) { 1054 jj_scanpos = xsp; 1055 if (jj_3_3()) return true; 1056 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1057 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1058 return false; 1059 } 1060 1061 final private boolean jj_3_2() { 1062 if (jj_scan_token(TK_AND)) return true; 1063 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1064 if (jj_3R_8()) return true; 1065 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1066 return false; 1067 } 1068 1069 final private boolean jj_3_26() { 1070 Token xsp; 1071 xsp = jj_scanpos; 1072 if (jj_3_27()) { 1073 jj_scanpos = xsp; 1074 if (jj_3_28()) return true; 1075 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1076 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1077 return false; 1078 } 1079 1080 final private boolean jj_3_27() { 1081 if (jj_scan_token(TK_MULT)) return true; 1082 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1083 if (jj_3R_17()) return true; 1084 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1085 return false; 1086 } 1087 1088 final private boolean jj_3R_19() { 1089 if (jj_3R_8()) return true; 1090 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1091 Token xsp; 1092 while (true) { 1093 xsp = jj_scanpos; 1094 if (jj_3_1()) { jj_scanpos = xsp; break; } 1095 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1096 } 1097 return false; 1098 } 1099 1100 final private boolean jj_3R_16() { 1101 if (jj_3R_17()) return true; 1102 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1103 Token xsp; 1104 while (true) { 1105 xsp = jj_scanpos; 1106 if (jj_3_26()) { jj_scanpos = xsp; break; } 1107 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1108 } 1109 return false; 1110 } 1111 1112 final private boolean jj_3_13() { 1113 if (jj_scan_token(TK_NE)) return true; 1114 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1115 if (jj_3R_12()) return true; 1116 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1117 return false; 1118 } 1119 1120 final private boolean jj_3_12() { 1121 Token xsp; 1122 xsp = jj_scanpos; 1123 if (jj_3_13()) { 1124 jj_scanpos = xsp; 1125 if (jj_3_14()) { 1126 jj_scanpos = xsp; 1127 if (jj_3_15()) { 1128 jj_scanpos = xsp; 1129 if (jj_3_16()) { 1130 jj_scanpos = xsp; 1131 if (jj_3_17()) { 1132 jj_scanpos = xsp; 1133 if (jj_3_18()) { 1134 jj_scanpos = xsp; 1135 if (jj_3_19()) { 1136 jj_scanpos = xsp; 1137 if (jj_3_20()) { 1138 jj_scanpos = xsp; 1139 if (jj_3_21()) { 1140 jj_scanpos = xsp; 1141 if (jj_3_22()) return true; 1142 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1143 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1144 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1145 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1146 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1147 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1148 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1149 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1150 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1151 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1152 return false; 1153 } 1154 1155 final private boolean jj_3R_11() { 1156 if (jj_3R_12()) return true; 1157 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1158 Token xsp; 1159 while (true) { 1160 xsp = jj_scanpos; 1161 if (jj_3_12()) { jj_scanpos = xsp; break; } 1162 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1163 } 1164 return false; 1165 } 1166 1167 final private boolean jj_3_39() { 1168 if (jj_scan_token(TK_NOT)) return true; 1169 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1170 return false; 1171 } 1172 1173 final private boolean jj_3R_13() { 1174 Token xsp; 1175 xsp = jj_scanpos; 1176 if (jj_3_39()) jj_scanpos = xsp; 1177 else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1178 if (jj_scan_token(TK_NULL)) return true; 1179 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1180 return false; 1181 } 1182 1183 final private boolean jj_3_25() { 1184 if (jj_scan_token(TK_MINUS)) return true; 1185 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1186 if (jj_3R_16()) return true; 1187 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1188 return false; 1189 } 1190 1191 final private boolean jj_3_38() { 1192 if (jj_scan_token(TK_LPAREN)) return true; 1193 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1194 if (jj_3R_19()) return true; 1195 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1196 if (jj_scan_token(TK_RPAREN)) return true; 1197 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1198 return false; 1199 } 1200 1201 final private boolean jj_3_23() { 1202 Token xsp; 1203 xsp = jj_scanpos; 1204 if (jj_3_24()) { 1205 jj_scanpos = xsp; 1206 if (jj_3_25()) return true; 1207 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1208 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1209 return false; 1210 } 1211 1212 final private boolean jj_3_24() { 1213 if (jj_scan_token(TK_PLUS)) return true; 1214 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1215 if (jj_3R_16()) return true; 1216 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1217 return false; 1218 } 1219 1220 final private boolean jj_3_11() { 1221 if (jj_scan_token(TK_GE)) return true; 1222 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1223 if (jj_3R_11()) return true; 1224 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1225 return false; 1226 } 1227 1228 final private boolean jj_3R_12() { 1229 if (jj_3R_16()) return true; 1230 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1231 Token xsp; 1232 while (true) { 1233 xsp = jj_scanpos; 1234 if (jj_3_23()) { jj_scanpos = xsp; break; } 1235 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1236 } 1237 return false; 1238 } 1239 1240 final private boolean jj_3_37() { 1241 if (jj_scan_token(TK_FALSE)) return true; 1242 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1243 return false; 1244 } 1245 1246 final private boolean jj_3_10() { 1247 if (jj_scan_token(TK_LE)) return true; 1248 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1249 if (jj_3R_11()) return true; 1250 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1251 return false; 1252 } 1253 1254 final private boolean jj_3_9() { 1255 Token xsp; 1256 xsp = jj_scanpos; 1257 if (jj_3_10()) { 1258 jj_scanpos = xsp; 1259 if (jj_3_11()) return true; 1260 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1261 } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1262 return false; 1263 } 1264 1265 final private boolean jj_3_36() { 1266 if (jj_scan_token(TK_TRUE)) return true; 1267 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1268 return false; 1269 } 1270 1271 final private boolean jj_3R_10() { 1272 if (jj_3R_11()) return true; 1273 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1274 Token xsp; 1275 while (true) { 1276 xsp = jj_scanpos; 1277 if (jj_3_9()) { jj_scanpos = xsp; break; } 1278 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1279 } 1280 return false; 1281 } 1282 1283 final private boolean jj_3_22() { 1284 if (jj_scan_token(TK_NOT)) return true; 1285 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1286 if (jj_scan_token(TK_IN)) return true; 1287 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1288 if (jj_scan_token(TK_LPAREN)) return true; 1289 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1290 return false; 1291 } 1292 1293 final private boolean jj_3_35() { 1294 if (jj_scan_token(TK_LONG)) return true; 1295 if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; 1296 return false; 1297 } 1298 1299 public SelectorParserTokenManager token_source; 1300 SimpleCharStream jj_input_stream; 1301 public Token token, jj_nt; 1302 private int jj_ntk; 1303 private Token jj_scanpos, jj_lastpos; 1304 private int jj_la; 1305 public boolean lookingAhead = false; 1306 private boolean jj_semLA; 1307 private int jj_gen; 1308 final private int[] jj_la1 = new int[0]; 1309 final private int[] jj_la1_0 = {}; 1310 final private int[] jj_la1_1 = {}; 1311 final private JJCalls[] jj_2_rtns = new JJCalls[42]; 1312 private boolean jj_rescan = false; 1313 private int jj_gc = 0; 1314 1315 public SelectorParser(java.io.InputStream stream) { 1316 jj_input_stream = new SimpleCharStream(stream, 1, 1); 1317 token_source = new SelectorParserTokenManager(jj_input_stream); 1318 token = new Token(); 1319 jj_ntk = -1; 1320 jj_gen = 0; 1321 for (int i = 0; i < 0; i++) jj_la1[i] = -1; 1322 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1323 } 1324 1325 public void ReInit(java.io.InputStream stream) { 1326 jj_input_stream.ReInit(stream, 1, 1); 1327 token_source.ReInit(jj_input_stream); 1328 token = new Token(); 1329 jj_ntk = -1; 1330 jj_gen = 0; 1331 for (int i = 0; i < 0; i++) jj_la1[i] = -1; 1332 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1333 } 1334 1335 public SelectorParser(java.io.Reader stream) { 1336 jj_input_stream = new SimpleCharStream(stream, 1, 1); 1337 token_source = new SelectorParserTokenManager(jj_input_stream); 1338 token = new Token(); 1339 jj_ntk = -1; 1340 jj_gen = 0; 1341 for (int i = 0; i < 0; i++) jj_la1[i] = -1; 1342 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1343 } 1344 1345 public void ReInit(java.io.Reader stream) { 1346 jj_input_stream.ReInit(stream, 1, 1); 1347 token_source.ReInit(jj_input_stream); 1348 token = new Token(); 1349 jj_ntk = -1; 1350 jj_gen = 0; 1351 for (int i = 0; i < 0; i++) jj_la1[i] = -1; 1352 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1353 } 1354 1355 public SelectorParser(SelectorParserTokenManager tm) { 1356 token_source = tm; 1357 token = new Token(); 1358 jj_ntk = -1; 1359 jj_gen = 0; 1360 for (int i = 0; i < 0; i++) jj_la1[i] = -1; 1361 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1362 } 1363 1364 public void ReInit(SelectorParserTokenManager tm) { 1365 token_source = tm; 1366 token = new Token(); 1367 jj_ntk = -1; 1368 jj_gen = 0; 1369 for (int i = 0; i < 0; i++) jj_la1[i] = -1; 1370 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1371 } 1372 1373 final private Token jj_consume_token(int kind) throws ParseException { 1374 Token oldToken; 1375 if ((oldToken = token).next != null) token = token.next; 1376 else token = token.next = token_source.getNextToken(); 1377 jj_ntk = -1; 1378 if (token.kind == kind) { 1379 jj_gen++; 1380 if (++jj_gc > 100) { 1381 jj_gc = 0; 1382 for (int i = 0; i < jj_2_rtns.length; i++) { 1383 JJCalls c = jj_2_rtns[i]; 1384 while (c != null) { 1385 if (c.gen < jj_gen) c.first = null; 1386 c = c.next; 1387 } 1388 } 1389 } 1390 return token; 1391 } 1392 token = oldToken; 1393 jj_kind = kind; 1394 throw generateParseException(); 1395 } 1396 1397 final private boolean jj_scan_token(int kind) { 1398 if (jj_scanpos == jj_lastpos) { 1399 jj_la--; 1400 if (jj_scanpos.next == null) { 1401 jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); 1402 } else { 1403 jj_lastpos = jj_scanpos = jj_scanpos.next; 1404 } 1405 } else { 1406 jj_scanpos = jj_scanpos.next; 1407 } 1408 if (jj_rescan) { 1409 int i = 0; Token tok = token; 1410 while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } 1411 if (tok != null) jj_add_error_token(kind, i); 1412 } 1413 return (jj_scanpos.kind != kind); 1414 } 1415 1416 final public Token getNextToken() { 1417 if (token.next != null) token = token.next; 1418 else token = token.next = token_source.getNextToken(); 1419 jj_ntk = -1; 1420 jj_gen++; 1421 return token; 1422 } 1423 1424 final public Token getToken(int index) { 1425 Token t = lookingAhead ? jj_scanpos : token; 1426 for (int i = 0; i < index; i++) { 1427 if (t.next != null) t = t.next; 1428 else t = t.next = token_source.getNextToken(); 1429 } 1430 return t; 1431 } 1432 1433 final private int jj_ntk() { 1434 if ((jj_nt=token.next) == null) 1435 return (jj_ntk = (token.next=token_source.getNextToken()).kind); 1436 else 1437 return (jj_ntk = jj_nt.kind); 1438 } 1439 1440 private java.util.Vector jj_expentries = new java.util.Vector(); 1441 private int[] jj_expentry; 1442 private int jj_kind = -1; 1443 private int[] jj_lasttokens = new int[100]; 1444 private int jj_endpos; 1445 1446 private void jj_add_error_token(int kind, int pos) { 1447 if (pos >= 100) return; 1448 if (pos == jj_endpos + 1) { 1449 jj_lasttokens[jj_endpos++] = kind; 1450 } else if (jj_endpos != 0) { 1451 jj_expentry = new int[jj_endpos]; 1452 for (int i = 0; i < jj_endpos; i++) { 1453 jj_expentry[i] = jj_lasttokens[i]; 1454 } 1455 boolean exists = false; 1456 for (java.util.Enumeration enum = jj_expentries.elements(); enum.hasMoreElements();) { 1457 int[] oldentry = (int[])(enum.nextElement()); 1458 if (oldentry.length == jj_expentry.length) { 1459 exists = true; 1460 for (int i = 0; i < jj_expentry.length; i++) { 1461 if (oldentry[i] != jj_expentry[i]) { 1462 exists = false; 1463 break; 1464 } 1465 } 1466 if (exists) break; 1467 } 1468 } 1469 if (!exists) jj_expentries.addElement(jj_expentry); 1470 if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; 1471 } 1472 } 1473 1474 final public ParseException generateParseException() { 1475 jj_expentries.removeAllElements(); 1476 boolean[] la1tokens = new boolean[38]; 1477 for (int i = 0; i < 38; i++) { 1478 la1tokens[i] = false; 1479 } 1480 if (jj_kind >= 0) { 1481 la1tokens[jj_kind] = true; 1482 jj_kind = -1; 1483 } 1484 for (int i = 0; i < 0; i++) { 1485 if (jj_la1[i] == jj_gen) { 1486 for (int j = 0; j < 32; j++) { 1487 if ((jj_la1_0[i] & (1<<j)) != 0) { 1488 la1tokens[j] = true; 1489 } 1490 if ((jj_la1_1[i] & (1<<j)) != 0) { 1491 la1tokens[32+j] = true; 1492 } 1493 } 1494 } 1495 } 1496 for (int i = 0; i < 38; i++) { 1497 if (la1tokens[i]) { 1498 jj_expentry = new int[1]; 1499 jj_expentry[0] = i; 1500 jj_expentries.addElement(jj_expentry); 1501 } 1502 } 1503 jj_endpos = 0; 1504 jj_rescan_token(); 1505 jj_add_error_token(0, 0); 1506 int[][] exptokseq = new int[jj_expentries.size()][]; 1507 for (int i = 0; i < jj_expentries.size(); i++) { 1508 exptokseq[i] = (int[])jj_expentries.elementAt(i); 1509 } 1510 return new ParseException(token, exptokseq, tokenImage); 1511 } 1512 1513 final public void enable_tracing() { 1514 } 1515 1516 final public void disable_tracing() { 1517 } 1518 1519 final private void jj_rescan_token() { 1520 jj_rescan = true; 1521 for (int i = 0; i < 42; i++) { 1522 JJCalls p = jj_2_rtns[i]; 1523 do { 1524 if (p.gen > jj_gen) { 1525 jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; 1526 switch (i) { 1527 case 0: jj_3_1(); break; 1528 case 1: jj_3_2(); break; 1529 case 2: jj_3_3(); break; 1530 case 3: jj_3_4(); break; 1531 case 4: jj_3_5(); break; 1532 case 5: jj_3_6(); break; 1533 case 6: jj_3_7(); break; 1534 case 7: jj_3_8(); break; 1535 case 8: jj_3_9(); break; 1536 case 9: jj_3_10(); break; 1537 case 10: jj_3_11(); break; 1538 case 11: jj_3_12(); break; 1539 case 12: jj_3_13(); break; 1540 case 13: jj_3_14(); break; 1541 case 14: jj_3_15(); break; 1542 case 15: jj_3_16(); break; 1543 case 16: jj_3_17(); break; 1544 case 17: jj_3_18(); break; 1545 case 18: jj_3_19(); break; 1546 case 19: jj_3_20(); break; 1547 case 20: jj_3_21(); break; 1548 case 21: jj_3_22(); break; 1549 case 22: jj_3_23(); break; 1550 case 23: jj_3_24(); break; 1551 case 24: jj_3_25(); break; 1552 case 25: jj_3_26(); break; 1553 case 26: jj_3_27(); break; 1554 case 27: jj_3_28(); break; 1555 case 28: jj_3_29(); break; 1556 case 29: jj_3_30(); break; 1557 case 30: jj_3_31(); break; 1558 case 31: jj_3_32(); break; 1559 case 32: jj_3_33(); break; 1560 case 33: jj_3_34(); break; 1561 case 34: jj_3_35(); break; 1562 case 35: jj_3_36(); break; 1563 case 36: jj_3_37(); break; 1564 case 37: jj_3_38(); break; 1565 case 38: jj_3_39(); break; 1566 case 39: jj_3_40(); break; 1567 case 40: jj_3_41(); break; 1568 case 41: jj_3_42(); break; 1569 } 1570 } 1571 p = p.next; 1572 } while (p != null); 1573 } 1574 jj_rescan = false; 1575 } 1576 1577 final private void jj_save(int index, int xla) { 1578 JJCalls p = jj_2_rtns[index]; 1579 while (p.gen > jj_gen) { 1580 if (p.next == null) { p = p.next = new JJCalls(); break; } 1581 p = p.next; 1582 } 1583 p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; 1584 } 1585 1586 static final class JJCalls { 1587 int gen; 1588 Token first; 1589 int arg; 1590 JJCalls next; 1591 } 1592 1593 }

This page was automatically generated by Maven