PageRenderTime 211ms CodeModel.GetById 144ms app.highlight 59ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-1-pre5/bsh/Parser.java

#
Java | 2351 lines | 2195 code | 55 blank | 101 comment | 231 complexity | 70b64765b4b240a21d038e25c633aff6 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1/* Generated By:JJTree&JavaCC: Do not edit this line. Parser.java */
   2package bsh;
   3
   4import java.io.*;
   5
   6/**
   7	This is the BeanShell parser.  It is used internally by the Interpreter
   8	class (which is probably what you are looking for).  The parser knows
   9	only how to parse the structure of the language, it does not understand
  10	names, commands, etc.
  11	<p>
  12	You can use the Parser from the command line to do basic structural 
  13	validation of BeanShell files without actually executing them. e.g.
  14	<code><pre>
  15		java bsh.Parser [ -p ] file [ file ] [ ... ]
  16	</pre></code>
  17	<p>
  18	The -p option causes the abstract syntax to be printed.
  19	<p>
  20
  21	From code you'd use the Parser like this:
  22	<p
  23	<code><pre>
  24		Parser parser = new Parser(in);
  25		while( !(eof=parser.Line()) ) {
  26			SimpleNode node = parser.popNode();
  27			// use the node, etc. (See bsh.BSH* classes)
  28		}
  29	</pre></code>
  30*/
  31public class Parser/*@bgen(jjtree)*/implements ParserTreeConstants, ParserConstants {/*@bgen(jjtree)*/
  32  protected JJTParserState jjtree = new JJTParserState();boolean retainComments = false;
  33
  34        public void setRetainComments( boolean b ) {
  35                retainComments = b;
  36        }
  37
  38        void jjtreeOpenNodeScope(Node n) {
  39                ((SimpleNode)n).firstToken = getToken(1);
  40        }
  41
  42        void jjtreeCloseNodeScope(Node n) {
  43                ((SimpleNode)n).lastToken = getToken(0);
  44        }
  45
  46        /**
  47		Re-initialize the input stream and token source.
  48	*/
  49        void reInitInput( Reader in ) {
  50                ReInit(in);
  51        }
  52
  53        public SimpleNode popNode()
  54        {
  55                if ( jjtree.nodeArity() > 0)  // number of child nodes 
  56                        return (SimpleNode)jjtree.popNode();
  57                else
  58                        return null;
  59        }
  60
  61        /**
  62		Explicitly re-initialize just the token reader.
  63		This seems to be necessary to avoid certain looping errors when
  64		reading bogus input.  See Interpreter.
  65	*/
  66        void reInitTokenInput( Reader in ) {
  67                jj_input_stream.ReInit( in,
  68                        jj_input_stream.getEndLine(),
  69                        jj_input_stream.getEndColumn() );
  70        }
  71
  72        public static void main( String [] args )
  73                throws IOException, ParseException
  74        {
  75                boolean print = false;
  76                int i=0;
  77                if ( args[0].equals("-p") ) {
  78                        i++;
  79                        print=true;
  80                }
  81                for(; i< args.length; i++) {
  82                        Reader in = new FileReader(args[i]);
  83                        Parser parser = new Parser(in);
  84                        parser.setRetainComments(true);
  85                        while( !parser.Line()/*eof*/ )
  86                                if ( print )
  87                                        System.out.println( parser.popNode() );
  88                }
  89        }
  90
  91  final public boolean Line() throws ParseException {
  92    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  93    case 0:
  94      jj_consume_token(0);
  95        Interpreter.debug("End of File!");
  96        {if (true) return true;}
  97      break;
  98    case BOOLEAN:
  99    case BREAK:
 100    case BYTE:
 101    case CHAR:
 102    case CONTINUE:
 103    case DO:
 104    case DOUBLE:
 105    case FALSE:
 106    case FINAL:
 107    case FLOAT:
 108    case FOR:
 109    case IF:
 110    case IMPORT:
 111    case INT:
 112    case LONG:
 113    case NEW:
 114    case NULL:
 115    case RETURN:
 116    case SHORT:
 117    case SWITCH:
 118    case THROW:
 119    case TRUE:
 120    case TRY:
 121    case VOID:
 122    case WHILE:
 123    case INTEGER_LITERAL:
 124    case FLOATING_POINT_LITERAL:
 125    case CHARACTER_LITERAL:
 126    case STRING_LITERAL:
 127    case FORMAL_COMMENT:
 128    case IDENTIFIER:
 129    case LPAREN:
 130    case LBRACE:
 131    case SEMICOLON:
 132    case BANG:
 133    case TILDE:
 134    case INCR:
 135    case DECR:
 136    case PLUS:
 137    case MINUS:
 138      if (jj_2_1(2147483647)) {
 139        Expression();
 140        jj_consume_token(SEMICOLON);
 141      } else {
 142        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 143        case BOOLEAN:
 144        case BREAK:
 145        case BYTE:
 146        case CHAR:
 147        case CONTINUE:
 148        case DO:
 149        case DOUBLE:
 150        case FALSE:
 151        case FINAL:
 152        case FLOAT:
 153        case FOR:
 154        case IF:
 155        case IMPORT:
 156        case INT:
 157        case LONG:
 158        case NEW:
 159        case NULL:
 160        case RETURN:
 161        case SHORT:
 162        case SWITCH:
 163        case THROW:
 164        case TRUE:
 165        case TRY:
 166        case VOID:
 167        case WHILE:
 168        case INTEGER_LITERAL:
 169        case FLOATING_POINT_LITERAL:
 170        case CHARACTER_LITERAL:
 171        case STRING_LITERAL:
 172        case FORMAL_COMMENT:
 173        case IDENTIFIER:
 174        case LPAREN:
 175        case LBRACE:
 176        case SEMICOLON:
 177        case INCR:
 178        case DECR:
 179          BlockStatement();
 180          break;
 181        default:
 182          jj_la1[0] = jj_gen;
 183          jj_consume_token(-1);
 184          throw new ParseException();
 185        }
 186      }
 187                {if (true) return false;}
 188      break;
 189    default:
 190      jj_la1[1] = jj_gen;
 191      jj_consume_token(-1);
 192      throw new ParseException();
 193    }
 194    throw new Error("Missing return statement in function");
 195  }
 196
 197/*****************************************
 198 * THE JAVA LANGUAGE GRAMMAR STARTS HERE *
 199 *****************************************/
 200  final public void MethodDeclaration() throws ParseException {
 201 /*@bgen(jjtree) MethodDeclaration */
 202  BSHMethodDeclaration jjtn000 = new BSHMethodDeclaration(JJTMETHODDECLARATION);
 203  boolean jjtc000 = true;
 204  jjtree.openNodeScope(jjtn000);
 205  jjtreeOpenNodeScope(jjtn000);Token t = null;
 206    try {
 207      if (jj_2_2(2147483647)) {
 208        ReturnType();
 209        t = jj_consume_token(IDENTIFIER);
 210                                    jjtn000.name = t.image;
 211        FormalParameters();
 212        Block();
 213      } else {
 214        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 215        case IDENTIFIER:
 216          t = jj_consume_token(IDENTIFIER);
 217                       jjtn000.name = t.image;
 218          FormalParameters();
 219          Block();
 220          break;
 221        default:
 222          jj_la1[2] = jj_gen;
 223          jj_consume_token(-1);
 224          throw new ParseException();
 225        }
 226      }
 227    } catch (Throwable jjte000) {
 228      if (jjtc000) {
 229        jjtree.clearNodeScope(jjtn000);
 230        jjtc000 = false;
 231      } else {
 232        jjtree.popNode();
 233      }
 234      if (jjte000 instanceof RuntimeException) {
 235        {if (true) throw (RuntimeException)jjte000;}
 236      }
 237      if (jjte000 instanceof ParseException) {
 238        {if (true) throw (ParseException)jjte000;}
 239      }
 240      {if (true) throw (Error)jjte000;}
 241    } finally {
 242      if (jjtc000) {
 243        jjtree.closeNodeScope(jjtn000, true);
 244        jjtreeCloseNodeScope(jjtn000);
 245      }
 246    }
 247  }
 248
 249  final public void MethodDeclarationLookahead() throws ParseException {
 250    if (jj_2_3(2147483647)) {
 251      ReturnType();
 252      jj_consume_token(IDENTIFIER);
 253      FormalParameters();
 254      jj_consume_token(LBRACE);
 255    } else {
 256      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 257      case IDENTIFIER:
 258        jj_consume_token(IDENTIFIER);
 259        FormalParameters();
 260        jj_consume_token(LBRACE);
 261        break;
 262      default:
 263        jj_la1[3] = jj_gen;
 264        jj_consume_token(-1);
 265        throw new ParseException();
 266      }
 267    }
 268  }
 269
 270  final public void MethodDeclarationTypeLookahead() throws ParseException {
 271    ReturnType();
 272    jj_consume_token(IDENTIFIER);
 273    jj_consume_token(LPAREN);
 274  }
 275
 276  final public void ImportDeclaration() throws ParseException {
 277 /*@bgen(jjtree) ImportDeclaration */
 278    BSHImportDeclaration jjtn000 = new BSHImportDeclaration(JJTIMPORTDECLARATION);
 279    boolean jjtc000 = true;
 280    jjtree.openNodeScope(jjtn000);
 281    jjtreeOpenNodeScope(jjtn000);Token t = null;
 282    try {
 283      if (jj_2_4(2)) {
 284        jj_consume_token(IMPORT);
 285        AmbiguousName();
 286        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 287        case DOT:
 288          t = jj_consume_token(DOT);
 289          jj_consume_token(STAR);
 290          break;
 291        default:
 292          jj_la1[4] = jj_gen;
 293          ;
 294        }
 295        jj_consume_token(SEMICOLON);
 296                                                 jjtree.closeNodeScope(jjtn000, true);
 297                                                 jjtc000 = false;
 298                                                 jjtreeCloseNodeScope(jjtn000);
 299    if ( t != null )
 300        jjtn000.importPackage = true;
 301      } else {
 302        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 303        case IMPORT:
 304          jj_consume_token(IMPORT);
 305          jj_consume_token(STAR);
 306          jj_consume_token(SEMICOLON);
 307                     jjtree.closeNodeScope(jjtn000, true);
 308                     jjtc000 = false;
 309                     jjtreeCloseNodeScope(jjtn000);
 310                jjtn000.superImport = true;
 311          break;
 312        default:
 313          jj_la1[5] = jj_gen;
 314          jj_consume_token(-1);
 315          throw new ParseException();
 316        }
 317      }
 318    } catch (Throwable jjte000) {
 319    if (jjtc000) {
 320      jjtree.clearNodeScope(jjtn000);
 321      jjtc000 = false;
 322    } else {
 323      jjtree.popNode();
 324    }
 325    if (jjte000 instanceof RuntimeException) {
 326      {if (true) throw (RuntimeException)jjte000;}
 327    }
 328    if (jjte000 instanceof ParseException) {
 329      {if (true) throw (ParseException)jjte000;}
 330    }
 331    {if (true) throw (Error)jjte000;}
 332    } finally {
 333    if (jjtc000) {
 334      jjtree.closeNodeScope(jjtn000, true);
 335      jjtreeCloseNodeScope(jjtn000);
 336    }
 337    }
 338  }
 339
 340  final public void VariableDeclarator() throws ParseException {
 341 /*@bgen(jjtree) VariableDeclarator */
 342  BSHVariableDeclarator jjtn000 = new BSHVariableDeclarator(JJTVARIABLEDECLARATOR);
 343  boolean jjtc000 = true;
 344  jjtree.openNodeScope(jjtn000);
 345  jjtreeOpenNodeScope(jjtn000);Token t;
 346    try {
 347      t = jj_consume_token(IDENTIFIER);
 348      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 349      case ASSIGN:
 350        jj_consume_token(ASSIGN);
 351        VariableInitializer();
 352        break;
 353      default:
 354        jj_la1[6] = jj_gen;
 355        ;
 356      }
 357                                                 jjtree.closeNodeScope(jjtn000, true);
 358                                                 jjtc000 = false;
 359                                                 jjtreeCloseNodeScope(jjtn000);
 360                                                 jjtn000.name = t.image;
 361    } catch (Throwable jjte000) {
 362    if (jjtc000) {
 363      jjtree.clearNodeScope(jjtn000);
 364      jjtc000 = false;
 365    } else {
 366      jjtree.popNode();
 367    }
 368    if (jjte000 instanceof RuntimeException) {
 369      {if (true) throw (RuntimeException)jjte000;}
 370    }
 371    if (jjte000 instanceof ParseException) {
 372      {if (true) throw (ParseException)jjte000;}
 373    }
 374    {if (true) throw (Error)jjte000;}
 375    } finally {
 376    if (jjtc000) {
 377      jjtree.closeNodeScope(jjtn000, true);
 378      jjtreeCloseNodeScope(jjtn000);
 379    }
 380    }
 381  }
 382
 383/*
 384Can get rid of this if we ignore postfix array dimensions in declarations.
 385I don't like them and I don't want to deal with them right now.
 386
 387void VariableDeclaratorId() #VariableDeclaratorId :
 388{ Token t; }
 389{
 390  t=<IDENTIFIER> { jjtThis.name = t.image; }
 391  ( "[" "]" { jjtThis.addArrayDimension(); } )*
 392}
 393*/
 394  final public void VariableInitializer() throws ParseException {
 395    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 396    case LBRACE:
 397      ArrayInitializer();
 398      break;
 399    case BOOLEAN:
 400    case BYTE:
 401    case CHAR:
 402    case DOUBLE:
 403    case FALSE:
 404    case FLOAT:
 405    case INT:
 406    case LONG:
 407    case NEW:
 408    case NULL:
 409    case SHORT:
 410    case TRUE:
 411    case VOID:
 412    case INTEGER_LITERAL:
 413    case FLOATING_POINT_LITERAL:
 414    case CHARACTER_LITERAL:
 415    case STRING_LITERAL:
 416    case IDENTIFIER:
 417    case LPAREN:
 418    case BANG:
 419    case TILDE:
 420    case INCR:
 421    case DECR:
 422    case PLUS:
 423    case MINUS:
 424      Expression();
 425      break;
 426    default:
 427      jj_la1[7] = jj_gen;
 428      jj_consume_token(-1);
 429      throw new ParseException();
 430    }
 431  }
 432
 433  final public void ArrayInitializer() throws ParseException {
 434 /*@bgen(jjtree) ArrayInitializer */
 435  BSHArrayInitializer jjtn000 = new BSHArrayInitializer(JJTARRAYINITIALIZER);
 436  boolean jjtc000 = true;
 437  jjtree.openNodeScope(jjtn000);
 438  jjtreeOpenNodeScope(jjtn000);
 439    try {
 440      jj_consume_token(LBRACE);
 441      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 442      case BOOLEAN:
 443      case BYTE:
 444      case CHAR:
 445      case DOUBLE:
 446      case FALSE:
 447      case FLOAT:
 448      case INT:
 449      case LONG:
 450      case NEW:
 451      case NULL:
 452      case SHORT:
 453      case TRUE:
 454      case VOID:
 455      case INTEGER_LITERAL:
 456      case FLOATING_POINT_LITERAL:
 457      case CHARACTER_LITERAL:
 458      case STRING_LITERAL:
 459      case IDENTIFIER:
 460      case LPAREN:
 461      case LBRACE:
 462      case BANG:
 463      case TILDE:
 464      case INCR:
 465      case DECR:
 466      case PLUS:
 467      case MINUS:
 468        VariableInitializer();
 469        label_1:
 470        while (true) {
 471          if (jj_2_5(2)) {
 472            ;
 473          } else {
 474            break label_1;
 475          }
 476          jj_consume_token(COMMA);
 477          VariableInitializer();
 478        }
 479        break;
 480      default:
 481        jj_la1[8] = jj_gen;
 482        ;
 483      }
 484      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 485      case COMMA:
 486        jj_consume_token(COMMA);
 487        break;
 488      default:
 489        jj_la1[9] = jj_gen;
 490        ;
 491      }
 492      jj_consume_token(RBRACE);
 493    } catch (Throwable jjte000) {
 494    if (jjtc000) {
 495      jjtree.clearNodeScope(jjtn000);
 496      jjtc000 = false;
 497    } else {
 498      jjtree.popNode();
 499    }
 500    if (jjte000 instanceof RuntimeException) {
 501      {if (true) throw (RuntimeException)jjte000;}
 502    }
 503    if (jjte000 instanceof ParseException) {
 504      {if (true) throw (ParseException)jjte000;}
 505    }
 506    {if (true) throw (Error)jjte000;}
 507    } finally {
 508    if (jjtc000) {
 509      jjtree.closeNodeScope(jjtn000, true);
 510      jjtreeCloseNodeScope(jjtn000);
 511    }
 512    }
 513  }
 514
 515  final public void FormalParameters() throws ParseException {
 516 /*@bgen(jjtree) FormalParameters */
 517  BSHFormalParameters jjtn000 = new BSHFormalParameters(JJTFORMALPARAMETERS);
 518  boolean jjtc000 = true;
 519  jjtree.openNodeScope(jjtn000);
 520  jjtreeOpenNodeScope(jjtn000);
 521    try {
 522      jj_consume_token(LPAREN);
 523      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 524      case BOOLEAN:
 525      case BYTE:
 526      case CHAR:
 527      case DOUBLE:
 528      case FLOAT:
 529      case INT:
 530      case LONG:
 531      case SHORT:
 532      case IDENTIFIER:
 533        FormalParameter();
 534        label_2:
 535        while (true) {
 536          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 537          case COMMA:
 538            ;
 539            break;
 540          default:
 541            jj_la1[10] = jj_gen;
 542            break label_2;
 543          }
 544          jj_consume_token(COMMA);
 545          FormalParameter();
 546        }
 547        break;
 548      default:
 549        jj_la1[11] = jj_gen;
 550        ;
 551      }
 552      jj_consume_token(RPAREN);
 553    } catch (Throwable jjte000) {
 554    if (jjtc000) {
 555      jjtree.clearNodeScope(jjtn000);
 556      jjtc000 = false;
 557    } else {
 558      jjtree.popNode();
 559    }
 560    if (jjte000 instanceof RuntimeException) {
 561      {if (true) throw (RuntimeException)jjte000;}
 562    }
 563    if (jjte000 instanceof ParseException) {
 564      {if (true) throw (ParseException)jjte000;}
 565    }
 566    {if (true) throw (Error)jjte000;}
 567    } finally {
 568    if (jjtc000) {
 569      jjtree.closeNodeScope(jjtn000, true);
 570      jjtreeCloseNodeScope(jjtn000);
 571    }
 572    }
 573  }
 574
 575/*
 576void FormalParameter() #FormalParameter :
 577{ Token t; }
 578{
 579    // added [] to Type for bsh.  Removed [ final ] - is that legal?
 580  [ LOOKAHEAD(2) Type() ] t=<IDENTIFIER> { jjtThis.name = t.image; }
 581}
 582*/
 583  final public void FormalParameter() throws ParseException {
 584 /*@bgen(jjtree) FormalParameter */
 585  BSHFormalParameter jjtn000 = new BSHFormalParameter(JJTFORMALPARAMETER);
 586  boolean jjtc000 = true;
 587  jjtree.openNodeScope(jjtn000);
 588  jjtreeOpenNodeScope(jjtn000);Token t;
 589    try {
 590      if (jj_2_6(2)) {
 591        Type();
 592        t = jj_consume_token(IDENTIFIER);
 593                                       jjtree.closeNodeScope(jjtn000, true);
 594                                       jjtc000 = false;
 595                                       jjtreeCloseNodeScope(jjtn000);
 596                                       jjtn000.name = t.image;
 597      } else {
 598        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 599        case IDENTIFIER:
 600          t = jj_consume_token(IDENTIFIER);
 601                   jjtree.closeNodeScope(jjtn000, true);
 602                   jjtc000 = false;
 603                   jjtreeCloseNodeScope(jjtn000);
 604                   jjtn000.name = t.image;
 605          break;
 606        default:
 607          jj_la1[12] = jj_gen;
 608          jj_consume_token(-1);
 609          throw new ParseException();
 610        }
 611      }
 612    } catch (Throwable jjte000) {
 613    if (jjtc000) {
 614      jjtree.clearNodeScope(jjtn000);
 615      jjtc000 = false;
 616    } else {
 617      jjtree.popNode();
 618    }
 619    if (jjte000 instanceof RuntimeException) {
 620      {if (true) throw (RuntimeException)jjte000;}
 621    }
 622    if (jjte000 instanceof ParseException) {
 623      {if (true) throw (ParseException)jjte000;}
 624    }
 625    {if (true) throw (Error)jjte000;}
 626    } finally {
 627    if (jjtc000) {
 628      jjtree.closeNodeScope(jjtn000, true);
 629      jjtreeCloseNodeScope(jjtn000);
 630    }
 631    }
 632  }
 633
 634/*
 635	Type, name and expression syntax follows.
 636*/
 637  final public void Type() throws ParseException {
 638 /*@bgen(jjtree) Type */
 639  BSHType jjtn000 = new BSHType(JJTTYPE);
 640  boolean jjtc000 = true;
 641  jjtree.openNodeScope(jjtn000);
 642  jjtreeOpenNodeScope(jjtn000);
 643    try {
 644      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 645      case BOOLEAN:
 646      case BYTE:
 647      case CHAR:
 648      case DOUBLE:
 649      case FLOAT:
 650      case INT:
 651      case LONG:
 652      case SHORT:
 653        PrimitiveType();
 654        break;
 655      case IDENTIFIER:
 656        AmbiguousName();
 657        break;
 658      default:
 659        jj_la1[13] = jj_gen;
 660        jj_consume_token(-1);
 661        throw new ParseException();
 662      }
 663      label_3:
 664      while (true) {
 665        if (jj_2_7(2)) {
 666          ;
 667        } else {
 668          break label_3;
 669        }
 670        jj_consume_token(LBRACKET);
 671        jj_consume_token(RBRACKET);
 672                                 jjtn000.addArrayDimension();
 673      }
 674    } catch (Throwable jjte000) {
 675    if (jjtc000) {
 676      jjtree.clearNodeScope(jjtn000);
 677      jjtc000 = false;
 678    } else {
 679      jjtree.popNode();
 680    }
 681    if (jjte000 instanceof RuntimeException) {
 682      {if (true) throw (RuntimeException)jjte000;}
 683    }
 684    if (jjte000 instanceof ParseException) {
 685      {if (true) throw (ParseException)jjte000;}
 686    }
 687    {if (true) throw (Error)jjte000;}
 688    } finally {
 689    if (jjtc000) {
 690      jjtree.closeNodeScope(jjtn000, true);
 691      jjtreeCloseNodeScope(jjtn000);
 692    }
 693    }
 694  }
 695
 696/*
 697	Originally called ResultType in the grammar
 698*/
 699  final public void ReturnType() throws ParseException {
 700 /*@bgen(jjtree) ReturnType */
 701  BSHReturnType jjtn000 = new BSHReturnType(JJTRETURNTYPE);
 702  boolean jjtc000 = true;
 703  jjtree.openNodeScope(jjtn000);
 704  jjtreeOpenNodeScope(jjtn000);
 705    try {
 706      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 707      case VOID:
 708        jj_consume_token(VOID);
 709           jjtree.closeNodeScope(jjtn000, true);
 710           jjtc000 = false;
 711           jjtreeCloseNodeScope(jjtn000);
 712           jjtn000.isVoid = true;
 713        break;
 714      case BOOLEAN:
 715      case BYTE:
 716      case CHAR:
 717      case DOUBLE:
 718      case FLOAT:
 719      case INT:
 720      case LONG:
 721      case SHORT:
 722      case IDENTIFIER:
 723        Type();
 724        break;
 725      default:
 726        jj_la1[14] = jj_gen;
 727        jj_consume_token(-1);
 728        throw new ParseException();
 729      }
 730    } catch (Throwable jjte000) {
 731    if (jjtc000) {
 732      jjtree.clearNodeScope(jjtn000);
 733      jjtc000 = false;
 734    } else {
 735      jjtree.popNode();
 736    }
 737    if (jjte000 instanceof RuntimeException) {
 738      {if (true) throw (RuntimeException)jjte000;}
 739    }
 740    if (jjte000 instanceof ParseException) {
 741      {if (true) throw (ParseException)jjte000;}
 742    }
 743    {if (true) throw (Error)jjte000;}
 744    } finally {
 745    if (jjtc000) {
 746      jjtree.closeNodeScope(jjtn000, true);
 747      jjtreeCloseNodeScope(jjtn000);
 748    }
 749    }
 750  }
 751
 752  final public void PrimitiveType() throws ParseException {
 753 /*@bgen(jjtree) PrimitiveType */
 754  BSHPrimitiveType jjtn000 = new BSHPrimitiveType(JJTPRIMITIVETYPE);
 755  boolean jjtc000 = true;
 756  jjtree.openNodeScope(jjtn000);
 757  jjtreeOpenNodeScope(jjtn000);
 758    try {
 759      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 760      case BOOLEAN:
 761        jj_consume_token(BOOLEAN);
 762            jjtree.closeNodeScope(jjtn000, true);
 763            jjtc000 = false;
 764            jjtreeCloseNodeScope(jjtn000);
 765            jjtn000.type = Boolean.TYPE;
 766        break;
 767      case CHAR:
 768        jj_consume_token(CHAR);
 769           jjtree.closeNodeScope(jjtn000, true);
 770           jjtc000 = false;
 771           jjtreeCloseNodeScope(jjtn000);
 772           jjtn000.type =  Character.TYPE;
 773        break;
 774      case BYTE:
 775        jj_consume_token(BYTE);
 776           jjtree.closeNodeScope(jjtn000, true);
 777           jjtc000 = false;
 778           jjtreeCloseNodeScope(jjtn000);
 779           jjtn000.type =  Byte.TYPE;
 780        break;
 781      case SHORT:
 782        jj_consume_token(SHORT);
 783            jjtree.closeNodeScope(jjtn000, true);
 784            jjtc000 = false;
 785            jjtreeCloseNodeScope(jjtn000);
 786            jjtn000.type =  Short.TYPE;
 787        break;
 788      case INT:
 789        jj_consume_token(INT);
 790          jjtree.closeNodeScope(jjtn000, true);
 791          jjtc000 = false;
 792          jjtreeCloseNodeScope(jjtn000);
 793          jjtn000.type =  Integer.TYPE;
 794        break;
 795      case LONG:
 796        jj_consume_token(LONG);
 797           jjtree.closeNodeScope(jjtn000, true);
 798           jjtc000 = false;
 799           jjtreeCloseNodeScope(jjtn000);
 800           jjtn000.type =  Long.TYPE;
 801        break;
 802      case FLOAT:
 803        jj_consume_token(FLOAT);
 804            jjtree.closeNodeScope(jjtn000, true);
 805            jjtc000 = false;
 806            jjtreeCloseNodeScope(jjtn000);
 807            jjtn000.type =  Float.TYPE;
 808        break;
 809      case DOUBLE:
 810        jj_consume_token(DOUBLE);
 811             jjtree.closeNodeScope(jjtn000, true);
 812             jjtc000 = false;
 813             jjtreeCloseNodeScope(jjtn000);
 814             jjtn000.type =  Double.TYPE;
 815        break;
 816      default:
 817        jj_la1[15] = jj_gen;
 818        jj_consume_token(-1);
 819        throw new ParseException();
 820      }
 821    } finally {
 822  if (jjtc000) {
 823    jjtree.closeNodeScope(jjtn000, true);
 824    jjtreeCloseNodeScope(jjtn000);
 825  }
 826    }
 827  }
 828
 829  final public void AmbiguousName() throws ParseException {
 830 /*@bgen(jjtree) AmbiguousName */
 831    BSHAmbiguousName jjtn000 = new BSHAmbiguousName(JJTAMBIGUOUSNAME);
 832    boolean jjtc000 = true;
 833    jjtree.openNodeScope(jjtn000);
 834    jjtreeOpenNodeScope(jjtn000);Token t;
 835    StringBuffer s;
 836    try {
 837      t = jj_consume_token(IDENTIFIER);
 838        s = new StringBuffer(t.image);
 839      label_4:
 840      while (true) {
 841        if (jj_2_8(2)) {
 842          ;
 843        } else {
 844          break label_4;
 845        }
 846        jj_consume_token(DOT);
 847        t = jj_consume_token(IDENTIFIER);
 848        s.append("."+t.image);
 849      }
 850       jjtree.closeNodeScope(jjtn000, true);
 851       jjtc000 = false;
 852       jjtreeCloseNodeScope(jjtn000);
 853        jjtn000.text = s.toString();
 854    } finally {
 855    if (jjtc000) {
 856      jjtree.closeNodeScope(jjtn000, true);
 857      jjtreeCloseNodeScope(jjtn000);
 858    }
 859    }
 860  }
 861
 862/*
 863 * Expression syntax follows.
 864 */
 865  final public void Expression() throws ParseException {
 866    if (jj_2_9(2147483647)) {
 867      Assignment();
 868    } else {
 869      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 870      case BOOLEAN:
 871      case BYTE:
 872      case CHAR:
 873      case DOUBLE:
 874      case FALSE:
 875      case FLOAT:
 876      case INT:
 877      case LONG:
 878      case NEW:
 879      case NULL:
 880      case SHORT:
 881      case TRUE:
 882      case VOID:
 883      case INTEGER_LITERAL:
 884      case FLOATING_POINT_LITERAL:
 885      case CHARACTER_LITERAL:
 886      case STRING_LITERAL:
 887      case IDENTIFIER:
 888      case LPAREN:
 889      case BANG:
 890      case TILDE:
 891      case INCR:
 892      case DECR:
 893      case PLUS:
 894      case MINUS:
 895        ConditionalExpression();
 896        break;
 897      default:
 898        jj_la1[16] = jj_gen;
 899        jj_consume_token(-1);
 900        throw new ParseException();
 901      }
 902    }
 903  }
 904
 905  final public void Assignment() throws ParseException {
 906 /*@bgen(jjtree) Assignment */
 907  BSHAssignment jjtn000 = new BSHAssignment(JJTASSIGNMENT);
 908  boolean jjtc000 = true;
 909  jjtree.openNodeScope(jjtn000);
 910  jjtreeOpenNodeScope(jjtn000);int op ;
 911    try {
 912      LHSPrimaryExpression();
 913      op = AssignmentOperator();
 914    jjtn000.operator = op;
 915      Expression();
 916    } catch (Throwable jjte000) {
 917    if (jjtc000) {
 918      jjtree.clearNodeScope(jjtn000);
 919      jjtc000 = false;
 920    } else {
 921      jjtree.popNode();
 922    }
 923    if (jjte000 instanceof RuntimeException) {
 924      {if (true) throw (RuntimeException)jjte000;}
 925    }
 926    if (jjte000 instanceof ParseException) {
 927      {if (true) throw (ParseException)jjte000;}
 928    }
 929    {if (true) throw (Error)jjte000;}
 930    } finally {
 931    if (jjtc000) {
 932      jjtree.closeNodeScope(jjtn000, true);
 933      jjtreeCloseNodeScope(jjtn000);
 934    }
 935    }
 936  }
 937
 938  final public int AssignmentOperator() throws ParseException {
 939  Token t;
 940    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 941    case ASSIGN:
 942      jj_consume_token(ASSIGN);
 943      break;
 944    case STARASSIGN:
 945      jj_consume_token(STARASSIGN);
 946      break;
 947    case SLASHASSIGN:
 948      jj_consume_token(SLASHASSIGN);
 949      break;
 950    case MODASSIGN:
 951      jj_consume_token(MODASSIGN);
 952      break;
 953    case PLUSASSIGN:
 954      jj_consume_token(PLUSASSIGN);
 955      break;
 956    case MINUSASSIGN:
 957      jj_consume_token(MINUSASSIGN);
 958      break;
 959    case ANDASSIGN:
 960      jj_consume_token(ANDASSIGN);
 961      break;
 962    case XORASSIGN:
 963      jj_consume_token(XORASSIGN);
 964      break;
 965    case ORASSIGN:
 966      jj_consume_token(ORASSIGN);
 967      break;
 968    case LSHIFTASSIGN:
 969      jj_consume_token(LSHIFTASSIGN);
 970      break;
 971    case LSHIFTASSIGNX:
 972      jj_consume_token(LSHIFTASSIGNX);
 973      break;
 974    case RSIGNEDSHIFTASSIGN:
 975      jj_consume_token(RSIGNEDSHIFTASSIGN);
 976      break;
 977    case RSIGNEDSHIFTASSIGNX:
 978      jj_consume_token(RSIGNEDSHIFTASSIGNX);
 979      break;
 980    case RUNSIGNEDSHIFTASSIGN:
 981      jj_consume_token(RUNSIGNEDSHIFTASSIGN);
 982      break;
 983    case RUNSIGNEDSHIFTASSIGNX:
 984      jj_consume_token(RUNSIGNEDSHIFTASSIGNX);
 985      break;
 986    default:
 987      jj_la1[17] = jj_gen;
 988      jj_consume_token(-1);
 989      throw new ParseException();
 990    }
 991        t = getToken(0);
 992        {if (true) return t.kind;}
 993    throw new Error("Missing return statement in function");
 994  }
 995
 996  final public void ConditionalExpression() throws ParseException {
 997    ConditionalOrExpression();
 998    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
 999    case HOOK:
1000      jj_consume_token(HOOK);
1001      Expression();
1002      jj_consume_token(COLON);
1003                                                     BSHTernaryExpression jjtn001 = new BSHTernaryExpression(JJTTERNARYEXPRESSION);
1004                                                     boolean jjtc001 = true;
1005                                                     jjtree.openNodeScope(jjtn001);
1006                                                     jjtreeOpenNodeScope(jjtn001);
1007      try {
1008        ConditionalExpression();
1009      } catch (Throwable jjte001) {
1010                                                     if (jjtc001) {
1011                                                       jjtree.clearNodeScope(jjtn001);
1012                                                       jjtc001 = false;
1013                                                     } else {
1014                                                       jjtree.popNode();
1015                                                     }
1016                                                     if (jjte001 instanceof RuntimeException) {
1017                                                       {if (true) throw (RuntimeException)jjte001;}
1018                                                     }
1019                                                     if (jjte001 instanceof ParseException) {
1020                                                       {if (true) throw (ParseException)jjte001;}
1021                                                     }
1022                                                     {if (true) throw (Error)jjte001;}
1023      } finally {
1024                                                     if (jjtc001) {
1025                                                       jjtree.closeNodeScope(jjtn001,  3);
1026                                                       jjtreeCloseNodeScope(jjtn001);
1027                                                     }
1028      }
1029      break;
1030    default:
1031      jj_la1[18] = jj_gen;
1032      ;
1033    }
1034  }
1035
1036  final public void ConditionalOrExpression() throws ParseException {
1037  Token t=null;
1038    ConditionalAndExpression();
1039    label_5:
1040    while (true) {
1041      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1042      case BOOL_OR:
1043      case BOOL_ORX:
1044        ;
1045        break;
1046      default:
1047        jj_la1[19] = jj_gen;
1048        break label_5;
1049      }
1050      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1051      case BOOL_OR:
1052        t = jj_consume_token(BOOL_OR);
1053        break;
1054      case BOOL_ORX:
1055        t = jj_consume_token(BOOL_ORX);
1056        break;
1057      default:
1058        jj_la1[20] = jj_gen;
1059        jj_consume_token(-1);
1060        throw new ParseException();
1061      }
1062      ConditionalAndExpression();
1063      BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
1064      boolean jjtc001 = true;
1065      jjtree.openNodeScope(jjtn001);
1066      jjtreeOpenNodeScope(jjtn001);
1067      try {
1068      jjtree.closeNodeScope(jjtn001,  2);
1069      jjtc001 = false;
1070      jjtreeCloseNodeScope(jjtn001);
1071      jjtn001.kind = t.kind;
1072      } finally {
1073      if (jjtc001) {
1074        jjtree.closeNodeScope(jjtn001,  2);
1075        jjtreeCloseNodeScope(jjtn001);
1076      }
1077      }
1078    }
1079  }
1080
1081  final public void ConditionalAndExpression() throws ParseException {
1082  Token t=null;
1083    InclusiveOrExpression();
1084    label_6:
1085    while (true) {
1086      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1087      case BOOL_AND:
1088      case BOOL_ANDX:
1089        ;
1090        break;
1091      default:
1092        jj_la1[21] = jj_gen;
1093        break label_6;
1094      }
1095      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1096      case BOOL_AND:
1097        t = jj_consume_token(BOOL_AND);
1098        break;
1099      case BOOL_ANDX:
1100        t = jj_consume_token(BOOL_ANDX);
1101        break;
1102      default:
1103        jj_la1[22] = jj_gen;
1104        jj_consume_token(-1);
1105        throw new ParseException();
1106      }
1107      InclusiveOrExpression();
1108      BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
1109      boolean jjtc001 = true;
1110      jjtree.openNodeScope(jjtn001);
1111      jjtreeOpenNodeScope(jjtn001);
1112      try {
1113      jjtree.closeNodeScope(jjtn001,  2);
1114      jjtc001 = false;
1115      jjtreeCloseNodeScope(jjtn001);
1116      jjtn001.kind = t.kind;
1117      } finally {
1118      if (jjtc001) {
1119        jjtree.closeNodeScope(jjtn001,  2);
1120        jjtreeCloseNodeScope(jjtn001);
1121      }
1122      }
1123    }
1124  }
1125
1126  final public void InclusiveOrExpression() throws ParseException {
1127  Token t=null;
1128    ExclusiveOrExpression();
1129    label_7:
1130    while (true) {
1131      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1132      case BIT_OR:
1133      case BIT_ORX:
1134        ;
1135        break;
1136      default:
1137        jj_la1[23] = jj_gen;
1138        break label_7;
1139      }
1140      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1141      case BIT_OR:
1142        t = jj_consume_token(BIT_OR);
1143        break;
1144      case BIT_ORX:
1145        t = jj_consume_token(BIT_ORX);
1146        break;
1147      default:
1148        jj_la1[24] = jj_gen;
1149        jj_consume_token(-1);
1150        throw new ParseException();
1151      }
1152      ExclusiveOrExpression();
1153      BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
1154      boolean jjtc001 = true;
1155      jjtree.openNodeScope(jjtn001);
1156      jjtreeOpenNodeScope(jjtn001);
1157      try {
1158      jjtree.closeNodeScope(jjtn001,  2);
1159      jjtc001 = false;
1160      jjtreeCloseNodeScope(jjtn001);
1161      jjtn001.kind = t.kind;
1162      } finally {
1163      if (jjtc001) {
1164        jjtree.closeNodeScope(jjtn001,  2);
1165        jjtreeCloseNodeScope(jjtn001);
1166      }
1167      }
1168    }
1169  }
1170
1171  final public void ExclusiveOrExpression() throws ParseException {
1172  Token t=null;
1173    AndExpression();
1174    label_8:
1175    while (true) {
1176      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1177      case XOR:
1178        ;
1179        break;
1180      default:
1181        jj_la1[25] = jj_gen;
1182        break label_8;
1183      }
1184      t = jj_consume_token(XOR);
1185      AndExpression();
1186      BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
1187      boolean jjtc001 = true;
1188      jjtree.openNodeScope(jjtn001);
1189      jjtreeOpenNodeScope(jjtn001);
1190      try {
1191      jjtree.closeNodeScope(jjtn001,  2);
1192      jjtc001 = false;
1193      jjtreeCloseNodeScope(jjtn001);
1194      jjtn001.kind = t.kind;
1195      } finally {
1196      if (jjtc001) {
1197        jjtree.closeNodeScope(jjtn001,  2);
1198        jjtreeCloseNodeScope(jjtn001);
1199      }
1200      }
1201    }
1202  }
1203
1204  final public void AndExpression() throws ParseException {
1205  Token t=null;
1206    EqualityExpression();
1207    label_9:
1208    while (true) {
1209      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1210      case BIT_AND:
1211      case BIT_ANDX:
1212        ;
1213        break;
1214      default:
1215        jj_la1[26] = jj_gen;
1216        break label_9;
1217      }
1218      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1219      case BIT_AND:
1220        t = jj_consume_token(BIT_AND);
1221        break;
1222      case BIT_ANDX:
1223        t = jj_consume_token(BIT_ANDX);
1224        break;
1225      default:
1226        jj_la1[27] = jj_gen;
1227        jj_consume_token(-1);
1228        throw new ParseException();
1229      }
1230      EqualityExpression();
1231      BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
1232      boolean jjtc001 = true;
1233      jjtree.openNodeScope(jjtn001);
1234      jjtreeOpenNodeScope(jjtn001);
1235      try {
1236      jjtree.closeNodeScope(jjtn001,  2);
1237      jjtc001 = false;
1238      jjtreeCloseNodeScope(jjtn001);
1239      jjtn001.kind = t.kind;
1240      } finally {
1241      if (jjtc001) {
1242        jjtree.closeNodeScope(jjtn001,  2);
1243        jjtreeCloseNodeScope(jjtn001);
1244      }
1245      }
1246    }
1247  }
1248
1249  final public void EqualityExpression() throws ParseException {
1250  Token t = null;
1251    InstanceOfExpression();
1252    label_10:
1253    while (true) {
1254      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1255      case EQ:
1256      case NE:
1257        ;
1258        break;
1259      default:
1260        jj_la1[28] = jj_gen;
1261        break label_10;
1262      }
1263      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1264      case EQ:
1265        t = jj_consume_token(EQ);
1266        break;
1267      case NE:
1268        t = jj_consume_token(NE);
1269        break;
1270      default:
1271        jj_la1[29] = jj_gen;
1272        jj_consume_token(-1);
1273        throw new ParseException();
1274      }
1275      InstanceOfExpression();
1276      BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
1277      boolean jjtc001 = true;
1278      jjtree.openNodeScope(jjtn001);
1279      jjtreeOpenNodeScope(jjtn001);
1280      try {
1281      jjtree.closeNodeScope(jjtn001,  2);
1282      jjtc001 = false;
1283      jjtreeCloseNodeScope(jjtn001);
1284      jjtn001.kind = t.kind;
1285      } finally {
1286      if (jjtc001) {
1287        jjtree.closeNodeScope(jjtn001,  2);
1288        jjtreeCloseNodeScope(jjtn001);
1289      }
1290      }
1291    }
1292  }
1293
1294  final public void InstanceOfExpression() throws ParseException {
1295  Token t = null;
1296    RelationalExpression();
1297    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1298    case INSTANCEOF:
1299      t = jj_consume_token(INSTANCEOF);
1300      Type();
1301                              BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
1302                              boolean jjtc001 = true;
1303                              jjtree.openNodeScope(jjtn001);
1304                              jjtreeOpenNodeScope(jjtn001);
1305      try {
1306                              jjtree.closeNodeScope(jjtn001,  2);
1307                              jjtc001 = false;
1308                              jjtreeCloseNodeScope(jjtn001);
1309                              jjtn001.kind = t.kind;
1310      } finally {
1311                              if (jjtc001) {
1312                                jjtree.closeNodeScope(jjtn001,  2);
1313                                jjtreeCloseNodeScope(jjtn001);
1314                              }
1315      }
1316      break;
1317    default:
1318      jj_la1[30] = jj_gen;
1319      ;
1320    }
1321  }
1322
1323  final public void RelationalExpression() throws ParseException {
1324  Token t = null;
1325    ShiftExpression();
1326    label_11:
1327    while (true) {
1328      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1329      case GT:
1330      case GTX:
1331      case LT:
1332      case LTX:
1333      case LE:
1334      case LEX:
1335      case GE:
1336      case GEX:
1337        ;
1338        break;
1339      default:
1340        jj_la1[31] = jj_gen;
1341        break label_11;
1342      }
1343      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1344      case LT:
1345        t = jj_consume_token(LT);
1346        break;
1347      case LTX:
1348        t = jj_consume_token(LTX);
1349        break;
1350      case GT:
1351        t = jj_consume_token(GT);
1352        break;
1353      case GTX:
1354        t = jj_consume_token(GTX);
1355        break;
1356      case LE:
1357        t = jj_consume_token(LE);
1358        break;
1359      case LEX:
1360        t = jj_consume_token(LEX);
1361        break;
1362      case GE:
1363        t = jj_consume_token(GE);
1364        break;
1365      case GEX:
1366        t = jj_consume_token(GEX);
1367        break;
1368      default:
1369        jj_la1[32] = jj_gen;
1370        jj_consume_token(-1);
1371        throw new ParseException();
1372      }
1373      ShiftExpression();
1374    BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
1375    boolean jjtc001 = true;
1376    jjtree.openNodeScope(jjtn001);
1377    jjtreeOpenNodeScope(jjtn001);
1378      try {
1379    jjtree.closeNodeScope(jjtn001,  2);
1380    jjtc001 = false;
1381    jjtreeCloseNodeScope(jjtn001);
1382    jjtn001.kind = t.kind;
1383      } finally {
1384    if (jjtc001) {
1385      jjtree.closeNodeScope(jjtn001,  2);
1386      jjtreeCloseNodeScope(jjtn001);
1387    }
1388      }
1389    }
1390  }
1391
1392  final public void ShiftExpression() throws ParseException {
1393  Token t = null;
1394    AdditiveExpression();
1395    label_12:
1396    while (true) {
1397      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1398      case LSHIFT:
1399      case LSHIFTX:
1400      case RSIGNEDSHIFT:
1401      case RSIGNEDSHIFTX:
1402      case RUNSIGNEDSHIFT:
1403      case RUNSIGNEDSHIFTX:
1404        ;
1405        break;
1406      default:
1407        jj_la1[33] = jj_gen;
1408        break label_12;
1409      }
1410      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1411      case LSHIFT:
1412        t = jj_consume_token(LSHIFT);
1413        break;
1414      case LSHIFTX:
1415        t = jj_consume_token(LSHIFTX);
1416        break;
1417      case RSIGNEDSHIFT:
1418        t = jj_consume_token(RSIGNEDSHIFT);
1419        break;
1420      case RSIGNEDSHIFTX:
1421        t = jj_consume_token(RSIGNEDSHIFTX);
1422        break;
1423      case RUNSIGNEDSHIFT:
1424        t = jj_consume_token(RUNSIGNEDSHIFT);
1425        break;
1426      case RUNSIGNEDSHIFTX:
1427        t = jj_consume_token(RUNSIGNEDSHIFTX);
1428        break;
1429      default:
1430        jj_la1[34] = jj_gen;
1431        jj_consume_token(-1);
1432        throw new ParseException();
1433      }
1434      AdditiveExpression();
1435    BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
1436    boolean jjtc001 = true;
1437    jjtree.openNodeScope(jjtn001);
1438    jjtreeOpenNodeScope(jjtn001);
1439      try {
1440    jjtree.closeNodeScope(jjtn001,  2);
1441    jjtc001 = false;
1442    jjtreeCloseNodeScope(jjtn001);
1443    jjtn001.kind = t.kind;
1444      } finally {
1445    if (jjtc001) {
1446      jjtree.closeNodeScope(jjtn001,  2);
1447      jjtreeCloseNodeScope(jjtn001);
1448    }
1449      }
1450    }
1451  }
1452
1453  final public void AdditiveExpression() throws ParseException {
1454  Token t = null;
1455    MultiplicativeExpression();
1456    label_13:
1457    while (true) {
1458      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1459      case PLUS:
1460      case MINUS:
1461        ;
1462        break;
1463      default:
1464        jj_la1[35] = jj_gen;
1465        break label_13;
1466      }
1467      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1468      case PLUS:
1469        t = jj_consume_token(PLUS);
1470        break;
1471      case MINUS:
1472        t = jj_consume_token(MINUS);
1473        break;
1474      default:
1475        jj_la1[36] = jj_gen;
1476        jj_consume_token(-1);
1477        throw new ParseException();
1478      }
1479      MultiplicativeExpression();
1480                                                     BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
1481                                                     boolean jjtc001 = true;
1482                                                     jjtree.openNodeScope(jjtn001);
1483                                                     jjtreeOpenNodeScope(jjtn001);
1484      try {
1485                                                     jjtree.closeNodeScope(jjtn001,  2);
1486                                                     jjtc001 = false;
1487                                                     jjtreeCloseNodeScope(jjtn001);
1488                                                     jjtn001.kind = t.kind;
1489      } finally {
1490                                                     if (jjtc001) {
1491                                                       jjtree.closeNodeScope(jjtn001,  2);
1492                                                       jjtreeCloseNodeScope(jjtn001);
1493                                                     }
1494      }
1495    }
1496  }
1497
1498  final public void MultiplicativeExpression() throws ParseException {
1499  Token t = null;
1500    UnaryExpression();
1501    label_14:
1502    while (true) {
1503      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1504      case STAR:
1505      case SLASH:
1506      case MOD:
1507        ;
1508        break;
1509      default:
1510        jj_la1[37] = jj_gen;
1511        break label_14;
1512      }
1513      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1514      case STAR:
1515        t = jj_consume_token(STAR);
1516        break;
1517      case SLASH:
1518        t = jj_consume_token(SLASH);
1519        break;
1520      case MOD:
1521        t = jj_consume_token(MOD);
1522        break;
1523      default:
1524        jj_la1[38] = jj_gen;
1525        jj_consume_token(-1);
1526        throw new ParseException();
1527      }
1528      UnaryExpression();
1529                      BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
1530                      boolean jjtc001 = true;
1531                      jjtree.openNodeScope(jjtn001);
1532                      jjtreeOpenNodeScope(jjtn001);
1533      try {
1534                      jjtree.closeNodeScope(jjtn001,  2);
1535                      jjtc001 = false;
1536                      jjtreeCloseNodeScope(jjtn001);
1537                      jjtn001.kind = t.kind;
1538      } finally {
1539                      if (jjtc001) {
1540                        jjtree.closeNodeScope(jjtn001,  2);
1541                        jjtreeCloseNodeScope(jjtn001);
1542                      }
1543      }
1544    }
1545  }
1546
1547  final public void UnaryExpression() throws ParseException {
1548  Token t = null;
1549    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1550    case PLUS:
1551    case MINUS:
1552      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1553      case PLUS:
1554        t = jj_consume_token(PLUS);
1555        break;
1556      case MINUS:
1557        t = jj_consume_token(MINUS);
1558        break;
1559      default:
1560        jj_la1[39] = jj_gen;
1561        jj_consume_token(-1);
1562        throw new ParseException();
1563      }
1564      UnaryExpression();
1565      BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION);
1566      boolean jjtc001 = true;
1567      jjtree.openNodeScope(jjtn001);
1568      jjtreeOpenNodeScope(jjtn001);
1569      try {
1570      jjtree.closeNodeScope(jjtn001,  1);
1571      jjtc001 = false;
1572      jjtreeCloseNodeScope(jjtn001);
1573      jjtn001.kind = t.kind;
1574      } finally {
1575      if (jjtc001) {
1576        jjtree.closeNodeScope(jjtn001,  1);
1577        jjtreeCloseNodeScope(jjtn001);
1578      }
1579      }
1580      break;
1581    case INCR:
1582      PreIncrementExpression();
1583      break;
1584    case DECR:
1585      PreDecrementExpression();
1586      break;
1587    case BOOLEAN:
1588    case BYTE:
1589    case CHAR:
1590    case DOUBLE:
1591    case FALSE:
1592    case FLOAT:
1593    case INT:
1594    case LONG:
1595    case NEW:
1596    case NULL:
1597    case SHORT:
1598    case TRUE:
1599    case VOID:
1600    case INTEGER_LITERAL:
1601    case FLOATING_POINT_LITERAL:
1602    case CHARACTER_LITERAL:
1603    case STRING_LITERAL:
1604    case IDENTIFIER:
1605    case LPAREN:
1606    case BANG:
1607    case TILDE:
1608      UnaryExpressionNotPlusMinus();
1609      break;
1610    default:
1611      jj_la1[40] = jj_gen;
1612      jj_consume_token(-1);
1613      throw new ParseException();
1614    }
1615  }
1616
1617  final public void PreIncrementExpression() throws ParseException {
1618  Token t = null;
1619    t = jj_consume_token(INCR);
1620    LHSPrimaryExpression();
1621      BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION);
1622      boolean jjtc001 = true;
1623      jjtree.openNodeScope(jjtn001);
1624      jjtreeOpenNodeScope(jjtn001);
1625    try {
1626      jjtree.closeNodeScope(jjtn001,  1);
1627      jjtc001 = false;
1628      jjtreeCloseNodeScope(jjtn001);
1629      jjtn001.kind = t.kind;
1630    } finally {
1631      if (jjtc001) {
1632        jjtree.closeNodeScope(jjtn001,  1);
1633        jjtreeCloseNodeScope(jjtn001);
1634      }
1635    }
1636  }
1637
1638  final public void PreDecrementExpression() throws ParseException {
1639  Token t = null;
1640    t = jj_consume_token(DECR);
1641    LHSPrimaryExpression();
1642      BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION);
1643      boolean jjtc001 = true;
1644      jjtree.openNodeScope(jjtn001);
1645      jjtreeOpenNodeScope(jjtn001);
1646    try {
1647      jjtree.closeNodeScope(jjtn001,  1);
1648      jjtc001 = false;
1649      jjtreeCloseNodeScope(jjtn001);
1650      jjtn001.kind = t.kind;
1651    } finally {
1652      if (jjtc001) {
1653        jjtree.closeNodeScope(jjtn001,  1);
1654        jjtreeCloseNodeScope(jjtn001);
1655      }
1656    }
1657  }
1658
1659  final public void UnaryExpressionNotPlusMinus() throws ParseException {
1660  Token t = null;
1661    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1662    case BANG:
1663    case TILDE:
1664      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1665      case TILDE:
1666        t = jj_consume_token(TILDE);
1667        break;
1668      case BANG:
1669        t = jj_consume_token(BANG);
1670        break;
1671      default:
1672        jj_la1[41] = jj_gen;
1673        jj_consume_token(-1);
1674        throw new ParseException();
1675      }
1676      UnaryExpression();
1677      BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION);
1678      boolean jjtc001 = true;
1679      jjtree.openNodeScope(jjtn001);
1680      jjtreeOpenNodeScope(jjtn001);
1681      try {
1682      jjtree.closeNodeScope(jjtn001,  1);
1683      jjtc001 = false;
1684      jjtreeCloseNodeScope(jjtn001);
1685      jjtn001.kind = t.kind;
1686      } finally {
1687      if (jjtc001) {
1688        jjtree.closeNodeScope(jjtn001,  1);
1689        jjtreeCloseNodeScope(jjtn001);
1690      }
1691      }
1692      break;
1693    default:
1694      jj_la1[42] = jj_gen;
1695      if (jj_2_10(2147483647)) {
1696        CastExpression();
1697      } else {
1698        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1699        case BOOLEAN:
1700        case BYTE:
1701        case CHAR:
1702        case DOUBLE:
1703        case FALSE:
1704        case FLOAT:
1705        case INT:
1706        case LONG:
1707        case NEW:
1708        case NULL:
1709        case SHORT:
1710        case TRUE:
1711        case VOID:
1712        case INTEGER_LITERAL:
1713        case FLOATING_POINT_LITERAL:
1714        case CHARACTER_LITERAL:
1715        case STRING_LITERAL:
1716        case IDENTIFIER:
1717        case LPAREN:
1718          PostfixExpression();
1719          break;
1720        default:
1721          jj_la1[43] = jj_gen;
1722          jj_consume_token(-1);
1723          throw new ParseException();
1724        }
1725      }
1726    }
1727  }
1728
1729// This production is to determine lookahead only.
1730  final public void CastLookahead() throws ParseException {
1731    if (jj_2_11(2)) {
1732      jj_consume_token(LPAREN);
1733      PrimitiveType();
1734    } else if (jj_2_12(2147483647)) {
1735      jj_consume_token(LPAREN);
1736      AmbiguousName();
1737      jj_consume_token(LBRACKET);
1738      jj_consume_token(RBRACKET);
1739    } else {
1740      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1741      case LPAREN:
1742        jj_consume_token(LPAREN);
1743        AmbiguousName();
1744        jj_consume_token(RPAREN);
1745        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1746        case TILDE:
1747          jj_consume_token(TILDE);
1748          break;
1749        case BANG:
1750          jj_consume_token(BANG);
1751          break;
1752        case LPAREN:
1753          jj_consume_token(LPAREN);
1754          break;
1755        case IDENTIFIER:
1756          jj_consume_token(IDENTIFIER);
1757          break;
1758        case NEW:
1759          jj_consume_token(NEW);
1760          break;
1761        case FALSE:
1762        case NULL:
1763        case TRUE:
1764        case VOID:
1765        case INTEGER_LITERAL:
1766        case FLOATING_POINT_LITERAL:
1767        case CHARACTER_LITERAL:
1768        case STRING_LITERAL:
1769          Literal();
1770          break;
1771        default:
1772          jj_la1[44] = jj_gen;
1773          jj_consume_token(-1);
1774          throw new ParseException();
1775        }
1776        break;
1777      default:
1778        jj_la1[45] = jj_gen;
1779        jj_consume_token(-1);
1780        throw new ParseException();
1781      }
1782    }
1783  }
1784
1785  final public void PostfixExpression() throws ParseException {
1786  Token t = null;
1787    if (jj_2_13(2147483647)) {
1788      LHSPrimaryExpression();
1789      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1790      case INCR:
1791        t = jj_consume_token(INCR);
1792        break;
1793      case DECR:
1794        t = jj_consume_token(DECR);
1795        break;
1796      default:
1797        jj_la1[46] = jj_gen;
1798        jj_consume_token(-1);
1799        throw new ParseException();
1800      }
1801                                BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION);
1802                                boolean jjtc001 = true;
1803                                jjtree.openNodeScope(jjtn001);
1804                                jjtreeOpenNodeScope(jjtn001);
1805      try {
1806                                jjtree.closeNodeScope(jjtn001,  1);
1807                                jjtc001 = false;
1808                                jjtreeCloseNodeScope(jjtn001);
1809                jjtn001.kind = t.kind; jjtn001.postfix = true;
1810      } finally {
1811                                if (jjtc001) {
1812                                  jjtree.closeNodeScope(jjtn001,  1);
1813                                  jjtreeCloseNodeScope(jjtn001);
1814                                }
1815      }
1816    } else {
1817      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
1818      case BOOLEAN:
1819      case BYTE:
1820      case CHAR:
1821      case DOUBLE:
1822      case FALSE:
1823      case FLOAT:
1824      case INT:
1825      case LONG:
1826      case N

Large files files are truncated, but you can click here to view the full file