1 2 package org.apache.el.parser; 3 import java.io.StringReader ; 4 import javax.el.ELException; 5 public class ELParserimplements ELParserTreeConstants, ELParserConstants { 6 protected JJTELParserState jjtree = new JJTELParserState();public static Node parse(String ref) throws ELException 7 { 8 try { 9 return (new ELParser(new StringReader (ref))).CompositeExpression(); 10 } catch (ParseException pe) { 11 throw new ELException(pe.getMessage()); 12 } 13 } 14 15 public static void main(String [] argv) throws Exception { 16 String [] str = { "${foo()}", "${fn.fn:foo() ? a : b}", "${fn:foo() ? (fn_af.f:fd() ? a : b) : b}", "${a.b.c ? a : b}" }; 17 for (int i = 0; i < str.length; i++) { 18 SimpleNode sn = (SimpleNode) ELParser.parse(str[i]); 19 System.out.println("====\n" + str[i]); 20 sn.dump("\t"); 21 } 22 } 23 24 29 final public AstCompositeExpression CompositeExpression() throws ParseException { 30 31 AstCompositeExpression jjtn000 = new AstCompositeExpression(JJTCOMPOSITEEXPRESSION); 32 boolean jjtc000 = true; 33 jjtree.openNodeScope(jjtn000); 34 try { 35 label_1: 36 while (true) { 37 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 38 case LITERAL_EXPRESSION: 39 case START_DYNAMIC_EXPRESSION: 40 case START_DEFERRED_EXPRESSION: 41 ; 42 break; 43 default: 44 jj_la1[0] = jj_gen; 45 break label_1; 46 } 47 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 48 case START_DEFERRED_EXPRESSION: 49 DeferredExpression(); 50 break; 51 case START_DYNAMIC_EXPRESSION: 52 DynamicExpression(); 53 break; 54 case LITERAL_EXPRESSION: 55 LiteralExpression(); 56 break; 57 default: 58 jj_la1[1] = jj_gen; 59 jj_consume_token(-1); 60 throw new ParseException(); 61 } 62 } 63 jj_consume_token(0); 64 jjtree.closeNodeScope(jjtn000, true); 65 jjtc000 = false; 66 {if (true) return jjtn000;} 67 } catch (Throwable jjte000) { 68 if (jjtc000) { 69 jjtree.clearNodeScope(jjtn000); 70 jjtc000 = false; 71 } else { 72 jjtree.popNode(); 73 } 74 if (jjte000 instanceof RuntimeException ) { 75 {if (true) throw (RuntimeException )jjte000;} 76 } 77 if (jjte000 instanceof ParseException) { 78 {if (true) throw (ParseException)jjte000;} 79 } 80 {if (true) throw (Error )jjte000;} 81 } finally { 82 if (jjtc000) { 83 jjtree.closeNodeScope(jjtn000, true); 84 } 85 } 86 throw new Error ("Missing return statement in function"); 87 } 88 89 93 final public void LiteralExpression() throws ParseException { 94 95 AstLiteralExpression jjtn000 = new AstLiteralExpression(JJTLITERALEXPRESSION); 96 boolean jjtc000 = true; 97 jjtree.openNodeScope(jjtn000);Token t = null; 98 try { 99 t = jj_consume_token(LITERAL_EXPRESSION); 100 jjtree.closeNodeScope(jjtn000, true); 101 jjtc000 = false; 102 jjtn000.setImage(t.image); 103 } finally { 104 if (jjtc000) { 105 jjtree.closeNodeScope(jjtn000, true); 106 } 107 } 108 } 109 110 114 final public void DeferredExpression() throws ParseException { 115 116 AstDeferredExpression jjtn000 = new AstDeferredExpression(JJTDEFERREDEXPRESSION); 117 boolean jjtc000 = true; 118 jjtree.openNodeScope(jjtn000); 119 try { 120 jj_consume_token(START_DEFERRED_EXPRESSION); 121 Expression(); 122 jj_consume_token(END_EXPRESSION); 123 } catch (Throwable jjte000) { 124 if (jjtc000) { 125 jjtree.clearNodeScope(jjtn000); 126 jjtc000 = false; 127 } else { 128 jjtree.popNode(); 129 } 130 if (jjte000 instanceof RuntimeException ) { 131 {if (true) throw (RuntimeException )jjte000;} 132 } 133 if (jjte000 instanceof ParseException) { 134 {if (true) throw (ParseException)jjte000;} 135 } 136 {if (true) throw (Error )jjte000;} 137 } finally { 138 if (jjtc000) { 139 jjtree.closeNodeScope(jjtn000, true); 140 } 141 } 142 } 143 144 148 final public void DynamicExpression() throws ParseException { 149 150 AstDynamicExpression jjtn000 = new AstDynamicExpression(JJTDYNAMICEXPRESSION); 151 boolean jjtc000 = true; 152 jjtree.openNodeScope(jjtn000); 153 try { 154 jj_consume_token(START_DYNAMIC_EXPRESSION); 155 Expression(); 156 jj_consume_token(END_EXPRESSION); 157 } catch (Throwable jjte000) { 158 if (jjtc000) { 159 jjtree.clearNodeScope(jjtn000); 160 jjtc000 = false; 161 } else { 162 jjtree.popNode(); 163 } 164 if (jjte000 instanceof RuntimeException ) { 165 {if (true) throw (RuntimeException )jjte000;} 166 } 167 if (jjte000 instanceof ParseException) { 168 {if (true) throw (ParseException)jjte000;} 169 } 170 {if (true) throw (Error )jjte000;} 171 } finally { 172 if (jjtc000) { 173 jjtree.closeNodeScope(jjtn000, true); 174 } 175 } 176 } 177 178 182 final public void Expression() throws ParseException { 183 Choice(); 184 } 185 186 190 final public void Choice() throws ParseException { 191 Or(); 192 label_2: 193 while (true) { 194 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 195 case QUESTIONMARK: 196 ; 197 break; 198 default: 199 jj_la1[2] = jj_gen; 200 break label_2; 201 } 202 jj_consume_token(QUESTIONMARK); 203 Or(); 204 jj_consume_token(COLON); 205 AstChoice jjtn001 = new AstChoice(JJTCHOICE); 206 boolean jjtc001 = true; 207 jjtree.openNodeScope(jjtn001); 208 try { 209 Choice(); 210 } catch (Throwable jjte001) { 211 if (jjtc001) { 212 jjtree.clearNodeScope(jjtn001); 213 jjtc001 = false; 214 } else { 215 jjtree.popNode(); 216 } 217 if (jjte001 instanceof RuntimeException ) { 218 {if (true) throw (RuntimeException )jjte001;} 219 } 220 if (jjte001 instanceof ParseException) { 221 {if (true) throw (ParseException)jjte001;} 222 } 223 {if (true) throw (Error )jjte001;} 224 } finally { 225 if (jjtc001) { 226 jjtree.closeNodeScope(jjtn001, 3); 227 } 228 } 229 } 230 } 231 232 236 final public void Or() throws ParseException { 237 And(); 238 label_3: 239 while (true) { 240 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 241 case OR0: 242 case OR1: 243 ; 244 break; 245 default: 246 jj_la1[3] = jj_gen; 247 break label_3; 248 } 249 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 250 case OR0: 251 jj_consume_token(OR0); 252 break; 253 case OR1: 254 jj_consume_token(OR1); 255 break; 256 default: 257 jj_la1[4] = jj_gen; 258 jj_consume_token(-1); 259 throw new ParseException(); 260 } 261 AstOr jjtn001 = new AstOr(JJTOR); 262 boolean jjtc001 = true; 263 jjtree.openNodeScope(jjtn001); 264 try { 265 And(); 266 } catch (Throwable jjte001) { 267 if (jjtc001) { 268 jjtree.clearNodeScope(jjtn001); 269 jjtc001 = false; 270 } else { 271 jjtree.popNode(); 272 } 273 if (jjte001 instanceof RuntimeException ) { 274 {if (true) throw (RuntimeException )jjte001;} 275 } 276 if (jjte001 instanceof ParseException) { 277 {if (true) throw (ParseException)jjte001;} 278 } 279 {if (true) throw (Error )jjte001;} 280 } finally { 281 if (jjtc001) { 282 jjtree.closeNodeScope(jjtn001, 2); 283 } 284 } 285 } 286 } 287 288 292 final public void And() throws ParseException { 293 Equality(); 294 label_4: 295 while (true) { 296 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 297 case AND0: 298 case AND1: 299 ; 300 break; 301 default: 302 jj_la1[5] = jj_gen; 303 break label_4; 304 } 305 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 306 case AND0: 307 jj_consume_token(AND0); 308 break; 309 case AND1: 310 jj_consume_token(AND1); 311 break; 312 default: 313 jj_la1[6] = jj_gen; 314 jj_consume_token(-1); 315 throw new ParseException(); 316 } 317 AstAnd jjtn001 = new AstAnd(JJTAND); 318 boolean jjtc001 = true; 319 jjtree.openNodeScope(jjtn001); 320 try { 321 Equality(); 322 } catch (Throwable jjte001) { 323 if (jjtc001) { 324 jjtree.clearNodeScope(jjtn001); 325 jjtc001 = false; 326 } else { 327 jjtree.popNode(); 328 } 329 if (jjte001 instanceof RuntimeException ) { 330 {if (true) throw (RuntimeException )jjte001;} 331 } 332 if (jjte001 instanceof ParseException) { 333 {if (true) throw (ParseException)jjte001;} 334 } 335 {if (true) throw (Error )jjte001;} 336 } finally { 337 if (jjtc001) { 338 jjtree.closeNodeScope(jjtn001, 2); 339 } 340 } 341 } 342 } 343 344 348 final public void Equality() throws ParseException { 349 Compare(); 350 label_5: 351 while (true) { 352 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 353 case EQ0: 354 case EQ1: 355 case NE0: 356 case NE1: 357 ; 358 break; 359 default: 360 jj_la1[7] = jj_gen; 361 break label_5; 362 } 363 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 364 case EQ0: 365 case EQ1: 366 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 367 case EQ0: 368 jj_consume_token(EQ0); 369 break; 370 case EQ1: 371 jj_consume_token(EQ1); 372 break; 373 default: 374 jj_la1[8] = jj_gen; 375 jj_consume_token(-1); 376 throw new ParseException(); 377 } 378 AstEqual jjtn001 = new AstEqual(JJTEQUAL); 379 boolean jjtc001 = true; 380 jjtree.openNodeScope(jjtn001); 381 try { 382 Compare(); 383 } catch (Throwable jjte001) { 384 if (jjtc001) { 385 jjtree.clearNodeScope(jjtn001); 386 jjtc001 = false; 387 } else { 388 jjtree.popNode(); 389 } 390 if (jjte001 instanceof RuntimeException ) { 391 {if (true) throw (RuntimeException )jjte001;} 392 } 393 if (jjte001 instanceof ParseException) { 394 {if (true) throw (ParseException)jjte001;} 395 } 396 {if (true) throw (Error )jjte001;} 397 } finally { 398 if (jjtc001) { 399 jjtree.closeNodeScope(jjtn001, 2); 400 } 401 } 402 break; 403 case NE0: 404 case NE1: 405 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 406 case NE0: 407 jj_consume_token(NE0); 408 break; 409 case NE1: 410 jj_consume_token(NE1); 411 break; 412 default: 413 jj_la1[9] = jj_gen; 414 jj_consume_token(-1); 415 throw new ParseException(); 416 } 417 AstNotEqual jjtn002 = new AstNotEqual(JJTNOTEQUAL); 418 boolean jjtc002 = true; 419 jjtree.openNodeScope(jjtn002); 420 try { 421 Compare(); 422 } catch (Throwable jjte002) { 423 if (jjtc002) { 424 jjtree.clearNodeScope(jjtn002); 425 jjtc002 = false; 426 } else { 427 jjtree.popNode(); 428 } 429 if (jjte002 instanceof RuntimeException ) { 430 {if (true) throw (RuntimeException )jjte002;} 431 } 432 if (jjte002 instanceof ParseException) { 433 {if (true) throw (ParseException)jjte002;} 434 } 435 {if (true) throw (Error )jjte002;} 436 } finally { 437 if (jjtc002) { 438 jjtree.closeNodeScope(jjtn002, 2); 439 } 440 } 441 break; 442 default: 443 jj_la1[10] = jj_gen; 444 jj_consume_token(-1); 445 throw new ParseException(); 446 } 447 } 448 } 449 450 454 final public void Compare() throws ParseException { 455 Math(); 456 label_6: 457 while (true) { 458 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 459 case GT0: 460 case GT1: 461 case LT0: 462 case LT1: 463 case GE0: 464 case GE1: 465 case LE0: 466 case LE1: 467 ; 468 break; 469 default: 470 jj_la1[11] = jj_gen; 471 break label_6; 472 } 473 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 474 case LT0: 475 case LT1: 476 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 477 case LT0: 478 jj_consume_token(LT0); 479 break; 480 case LT1: 481 jj_consume_token(LT1); 482 break; 483 default: 484 jj_la1[12] = jj_gen; 485 jj_consume_token(-1); 486 throw new ParseException(); 487 } 488 AstLessThan jjtn001 = new AstLessThan(JJTLESSTHAN); 489 boolean jjtc001 = true; 490 jjtree.openNodeScope(jjtn001); 491 try { 492 Math(); 493 } catch (Throwable jjte001) { 494 if (jjtc001) { 495 jjtree.clearNodeScope(jjtn001); 496 jjtc001 = false; 497 } else { 498 jjtree.popNode(); 499 } 500 if (jjte001 instanceof RuntimeException ) { 501 {if (true) throw (RuntimeException )jjte001;} 502 } 503 if (jjte001 instanceof ParseException) { 504 {if (true) throw (ParseException)jjte001;} 505 } 506 {if (true) throw (Error )jjte001;} 507 } finally { 508 if (jjtc001) { 509 jjtree.closeNodeScope(jjtn001, 2); 510 } 511 } 512 break; 513 case GT0: 514 case GT1: 515 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 516 case GT0: 517 jj_consume_token(GT0); 518 break; 519 case GT1: 520 jj_consume_token(GT1); 521 break; 522 default: 523 jj_la1[13] = jj_gen; 524 jj_consume_token(-1); 525 throw new ParseException(); 526 } 527 AstGreaterThan jjtn002 = new AstGreaterThan(JJTGREATERTHAN); 528 boolean jjtc002 = true; 529 jjtree.openNodeScope(jjtn002); 530 try { 531 Math(); 532 } catch (Throwable jjte002) { 533 if (jjtc002) { 534 jjtree.clearNodeScope(jjtn002); 535 jjtc002 = false; 536 } else { 537 jjtree.popNode(); 538 } 539 if (jjte002 instanceof RuntimeException ) { 540 {if (true) throw (RuntimeException )jjte002;} 541 } 542 if (jjte002 instanceof ParseException) { 543 {if (true) throw (ParseException)jjte002;} 544 } 545 {if (true) throw (Error )jjte002;} 546 } finally { 547 if (jjtc002) { 548 jjtree.closeNodeScope(jjtn002, 2); 549 } 550 } 551 break; 552 case LE0: 553 case LE1: 554 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 555 case LE0: 556 jj_consume_token(LE0); 557 break; 558 case LE1: 559 jj_consume_token(LE1); 560 break; 561 default: 562 jj_la1[14] = jj_gen; 563 jj_consume_token(-1); 564 throw new ParseException(); 565 } 566 AstLessThanEqual jjtn003 = new AstLessThanEqual(JJTLESSTHANEQUAL); 567 boolean jjtc003 = true; 568 jjtree.openNodeScope(jjtn003); 569 try { 570 Math(); 571 } catch (Throwable jjte003) { 572 if (jjtc003) { 573 jjtree.clearNodeScope(jjtn003); 574 jjtc003 = false; 575 } else { 576 jjtree.popNode(); 577 } 578 if (jjte003 instanceof RuntimeException ) { 579 {if (true) throw (RuntimeException )jjte003;} 580 } 581 if (jjte003 instanceof ParseException) { 582 {if (true) throw (ParseException)jjte003;} 583 } 584 {if (true) throw (Error )jjte003;} 585 } finally { 586 if (jjtc003) { 587 jjtree.closeNodeScope(jjtn003, 2); 588 } 589 } 590 break; 591 case GE0: 592 case GE1: 593 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 594 case GE0: 595 jj_consume_token(GE0); 596 break; 597 case GE1: 598 jj_consume_token(GE1); 599 break; 600 default: 601 jj_la1[15] = jj_gen; 602 jj_consume_token(-1); 603 throw new ParseException(); 604 } 605 AstGreaterThanEqual jjtn004 = new AstGreaterThanEqual(JJTGREATERTHANEQUAL); 606 boolean jjtc004 = true; 607 jjtree.openNodeScope(jjtn004); 608 try { 609 Math(); 610 } catch (Throwable jjte004) { 611 if (jjtc004) { 612 jjtree.clearNodeScope(jjtn004); 613 jjtc004 = false; 614 } else { 615 jjtree.popNode(); 616 } 617 if (jjte004 instanceof RuntimeException ) { 618 {if (true) throw (RuntimeException )jjte004;} 619 } 620 if (jjte004 instanceof ParseException) { 621 {if (true) throw (ParseException)jjte004;} 622 } 623 {if (true) throw (Error )jjte004;} 624 } finally { 625 if (jjtc004) { 626 jjtree.closeNodeScope(jjtn004, 2); 627 } 628 } 629 break; 630 default: 631 jj_la1[16] = jj_gen; 632 jj_consume_token(-1); 633 throw new ParseException(); 634 } 635 } 636 } 637 638 642 final public void Math() throws ParseException { 643 Multiplication(); 644 label_7: 645 while (true) { 646 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 647 case PLUS: 648 case MINUS: 649 ; 650 break; 651 default: 652 jj_la1[17] = jj_gen; 653 break label_7; 654 } 655 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 656 case PLUS: 657 jj_consume_token(PLUS); 658 AstPlus jjtn001 = new AstPlus(JJTPLUS); 659 boolean jjtc001 = true; 660 jjtree.openNodeScope(jjtn001); 661 try { 662 Multiplication(); 663 } catch (Throwable jjte001) { 664 if (jjtc001) { 665 jjtree.clearNodeScope(jjtn001); 666 jjtc001 = false; 667 } else { 668 jjtree.popNode(); 669 } 670 if (jjte001 instanceof RuntimeException ) { 671 {if (true) throw (RuntimeException )jjte001;} 672 } 673 if (jjte001 instanceof ParseException) { 674 {if (true) throw (ParseException)jjte001;} 675 } 676 {if (true) throw (Error )jjte001;} 677 } finally { 678 if (jjtc001) { 679 jjtree.closeNodeScope(jjtn001, 2); 680 } 681 } 682 break; 683 case MINUS: 684 jj_consume_token(MINUS); 685 AstMinus jjtn002 = new AstMinus(JJTMINUS); 686 boolean jjtc002 = true; 687 jjtree.openNodeScope(jjtn002); 688 try { 689 Multiplication(); 690 } catch (Throwable jjte002) { 691 if (jjtc002) { 692 jjtree.clearNodeScope(jjtn002); 693 jjtc002 = false; 694 } else { 695 jjtree.popNode(); 696 } 697 if (jjte002 instanceof RuntimeException ) { 698 {if (true) throw (RuntimeException )jjte002;} 699 } 700 if (jjte002 instanceof ParseException) { 701 {if (true) throw (ParseException)jjte002;} 702 } 703 {if (true) throw (Error )jjte002;} 704 } finally { 705 if (jjtc002) { 706 jjtree.closeNodeScope(jjtn002, 2); 707 } 708 } 709 break; 710 default: 711 jj_la1[18] = jj_gen; 712 jj_consume_token(-1); 713 throw new ParseException(); 714 } 715 } 716 } 717 718 722 final public void Multiplication() throws ParseException { 723 Unary(); 724 label_8: 725 while (true) { 726 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 727 case MULT: 728 case DIV0: 729 case DIV1: 730 case MOD0: 731 case MOD1: 732 ; 733 break; 734 default: 735 jj_la1[19] = jj_gen; 736 break label_8; 737 } 738 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 739 case MULT: 740 jj_consume_token(MULT); 741 AstMult jjtn001 = new AstMult(JJTMULT); 742 boolean jjtc001 = true; 743 jjtree.openNodeScope(jjtn001); 744 try { 745 Unary(); 746 } catch (Throwable jjte001) { 747 if (jjtc001) { 748 jjtree.clearNodeScope(jjtn001); 749 jjtc001 = false; 750 } else { 751 jjtree.popNode(); 752 } 753 if (jjte001 instanceof RuntimeException ) { 754 {if (true) throw (RuntimeException )jjte001;} 755 } 756 if (jjte001 instanceof ParseException) { 757 {if (true) throw (ParseException)jjte001;} 758 } 759 {if (true) throw (Error )jjte001;} 760 } finally { 761 if (jjtc001) { 762 jjtree.closeNodeScope(jjtn001, 2); 763 } 764 } 765 break; 766 case DIV0: 767 case DIV1: 768 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 769 case DIV0: 770 jj_consume_token(DIV0); 771 break; 772 case DIV1: 773 jj_consume_token(DIV1); 774 break; 775 default: 776 jj_la1[20] = jj_gen; 777 jj_consume_token(-1); 778 throw new ParseException(); 779 } 780 AstDiv jjtn002 = new AstDiv(JJTDIV); 781 boolean jjtc002 = true; 782 jjtree.openNodeScope(jjtn002); 783 try { 784 Unary(); 785 } catch (Throwable jjte002) { 786 if (jjtc002) { 787 jjtree.clearNodeScope(jjtn002); 788 jjtc002 = false; 789 } else { 790 jjtree.popNode(); 791 } 792 if (jjte002 instanceof RuntimeException ) { 793 {if (true) throw (RuntimeException )jjte002;} 794 } 795 if (jjte002 instanceof ParseException) { 796 {if (true) throw (ParseException)jjte002;} 797 } 798 {if (true) throw (Error )jjte002;} 799 } finally { 800 if (jjtc002) { 801 jjtree.closeNodeScope(jjtn002, 2); 802 } 803 } 804 break; 805 case MOD0: 806 case MOD1: 807 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 808 case MOD0: 809 jj_consume_token(MOD0); 810 break; 811 case MOD1: 812 jj_consume_token(MOD1); 813 break; 814 default: 815 jj_la1[21] = jj_gen; 816 jj_consume_token(-1); 817 throw new ParseException(); 818 } 819 AstMod jjtn003 = new AstMod(JJTMOD); 820 boolean jjtc003 = true; 821 jjtree.openNodeScope(jjtn003); 822 try { 823 Unary(); 824 } catch (Throwable jjte003) { 825 if (jjtc003) { 826 jjtree.clearNodeScope(jjtn003); 827 jjtc003 = false; 828 } else { 829 jjtree.popNode(); 830 } 831 if (jjte003 instanceof RuntimeException ) { 832 {if (true) throw (RuntimeException )jjte003;} 833 } 834 if (jjte003 instanceof ParseException) { 835 {if (true) throw (ParseException)jjte003;} 836 } 837 {if (true) throw (Error )jjte003;} 838 } finally { 839 if (jjtc003) { 840 jjtree.closeNodeScope(jjtn003, 2); 841 } 842 } 843 break; 844 default: 845 jj_la1[22] = jj_gen; 846 jj_consume_token(-1); 847 throw new ParseException(); 848 } 849 } 850 } 851 852 856 final public void Unary() throws ParseException { 857 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 858 case MINUS: 859 jj_consume_token(MINUS); 860 AstNegative jjtn001 = new AstNegative(JJTNEGATIVE); 861 boolean jjtc001 = true; 862 jjtree.openNodeScope(jjtn001); 863 try { 864 Unary(); 865 } catch (Throwable jjte001) { 866 if (jjtc001) { 867 jjtree.clearNodeScope(jjtn001); 868 jjtc001 = false; 869 } else { 870 jjtree.popNode(); 871 } 872 if (jjte001 instanceof RuntimeException ) { 873 {if (true) throw (RuntimeException )jjte001;} 874 } 875 if (jjte001 instanceof ParseException) { 876 {if (true) throw (ParseException)jjte001;} 877 } 878 {if (true) throw (Error )jjte001;} 879 } finally { 880 if (jjtc001) { 881 jjtree.closeNodeScope(jjtn001, true); 882 } 883 } 884 break; 885 case NOT0: 886 case NOT1: 887 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 888 case NOT0: 889 jj_consume_token(NOT0); 890 break; 891 case NOT1: 892 jj_consume_token(NOT1); 893 break; 894 default: 895 jj_la1[23] = jj_gen; 896 jj_consume_token(-1); 897 throw new ParseException(); 898 } 899 AstNot jjtn002 = new AstNot(JJTNOT); 900 boolean jjtc002 = true; 901 jjtree.openNodeScope(jjtn002); 902 try { 903 Unary(); 904 } catch (Throwable jjte002) { 905 if (jjtc002) { 906 jjtree.clearNodeScope(jjtn002); 907 jjtc002 = false; 908 } else { 909 jjtree.popNode(); 910 } 911 if (jjte002 instanceof RuntimeException ) { 912 {if (true) throw (RuntimeException )jjte002;} 913 } 914 if (jjte002 instanceof ParseException) { 915 {if (true) throw (ParseException)jjte002;} 916 } 917 {if (true) throw (Error )jjte002;} 918 } finally { 919 if (jjtc002) { 920 jjtree.closeNodeScope(jjtn002, true); 921 } 922 } 923 break; 924 case EMPTY: 925 jj_consume_token(EMPTY); 926 AstEmpty jjtn003 = new AstEmpty(JJTEMPTY); 927 boolean jjtc003 = true; 928 jjtree.openNodeScope(jjtn003); 929 try { 930 Unary(); 931 } catch (Throwable jjte003) { 932 if (jjtc003) { 933 jjtree.clearNodeScope(jjtn003); 934 jjtc003 = false; 935 } else { 936 jjtree.popNode(); 937 } 938 if (jjte003 instanceof RuntimeException ) { 939 {if (true) throw (RuntimeException )jjte003;} 940 } 941 if (jjte003 instanceof ParseException) { 942 {if (true) throw (ParseException)jjte003;} 943 } 944 {if (true) throw (Error )jjte003;} 945 } finally { 946 if (jjtc003) { 947 jjtree.closeNodeScope(jjtn003, true); 948 } 949 } 950 break; 951 case INTEGER_LITERAL: 952 case FLOATING_POINT_LITERAL: 953 case STRING_LITERAL: 954 case TRUE: 955 case FALSE: 956 case NULL: 957 case LPAREN: 958 case IDENTIFIER: 959 case NAMESPACE: 960 Value(); 961 break; 962 default: 963 jj_la1[24] = jj_gen; 964 jj_consume_token(-1); 965 throw new ParseException(); 966 } 967 } 968 969 973 final public void Value() throws ParseException { 974 AstValue jjtn001 = new AstValue(JJTVALUE); 975 boolean jjtc001 = true; 976 jjtree.openNodeScope(jjtn001); 977 try { 978 ValuePrefix(); 979 label_9: 980 while (true) { 981 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 982 case DOT: 983 case LBRACK: 984 ; 985 break; 986 default: 987 jj_la1[25] = jj_gen; 988 break label_9; 989 } 990 ValueSuffix(); 991 } 992 } catch (Throwable jjte001) { 993 if (jjtc001) { 994 jjtree.clearNodeScope(jjtn001); 995 jjtc001 = false; 996 } else { 997 jjtree.popNode(); 998 } 999 if (jjte001 instanceof RuntimeException ) { 1000 {if (true) throw (RuntimeException )jjte001;} 1001 } 1002 if (jjte001 instanceof ParseException) { 1003 {if (true) throw (ParseException)jjte001;} 1004 } 1005 {if (true) throw (Error )jjte001;} 1006 } finally { 1007 if (jjtc001) { 1008 jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); 1009 } 1010 } 1011 } 1012 1013 1017 final public void ValuePrefix() throws ParseException { 1018 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1019 case INTEGER_LITERAL: 1020 case FLOATING_POINT_LITERAL: 1021 case STRING_LITERAL: 1022 case TRUE: 1023 case FALSE: 1024 case NULL: 1025 Literal(); 1026 break; 1027 case LPAREN: 1028 case IDENTIFIER: 1029 case NAMESPACE: 1030 NonLiteral(); 1031 break; 1032 default: 1033 jj_la1[26] = jj_gen; 1034 jj_consume_token(-1); 1035 throw new ParseException(); 1036 } 1037 } 1038 1039 1043 final public void ValueSuffix() throws ParseException { 1044 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1045 case DOT: 1046 DotSuffix(); 1047 break; 1048 case LBRACK: 1049 BracketSuffix(); 1050 break; 1051 default: 1052 jj_la1[27] = jj_gen; 1053 jj_consume_token(-1); 1054 throw new ParseException(); 1055 } 1056 } 1057 1058 1062 final public void DotSuffix() throws ParseException { 1063 1064 AstDotSuffix jjtn000 = new AstDotSuffix(JJTDOTSUFFIX); 1065 boolean jjtc000 = true; 1066 jjtree.openNodeScope(jjtn000);Token t = null; 1067 try { 1068 jj_consume_token(DOT); 1069 t = jj_consume_token(IDENTIFIER); 1070 jjtree.closeNodeScope(jjtn000, true); 1071 jjtc000 = false; 1072 jjtn000.setImage(t.image); 1073 } finally { 1074 if (jjtc000) { 1075 jjtree.closeNodeScope(jjtn000, true); 1076 } 1077 } 1078 } 1079 1080 1084 final public void BracketSuffix() throws ParseException { 1085 1086 AstBracketSuffix jjtn000 = new AstBracketSuffix(JJTBRACKETSUFFIX); 1087 boolean jjtc000 = true; 1088 jjtree.openNodeScope(jjtn000); 1089 try { 1090 jj_consume_token(LBRACK); 1091 Expression(); 1092 jj_consume_token(RBRACK); 1093 } catch (Throwable jjte000) { 1094 if (jjtc000) { 1095 jjtree.clearNodeScope(jjtn000); 1096 jjtc000 = false; 1097 } else { 1098 jjtree.popNode(); 1099 } 1100 if (jjte000 instanceof RuntimeException ) { 1101 {if (true) throw (RuntimeException )jjte000;} 1102 } 1103 if (jjte000 instanceof ParseException) { 1104 {if (true) throw (ParseException)jjte000;} 1105 } 1106 {if (true) throw (Error )jjte000;} 1107 } finally { 1108 if (jjtc000) { 1109 jjtree.closeNodeScope(jjtn000, true); 1110 } 1111 } 1112 } 1113 1114 1118 final public void NonLiteral() throws ParseException { 1119 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1120 case LPAREN: 1121 jj_consume_token(LPAREN); 1122 Expression(); 1123 jj_consume_token(RPAREN); 1124 break; 1125 default: 1126 jj_la1[28] = jj_gen; 1127 if (jj_2_1(3)) { 1128 Function(); 1129 } else { 1130 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1131 case IDENTIFIER: 1132 Identifier(); 1133 break; 1134 default: 1135 jj_la1[29] = jj_gen; 1136 jj_consume_token(-1); 1137 throw new ParseException(); 1138 } 1139 } 1140 } 1141 } 1142 1143 1147 final public void Identifier() throws ParseException { 1148 1149 AstIdentifier jjtn000 = new AstIdentifier(JJTIDENTIFIER); 1150 boolean jjtc000 = true; 1151 jjtree.openNodeScope(jjtn000);Token t = null; 1152 try { 1153 t = jj_consume_token(IDENTIFIER); 1154 jjtree.closeNodeScope(jjtn000, true); 1155 jjtc000 = false; 1156 jjtn000.setImage(t.image); 1157 } finally { 1158 if (jjtc000) { 1159 jjtree.closeNodeScope(jjtn000, true); 1160 } 1161 } 1162 } 1163 1164 1168 final public void Function() throws ParseException { 1169 1170 AstFunction jjtn000 = new AstFunction(JJTFUNCTION); 1171 boolean jjtc000 = true; 1172 jjtree.openNodeScope(jjtn000);Token t0 = null; 1173 Token t1 = null; 1174 try { 1175 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1176 case NAMESPACE: 1177 t0 = jj_consume_token(NAMESPACE); 1178 break; 1179 default: 1180 jj_la1[30] = jj_gen; 1181 ; 1182 } 1183 t1 = jj_consume_token(IDENTIFIER); 1184 if (t0 != null) { 1185 jjtn000.setPrefix(t0.image.substring(0, t0.image.length() - 1)); 1186 jjtn000.setLocalName(t1.image); 1187 } else { 1188 jjtn000.setLocalName(t1.image); 1189 } 1190 jj_consume_token(LPAREN); 1191 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1192 case INTEGER_LITERAL: 1193 case FLOATING_POINT_LITERAL: 1194 case STRING_LITERAL: 1195 case TRUE: 1196 case FALSE: 1197 case NULL: 1198 case LPAREN: 1199 case NOT0: 1200 case NOT1: 1201 case EMPTY: 1202 case MINUS: 1203 case IDENTIFIER: 1204 case NAMESPACE: 1205 Expression(); 1206 label_10: 1207 while (true) { 1208 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1209 case COMMA: 1210 ; 1211 break; 1212 default: 1213 jj_la1[31] = jj_gen; 1214 break label_10; 1215 } 1216 jj_consume_token(COMMA); 1217 Expression(); 1218 } 1219 break; 1220 default: 1221 jj_la1[32] = jj_gen; 1222 ; 1223 } 1224 jj_consume_token(RPAREN); 1225 } catch (Throwable jjte000) { 1226 if (jjtc000) { 1227 jjtree.clearNodeScope(jjtn000); 1228 jjtc000 = false; 1229 } else { 1230 jjtree.popNode(); 1231 } 1232 if (jjte000 instanceof RuntimeException ) { 1233 {if (true) throw (RuntimeException )jjte000;} 1234 } 1235 if (jjte000 instanceof ParseException) { 1236 {if (true) throw (ParseException)jjte000;} 1237 } 1238 {if (true) throw (Error )jjte000;} 1239 } finally { 1240 if (jjtc000) { 1241 jjtree.closeNodeScope(jjtn000, true); 1242 } 1243 } 1244 } 1245 1246 1250 final public void Literal() throws ParseException { 1251 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1252 case TRUE: 1253 case FALSE: 1254 Boolean(); 1255 break; 1256 case FLOATING_POINT_LITERAL: 1257 FloatingPoint(); 1258 break; 1259 case INTEGER_LITERAL: 1260 Integer(); 1261 break; 1262 case STRING_LITERAL: 1263 String(); 1264 break; 1265 case NULL: 1266 Null(); 1267 break; 1268 default: 1269 jj_la1[33] = jj_gen; 1270 jj_consume_token(-1); 1271 throw new ParseException(); 1272 } 1273 } 1274 1275 1279 final public void Boolean() throws ParseException { 1280 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 1281 case TRUE: 1282 AstTrue jjtn001 = new AstTrue(JJTTRUE); 1283 boolean jjtc001 = true; 1284 jjtree.openNodeScope(jjtn001); 1285 try { 1286 jj_consume_token(TRUE); 1287 } finally { 1288 if (jjtc001) { 1289 jjtree.closeNodeScope(jjtn001, true); 1290 } 1291 } 1292 break; 1293 case FALSE: 1294 AstFalse jjtn002 = new AstFalse(JJTFALSE); 1295 boolean jjtc002 = true; 1296 jjtree.openNodeScope(jjtn002); 1297 try { 1298 jj_consume_token(FALSE); 1299 } finally { 1300 if (jjtc002) { 1301 jjtree.closeNodeScope(jjtn002, true); 1302 } 1303 } 1304 break; 1305 default: 1306 jj_la1[34] = jj_gen; 1307 jj_consume_token(-1); 1308 throw new ParseException(); 1309 } 1310 } 1311 1312 1316 final public void FloatingPoint() throws ParseException { 1317 1318 AstFloatingPoint jjtn000 = new AstFloatingPoint(JJTFLOATINGPOINT); 1319 boolean jjtc000 = true; 1320 jjtree.openNodeScope(jjtn000);Token t = null; 1321 try { 1322 t = jj_consume_token(FLOATING_POINT_LITERAL); 1323 jjtree.closeNodeScope(jjtn000, true); 1324 jjtc000 = false; 1325 jjtn000.setImage(t.image); 1326 } finally { 1327 if (jjtc000) { 1328 jjtree.closeNodeScope(jjtn000, true); 1329 } 1330 } 1331 } 1332 1333 1337 final public void Integer() throws ParseException { 1338 1339 AstInteger jjtn000 = new AstInteger(JJTINTEGER); 1340 boolean jjtc000 = true; 1341 jjtree.openNodeScope(jjtn000);Token t = null; 1342 try { 1343 t = jj_consume_token(INTEGER_LITERAL); 1344 jjtree.closeNodeScope(jjtn000, true); 1345 jjtc000 = false; 1346 jjtn000.setImage(t.image); 1347 } finally { 1348 if (jjtc000) { 1349 jjtree.closeNodeScope(jjtn000, true); 1350 } 1351 } 1352 } 1353 1354 1358 final public void String() throws ParseException { 1359 1360 AstString jjtn000 = new AstString(JJTSTRING); 1361 boolean jjtc000 = true; 1362 jjtree.openNodeScope(jjtn000);Token t = null; 1363 try { 1364 t = jj_consume_token(STRING_LITERAL); 1365 jjtree.closeNodeScope(jjtn000, true); 1366 jjtc000 = false; 1367 jjtn000.setImage(t.image); 1368 } finally { 1369 if (jjtc000) { 1370 jjtree.closeNodeScope(jjtn000, true); 1371 } 1372 } 1373 } 1374 1375 1379 final public void Null() throws ParseException { 1380 1381 AstNull jjtn000 = new AstNull(JJTNULL); 1382 boolean jjtc000 = true; 1383 jjtree.openNodeScope(jjtn000); 1384 try { 1385 jj_consume_token(NULL); 1386 } finally { 1387 if (jjtc000) { 1388 jjtree.closeNodeScope(jjtn000, true); 1389 } 1390 } 1391 } 1392 1393 final private boolean jj_2_1(int xla) { 1394 jj_la = xla; jj_lastpos = jj_scanpos = token; 1395 try { return !jj_3_1(); } 1396 catch(LookaheadSuccess ls) { return true; } 1397 finally { jj_save(0, xla); } 1398 } 1399 1400 final private boolean jj_3R_11() { 1401 Token xsp; 1402 xsp = jj_scanpos; 1403 if (jj_scan_token(54)) jj_scanpos = xsp; 1404 if (jj_scan_token(IDENTIFIER)) return true; 1405 if (jj_scan_token(LPAREN)) return true; 1406 xsp = jj_scanpos; 1407 if (jj_3R_12()) jj_scanpos = xsp; 1408 if (jj_scan_token(RPAREN)) return true; 1409 return false; 1410 } 1411 1412 final private boolean jj_3R_20() { 1413 if (jj_3R_21()) return true; 1414 return false; 1415 } 1416 1417 final private boolean jj_3R_44() { 1418 if (jj_scan_token(IDENTIFIER)) return true; 1419 return false; 1420 } 1421 1422 final private boolean jj_3R_19() { 1423 if (jj_3R_20()) return true; 1424 return false; 1425 } 1426 1427 final private boolean jj_3R_38() { 1428 if (jj_3R_44()) return true; 1429 return false; 1430 } 1431 1432 final private boolean jj_3_1() { 1433 if (jj_3R_11()) return true; 1434 return false; 1435 } 1436 1437 final private boolean jj_3R_31() { 1438 Token xsp; 1439 xsp = jj_scanpos; 1440 if (jj_3R_37()) { 1441 jj_scanpos = xsp; 1442 if (jj_3_1()) { 1443 jj_scanpos = xsp; 1444 if (jj_3R_38()) return true; 1445 } 1446 } 1447 return false; 1448 } 1449 1450 final private boolean jj_3R_37() { 1451 if (jj_scan_token(LPAREN)) return true; 1452 return false; 1453 } 1454 1455 final private boolean jj_3R_43() { 1456 if (jj_scan_token(NULL)) return true; 1457 return false; 1458 } 1459 1460 final private boolean jj_3R_42() { 1461 if (jj_scan_token(STRING_LITERAL)) return true; 1462 return false; 1463 } 1464 1465 final private boolean jj_3R_18() { 1466 if (jj_3R_19()) return true; 1467 return false; 1468 } 1469 1470 final private boolean jj_3R_41() { 1471 if (jj_scan_token(INTEGER_LITERAL)) return true; 1472 return false; 1473 } 1474 1475 final private boolean jj_3R_17() { 1476 if (jj_3R_18()) return true; 1477 return false; 1478 } 1479 1480 final private boolean jj_3R_40() { 1481 if (jj_scan_token(FLOATING_POINT_LITERAL)) return true; 1482 return false; 1483 } 1484 1485 final private boolean jj_3R_29() { 1486 if (jj_3R_31()) return true; 1487 return false; 1488 } 1489 1490 final private boolean jj_3R_46() { 1491 if (jj_scan_token(FALSE)) return true; 1492 return false; 1493 } 1494 1495 final private boolean jj_3R_16() { 1496 if (jj_3R_17()) return true; 1497 return false; 1498 } 1499 1500 final private boolean jj_3R_27() { 1501 Token xsp; 1502 xsp = jj_scanpos; 1503 if (jj_3R_28()) { 1504 jj_scanpos = xsp; 1505 if (jj_3R_29()) return true; 1506 } 1507 return false; 1508 } 1509 1510 final private boolean jj_3R_28() { 1511 if (jj_3R_30()) return true; 1512 return false; 1513 } 1514 1515 final private boolean jj_3R_45() { 1516 if (jj_scan_token(TRUE)) return true; 1517 return false; 1518 } 1519 1520 final private boolean jj_3R_39() { 1521 Token xsp; 1522 xsp = jj_scanpos; 1523 if (jj_3R_45()) { 1524 jj_scanpos = xsp; 1525 if (jj_3R_46()) return true; 1526 } 1527 return false; 1528 } 1529 1530 final private boolean jj_3R_15() { 1531 if (jj_3R_16()) return true; 1532 return false; 1533 } 1534 1535 final private boolean jj_3R_26() { 1536 if (jj_3R_27()) return true; 1537 return false; 1538 } 1539 1540 final private boolean jj_3R_25() { 1541 if (jj_3R_26()) return true; 1542 return false; 1543 } 1544 1545 final private boolean jj_3R_36() { 1546 if (jj_3R_43()) return true; 1547 return false; 1548 } 1549 1550 final private boolean jj_3R_35() { 1551 if (jj_3R_42()) return true; 1552 return false; 1553 } 1554 1555 final private boolean jj_3R_24() { 1556 if (jj_scan_token(EMPTY)) return true; 1557 return false; 1558 } 1559 1560 final private boolean jj_3R_34() { 1561 if (jj_3R_41()) return true; 1562 return false; 1563 } 1564 1565 final private boolean jj_3R_33() { 1566 if (jj_3R_40()) return true; 1567 return false; 1568 } 1569 1570 final private boolean jj_3R_23() { 1571 Token xsp; 1572 xsp = jj_scanpos; 1573 if (jj_scan_token(37)) { 1574 jj_scanpos = xsp; 1575 if (jj_scan_token(38)) return true; 1576 } 1577 return false; 1578 } 1579 1580 final private boolean jj_3R_12() { 1581 if (jj_3R_13()) return true; 1582 return false; 1583 } 1584 1585 final private boolean jj_3R_22() { 1586 if (jj_scan_token(MINUS)) return true; 1587 return false; 1588 } 1589 1590 final private boolean jj_3R_21() { 1591 Token xsp; 1592 xsp = jj_scanpos; 1593 if (jj_3R_22()) { 1594 jj_scanpos = xsp; 1595 if (jj_3R_23()) { 1596 jj_scanpos = xsp; 1597 if (jj_3R_24()) { 1598 jj_scanpos = xsp; 1599 if (jj_3R_25()) return true; 1600 } 1601 } 1602 } 1603 return false; 1604 } 1605 1606 final private boolean jj_3R_30() { 1607 Token xsp; 1608 xsp = jj_scanpos; 1609 if (jj_3R_32()) { 1610 jj_scanpos = xsp; 1611 if (jj_3R_33()) { 1612 jj_scanpos = xsp; 1613 if (jj_3R_34()) { 1614 jj_scanpos = xsp; 1615 if (jj_3R_35()) { 1616 jj_scanpos = xsp; 1617 if (jj_3R_36()) return true; 1618 } 1619 } 1620 } 1621 } 1622 return false; 1623 } 1624 1625 final private boolean jj_3R_32() { 1626 if (jj_3R_39()) return true; 1627 return false; 1628 } 1629 1630 final private boolean jj_3R_14() { 1631 if (jj_3R_15()) return true; 1632 return false; 1633 } 1634 1635 final private boolean jj_3R_13() { 1636 if (jj_3R_14()) return true; 1637 return false; 1638 } 1639 1640 public ELParserTokenManager token_source; 1641 SimpleCharStream jj_input_stream; 1642 public Token token, jj_nt; 1643 private int jj_ntk; 1644 private Token jj_scanpos, jj_lastpos; 1645 private int jj_la; 1646 public boolean lookingAhead = false; 1647 private boolean jj_semLA; 1648 private int jj_gen; 1649 final private int[] jj_la1 = new int[35]; 1650 static private int[] jj_la1_0; 1651 static private int[] jj_la1_1; 1652 static { 1653 jj_la1_0(); 1654 jj_la1_1(); 1655 } 1656 private static void jj_la1_0() { 1657 jj_la1_0 = new int[] {0xe,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfe000000,0x18000000,0x6000000,0x80000000,0x60000000,0xfe000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9d600,0x240000,0x9d600,0x240000,0x80000,0x0,0x0,0x1000000,0x9d600,0x1d600,0xc000,}; 1658 } 1659 private static void jj_la1_1() { 1660 jj_la1_1 = new int[] {0x0,0x0,0x10000,0x600,0x600,0x180,0x180,0x1e,0x6,0x18,0x1e,0x1,0x0,0x0,0x1,0x0,0x1,0xc000,0xc000,0x1e2000,0x60000,0x180000,0x1e2000,0x60,0x608860,0x0,0x600000,0x0,0x0,0x200000,0x400000,0x0,0x608860,0x0,0x0,}; 1661 } 1662 final private JJCalls[] jj_2_rtns = new JJCalls[1]; 1663 private boolean jj_rescan = false; 1664 private int jj_gc = 0; 1665 1666 public ELParser(java.io.InputStream stream) { 1667 this(stream, null); 1668 } 1669 public ELParser(java.io.InputStream stream, String encoding) { 1670 try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException (e); } 1671 token_source = new ELParserTokenManager(jj_input_stream); 1672 token = new Token(); 1673 jj_ntk = -1; 1674 jj_gen = 0; 1675 for (int i = 0; i < 35; i++) jj_la1[i] = -1; 1676 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1677 } 1678 1679 public void ReInit(java.io.InputStream stream) { 1680 ReInit(stream, null); 1681 } 1682 public void ReInit(java.io.InputStream stream, String encoding) { 1683 try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException (e); } 1684 token_source.ReInit(jj_input_stream); 1685 token = new Token(); 1686 jj_ntk = -1; 1687 jjtree.reset(); 1688 jj_gen = 0; 1689 for (int i = 0; i < 35; i++) jj_la1[i] = -1; 1690 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1691 } 1692 1693 public ELParser(java.io.Reader stream) { 1694 jj_input_stream = new SimpleCharStream(stream, 1, 1); 1695 token_source = new ELParserTokenManager(jj_input_stream); 1696 token = new Token(); 1697 jj_ntk = -1; 1698 jj_gen = 0; 1699 for (int i = 0; i < 35; i++) jj_la1[i] = -1; 1700 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1701 } 1702 1703 public void ReInit(java.io.Reader stream) { 1704 jj_input_stream.ReInit(stream, 1, 1); 1705 token_source.ReInit(jj_input_stream); 1706 token = new Token(); 1707 jj_ntk = -1; 1708 jjtree.reset(); 1709 jj_gen = 0; 1710 for (int i = 0; i < 35; i++) jj_la1[i] = -1; 1711 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1712 } 1713 1714 public ELParser(ELParserTokenManager tm) { 1715 token_source = tm; 1716 token = new Token(); 1717 jj_ntk = -1; 1718 jj_gen = 0; 1719 for (int i = 0; i < 35; i++) jj_la1[i] = -1; 1720 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1721 } 1722 1723 public void ReInit(ELParserTokenManager tm) { 1724 token_source = tm; 1725 token = new Token(); 1726 jj_ntk = -1; 1727 jjtree.reset(); 1728 jj_gen = 0; 1729 for (int i = 0; i < 35; i++) jj_la1[i] = -1; 1730 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1731 } 1732 1733 final private Token jj_consume_token(int kind) throws ParseException { 1734 Token oldToken; 1735 if ((oldToken = token).next != null) token = token.next; 1736 else token = token.next = token_source.getNextToken(); 1737 jj_ntk = -1; 1738 if (token.kind == kind) { 1739 jj_gen++; 1740 if (++jj_gc > 100) { 1741 jj_gc = 0; 1742 for (int i = 0; i < jj_2_rtns.length; i++) { 1743 JJCalls c = jj_2_rtns[i]; 1744 while (c != null) { 1745 if (c.gen < jj_gen) c.first = null; 1746 c = c.next; 1747 } 1748 } 1749 } 1750 return token; 1751 } 1752 token = oldToken; 1753 jj_kind = kind; 1754 throw generateParseException(); 1755 } 1756 1757 static private final class LookaheadSuccess extends java.lang.Error { } 1758 final private LookaheadSuccess jj_ls = new LookaheadSuccess(); 1759 final private boolean jj_scan_token(int kind) { 1760 if (jj_scanpos == jj_lastpos) { 1761 jj_la--; 1762 if (jj_scanpos.next == null) { 1763 jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); 1764 } else { 1765 jj_lastpos = jj_scanpos = jj_scanpos.next; 1766 } 1767 } else { 1768 jj_scanpos = jj_scanpos.next; 1769 } 1770 if (jj_rescan) { 1771 int i = 0; Token tok = token; 1772 while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } 1773 if (tok != null) jj_add_error_token(kind, i); 1774 } 1775 if (jj_scanpos.kind != kind) return true; 1776 if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; 1777 return false; 1778 } 1779 1780 final public Token getNextToken() { 1781 if (token.next != null) token = token.next; 1782 else token = token.next = token_source.getNextToken(); 1783 jj_ntk = -1; 1784 jj_gen++; 1785 return token; 1786 } 1787 1788 final public Token getToken(int index) { 1789 Token t = lookingAhead ? jj_scanpos : token; 1790 for (int i = 0; i < index; i++) { 1791 if (t.next != null) t = t.next; 1792 else t = t.next = token_source.getNextToken(); 1793 } 1794 return t; 1795 } 1796 1797 final private int jj_ntk() { 1798 if ((jj_nt=token.next) == null) 1799 return (jj_ntk = (token.next=token_source.getNextToken()).kind); 1800 else 1801 return (jj_ntk = jj_nt.kind); 1802 } 1803 1804 private java.util.Vector jj_expentries = new java.util.Vector (); 1805 private int[] jj_expentry; 1806 private int jj_kind = -1; 1807 private int[] jj_lasttokens = new int[100]; 1808 private int jj_endpos; 1809 1810 private void jj_add_error_token(int kind, int pos) { 1811 if (pos >= 100) return; 1812 if (pos == jj_endpos + 1) { 1813 jj_lasttokens[jj_endpos++] = kind; 1814 } else if (jj_endpos != 0) { 1815 jj_expentry = new int[jj_endpos]; 1816 for (int i = 0; i < jj_endpos; i++) { 1817 jj_expentry[i] = jj_lasttokens[i]; 1818 } 1819 boolean exists = false; 1820 for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) { 1821 int[] oldentry = (int[])(e.nextElement()); 1822 if (oldentry.length == jj_expentry.length) { 1823 exists = true; 1824 for (int i = 0; i < jj_expentry.length; i++) { 1825 if (oldentry[i] != jj_expentry[i]) { 1826 exists = false; 1827 break; 1828 } 1829 } 1830 if (exists) break; 1831 } 1832 } 1833 if (!exists) jj_expentries.addElement(jj_expentry); 1834 if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; 1835 } 1836 } 1837 1838 public ParseException generateParseException() { 1839 jj_expentries.removeAllElements(); 1840 boolean[] la1tokens = new boolean[60]; 1841 for (int i = 0; i < 60; i++) { 1842 la1tokens[i] = false; 1843 } 1844 if (jj_kind >= 0) { 1845 la1tokens[jj_kind] = true; 1846 jj_kind = -1; 1847 } 1848 for (int i = 0; i < 35; i++) { 1849 if (jj_la1[i] == jj_gen) { 1850 for (int j = 0; j < 32; j++) { 1851 if ((jj_la1_0[i] & (1<<j)) != 0) { 1852 la1tokens[j] = true; 1853 } 1854 if ((jj_la1_1[i] & (1<<j)) != 0) { 1855 la1tokens[32+j] = true; 1856 } 1857 } 1858 } 1859 } 1860 for (int i = 0; i < 60; i++) { 1861 if (la1tokens[i]) { 1862 jj_expentry = new int[1]; 1863 jj_expentry[0] = i; 1864 jj_expentries.addElement(jj_expentry); 1865 } 1866 } 1867 jj_endpos = 0; 1868 jj_rescan_token(); 1869 jj_add_error_token(0, 0); 1870 int[][] exptokseq = new int[jj_expentries.size()][]; 1871 for (int i = 0; i < jj_expentries.size(); i++) { 1872 exptokseq[i] = (int[])jj_expentries.elementAt(i); 1873 } 1874 return new ParseException(token, exptokseq, tokenImage); 1875 } 1876 1877 final public void enable_tracing() { 1878 } 1879 1880 final public void disable_tracing() { 1881 } 1882 1883 final private void jj_rescan_token() { 1884 jj_rescan = true; 1885 for (int i = 0; i < 1; i++) { 1886 try { 1887 JJCalls p = jj_2_rtns[i]; 1888 do { 1889 if (p.gen > jj_gen) { 1890 jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; 1891 switch (i) { 1892 case 0: jj_3_1(); break; 1893 } 1894 } 1895 p = p.next; 1896 } while (p != null); 1897 } catch(LookaheadSuccess ls) { } 1898 } 1899 jj_rescan = false; 1900 } 1901 1902 final private void jj_save(int index, int xla) { 1903 JJCalls p = jj_2_rtns[index]; 1904 while (p.gen > jj_gen) { 1905 if (p.next == null) { p = p.next = new JJCalls(); break; } 1906 p = p.next; 1907 } 1908 p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; 1909 } 1910 1911 static final class JJCalls { 1912 int gen; 1913 Token first; 1914 int arg; 1915 JJCalls next; 1916 } 1917 1918} 1919 | Popular Tags |