PageRenderTime 227ms CodeModel.GetById 40ms app.highlight 153ms RepoModel.GetById 18ms app.codeStats 1ms

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

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

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