PageRenderTime 293ms CodeModel.GetById 155ms app.highlight 124ms RepoModel.GetById 1ms app.codeStats 1ms

/jEdit/tags/jedit-4-5-pre1/org/gjt/sp/jedit/bsh/Parser.java

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

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