/jEdit/tags/jedit-4-0-pre5/bsh/Parser.java
Java | 2362 lines | 2230 code | 55 blank | 77 comment | 233 complexity | fce71613935ea032d5a13db4e555c30c MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
Large files files are truncated, but you can click here to view the full file
- /* Generated By:JJTree&JavaCC: Do not edit this line. Parser.java */
- package bsh;
- import java.io.Reader;
- class Parser/*@bgen(jjtree)*/implements ParserTreeConstants, ParserConstants {/*@bgen(jjtree)*/
- protected JJTParserState jjtree = new JJTParserState();
- void jjtreeOpenNodeScope(Node n) {
- ((SimpleNode)n).firstToken = getToken(1);
- }
- void jjtreeCloseNodeScope(Node n) {
- ((SimpleNode)n).lastToken = getToken(0);
- }
- /**
- Re-initialize the input stream and token source.
- */
- void reInitInput( Reader in ) {
- ReInit(in);
- }
- /**
- Explicitly re-initialize just the token reader.
- This seems to be necessary to avoid certain looping errors when
- reading bogus input. See Interpreter.
- */
- void reInitTokenInput( Reader in ) {
- jj_input_stream.ReInit( in,
- jj_input_stream.getEndLine(),
- jj_input_stream.getEndColumn() );
- }
- final public boolean Line() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case 0:
- jj_consume_token(0);
- Interpreter.debug("End of File!");
- {if (true) return true;}
- break;
- case BOOLEAN:
- case BREAK:
- case BYTE:
- case CHAR:
- case CONTINUE:
- case DO:
- case DOUBLE:
- case FALSE:
- case FINAL:
- case FLOAT:
- case FOR:
- case IF:
- case IMPORT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case RETURN:
- case SHORT:
- case SWITCH:
- case THROW:
- case TRUE:
- case TRY:
- case VOID:
- case WHILE:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case LBRACE:
- case SEMICOLON:
- case BANG:
- case TILDE:
- case INCR:
- case DECR:
- case PLUS:
- case MINUS:
- if (jj_2_1(2147483647)) {
- Expression();
- jj_consume_token(SEMICOLON);
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BREAK:
- case BYTE:
- case CHAR:
- case CONTINUE:
- case DO:
- case DOUBLE:
- case FALSE:
- case FINAL:
- case FLOAT:
- case FOR:
- case IF:
- case IMPORT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case RETURN:
- case SHORT:
- case SWITCH:
- case THROW:
- case TRUE:
- case TRY:
- case VOID:
- case WHILE:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case LBRACE:
- case SEMICOLON:
- case INCR:
- case DECR:
- BlockStatement();
- break;
- default:
- jj_la1[0] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- {if (true) return false;}
- break;
- default:
- jj_la1[1] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- throw new Error("Missing return statement in function");
- }
- /*****************************************
- * THE JAVA LANGUAGE GRAMMAR STARTS HERE *
- *****************************************/
- final public void MethodDeclaration() throws ParseException {
- /*@bgen(jjtree) MethodDeclaration */
- BSHMethodDeclaration jjtn000 = new BSHMethodDeclaration(JJTMETHODDECLARATION);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);Token t = null;
- try {
- if (jj_2_2(2147483647)) {
- ReturnType();
- t = jj_consume_token(IDENTIFIER);
- jjtn000.name = t.image;
- FormalParameters();
- Block();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IDENTIFIER:
- t = jj_consume_token(IDENTIFIER);
- jjtn000.name = t.image;
- FormalParameters();
- Block();
- break;
- default:
- jj_la1[2] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void MethodDeclarationLookahead() throws ParseException {
- if (jj_2_3(2147483647)) {
- ReturnType();
- jj_consume_token(IDENTIFIER);
- FormalParameters();
- jj_consume_token(LBRACE);
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IDENTIFIER:
- jj_consume_token(IDENTIFIER);
- FormalParameters();
- jj_consume_token(LBRACE);
- break;
- default:
- jj_la1[3] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
- final public void MethodDeclarationTypeLookahead() throws ParseException {
- ReturnType();
- jj_consume_token(IDENTIFIER);
- jj_consume_token(LPAREN);
- }
- final public void ImportDeclaration() throws ParseException {
- /*@bgen(jjtree) ImportDeclaration */
- BSHImportDeclaration jjtn000 = new BSHImportDeclaration(JJTIMPORTDECLARATION);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);Token t = null;
- try {
- if (jj_2_4(2)) {
- jj_consume_token(IMPORT);
- AmbiguousName();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DOT:
- t = jj_consume_token(DOT);
- jj_consume_token(STAR);
- break;
- default:
- jj_la1[4] = jj_gen;
- ;
- }
- jj_consume_token(SEMICOLON);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- if ( t != null )
- jjtn000.importPackage = true;
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IMPORT:
- jj_consume_token(IMPORT);
- jj_consume_token(STAR);
- jj_consume_token(SEMICOLON);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.superImport = true;
- break;
- default:
- jj_la1[5] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void VariableDeclarator() throws ParseException {
- /*@bgen(jjtree) VariableDeclarator */
- BSHVariableDeclarator jjtn000 = new BSHVariableDeclarator(JJTVARIABLEDECLARATOR);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);Token t;
- try {
- t = jj_consume_token(IDENTIFIER);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ASSIGN:
- jj_consume_token(ASSIGN);
- VariableInitializer();
- break;
- default:
- jj_la1[6] = jj_gen;
- ;
- }
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.name = t.image;
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- /*
- Can get rid of this if we ignore postfix array dimensions in declarations.
- I don't like them and I don't want to deal with them right now.
- void VariableDeclaratorId() #VariableDeclaratorId :
- { Token t; }
- {
- t=<IDENTIFIER> { jjtThis.name = t.image; }
- ( "[" "]" { jjtThis.addArrayDimension(); } )*
- }
- */
- final public void VariableInitializer() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACE:
- ArrayInitializer();
- break;
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case BANG:
- case TILDE:
- case INCR:
- case DECR:
- case PLUS:
- case MINUS:
- Expression();
- break;
- default:
- jj_la1[7] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- final public void ArrayInitializer() throws ParseException {
- /*@bgen(jjtree) ArrayInitializer */
- BSHArrayInitializer jjtn000 = new BSHArrayInitializer(JJTARRAYINITIALIZER);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- jj_consume_token(LBRACE);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case LBRACE:
- case BANG:
- case TILDE:
- case INCR:
- case DECR:
- case PLUS:
- case MINUS:
- VariableInitializer();
- label_1:
- while (true) {
- if (jj_2_5(2)) {
- ;
- } else {
- break label_1;
- }
- jj_consume_token(COMMA);
- VariableInitializer();
- }
- break;
- default:
- jj_la1[8] = jj_gen;
- ;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- jj_consume_token(COMMA);
- break;
- default:
- jj_la1[9] = jj_gen;
- ;
- }
- jj_consume_token(RBRACE);
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void FormalParameters() throws ParseException {
- /*@bgen(jjtree) FormalParameters */
- BSHFormalParameters jjtn000 = new BSHFormalParameters(JJTFORMALPARAMETERS);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- jj_consume_token(LPAREN);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FLOAT:
- case INT:
- case LONG:
- case SHORT:
- case IDENTIFIER:
- FormalParameter();
- label_2:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- jj_la1[10] = jj_gen;
- break label_2;
- }
- jj_consume_token(COMMA);
- FormalParameter();
- }
- break;
- default:
- jj_la1[11] = jj_gen;
- ;
- }
- jj_consume_token(RPAREN);
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- /*
- void FormalParameter() #FormalParameter :
- { Token t; }
- {
- // added [] to Type for bsh. Removed [ final ] - is that legal?
- [ LOOKAHEAD(2) Type() ] t=<IDENTIFIER> { jjtThis.name = t.image; }
- }
- */
- final public void FormalParameter() throws ParseException {
- /*@bgen(jjtree) FormalParameter */
- BSHFormalParameter jjtn000 = new BSHFormalParameter(JJTFORMALPARAMETER);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);Token t;
- try {
- if (jj_2_6(2)) {
- Type();
- t = jj_consume_token(IDENTIFIER);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.name = t.image;
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IDENTIFIER:
- t = jj_consume_token(IDENTIFIER);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.name = t.image;
- break;
- default:
- jj_la1[12] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- /*
- Type, name and expression syntax follows.
- */
- final public void Type() throws ParseException {
- /*@bgen(jjtree) Type */
- BSHType jjtn000 = new BSHType(JJTTYPE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FLOAT:
- case INT:
- case LONG:
- case SHORT:
- PrimitiveType();
- break;
- case IDENTIFIER:
- AmbiguousName();
- break;
- default:
- jj_la1[13] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- label_3:
- while (true) {
- if (jj_2_7(2)) {
- ;
- } else {
- break label_3;
- }
- jj_consume_token(LBRACKET);
- jj_consume_token(RBRACKET);
- jjtn000.addArrayDimension();
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- /*
- Originally called ResultType in the grammar
- */
- final public void ReturnType() throws ParseException {
- /*@bgen(jjtree) ReturnType */
- BSHReturnType jjtn000 = new BSHReturnType(JJTRETURNTYPE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case VOID:
- jj_consume_token(VOID);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.isVoid = true;
- break;
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FLOAT:
- case INT:
- case LONG:
- case SHORT:
- case IDENTIFIER:
- Type();
- break;
- default:
- jj_la1[14] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void PrimitiveType() throws ParseException {
- /*@bgen(jjtree) PrimitiveType */
- BSHPrimitiveType jjtn000 = new BSHPrimitiveType(JJTPRIMITIVETYPE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- jj_consume_token(BOOLEAN);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.type = Boolean.TYPE;
- break;
- case CHAR:
- jj_consume_token(CHAR);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.type = Character.TYPE;
- break;
- case BYTE:
- jj_consume_token(BYTE);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.type = Byte.TYPE;
- break;
- case SHORT:
- jj_consume_token(SHORT);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.type = Short.TYPE;
- break;
- case INT:
- jj_consume_token(INT);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.type = Integer.TYPE;
- break;
- case LONG:
- jj_consume_token(LONG);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.type = Long.TYPE;
- break;
- case FLOAT:
- jj_consume_token(FLOAT);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.type = Float.TYPE;
- break;
- case DOUBLE:
- jj_consume_token(DOUBLE);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.type = Double.TYPE;
- break;
- default:
- jj_la1[15] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void AmbiguousName() throws ParseException {
- /*@bgen(jjtree) AmbiguousName */
- BSHAmbiguousName jjtn000 = new BSHAmbiguousName(JJTAMBIGUOUSNAME);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);Token t;
- StringBuffer s;
- try {
- t = jj_consume_token(IDENTIFIER);
- s = new StringBuffer(t.image);
- label_4:
- while (true) {
- if (jj_2_8(2)) {
- ;
- } else {
- break label_4;
- }
- jj_consume_token(DOT);
- t = jj_consume_token(IDENTIFIER);
- s.append("."+t.image);
- }
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- jjtreeCloseNodeScope(jjtn000);
- jjtn000.text = s.toString();
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- /*
- * Expression syntax follows.
- */
- final public void Expression() throws ParseException {
- if (jj_2_9(2147483647)) {
- Assignment();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case BANG:
- case TILDE:
- case INCR:
- case DECR:
- case PLUS:
- case MINUS:
- ConditionalExpression();
- break;
- default:
- jj_la1[16] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
- final public void Assignment() throws ParseException {
- /*@bgen(jjtree) Assignment */
- BSHAssignment jjtn000 = new BSHAssignment(JJTASSIGNMENT);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);int op ;
- try {
- LHSPrimaryExpression();
- op = AssignmentOperator();
- jjtn000.operator = op;
- Expression();
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public int AssignmentOperator() throws ParseException {
- Token t;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ASSIGN:
- jj_consume_token(ASSIGN);
- break;
- case STARASSIGN:
- jj_consume_token(STARASSIGN);
- break;
- case SLASHASSIGN:
- jj_consume_token(SLASHASSIGN);
- break;
- case MODASSIGN:
- jj_consume_token(MODASSIGN);
- break;
- case PLUSASSIGN:
- jj_consume_token(PLUSASSIGN);
- break;
- case MINUSASSIGN:
- jj_consume_token(MINUSASSIGN);
- break;
- case ANDASSIGN:
- jj_consume_token(ANDASSIGN);
- break;
- case XORASSIGN:
- jj_consume_token(XORASSIGN);
- break;
- case ORASSIGN:
- jj_consume_token(ORASSIGN);
- break;
- case LSHIFTASSIGN:
- jj_consume_token(LSHIFTASSIGN);
- break;
- case LSHIFTASSIGNX:
- jj_consume_token(LSHIFTASSIGNX);
- break;
- case RSIGNEDSHIFTASSIGN:
- jj_consume_token(RSIGNEDSHIFTASSIGN);
- break;
- case RSIGNEDSHIFTASSIGNX:
- jj_consume_token(RSIGNEDSHIFTASSIGNX);
- break;
- case RUNSIGNEDSHIFTASSIGN:
- jj_consume_token(RUNSIGNEDSHIFTASSIGN);
- break;
- case RUNSIGNEDSHIFTASSIGNX:
- jj_consume_token(RUNSIGNEDSHIFTASSIGNX);
- break;
- default:
- jj_la1[17] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- t = getToken(0);
- {if (true) return t.kind;}
- throw new Error("Missing return statement in function");
- }
- final public void ConditionalExpression() throws ParseException {
- ConditionalOrExpression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case HOOK:
- jj_consume_token(HOOK);
- Expression();
- jj_consume_token(COLON);
- BSHTernaryExpression jjtn001 = new BSHTernaryExpression(JJTTERNARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- ConditionalExpression();
- } catch (Throwable jjte001) {
- if (jjtc001) {
- jjtree.clearNodeScope(jjtn001);
- jjtc001 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte001 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte001;}
- }
- if (jjte001 instanceof ParseException) {
- {if (true) throw (ParseException)jjte001;}
- }
- {if (true) throw (Error)jjte001;}
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 3);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- break;
- default:
- jj_la1[18] = jj_gen;
- ;
- }
- }
- final public void ConditionalOrExpression() throws ParseException {
- Token t=null;
- ConditionalAndExpression();
- label_5:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOL_OR:
- case BOOL_ORX:
- ;
- break;
- default:
- jj_la1[19] = jj_gen;
- break label_5;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOL_OR:
- t = jj_consume_token(BOOL_OR);
- break;
- case BOOL_ORX:
- t = jj_consume_token(BOOL_ORX);
- break;
- default:
- jj_la1[20] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- ConditionalAndExpression();
- BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- }
- }
- final public void ConditionalAndExpression() throws ParseException {
- Token t=null;
- InclusiveOrExpression();
- label_6:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOL_AND:
- case BOOL_ANDX:
- ;
- break;
- default:
- jj_la1[21] = jj_gen;
- break label_6;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOL_AND:
- t = jj_consume_token(BOOL_AND);
- break;
- case BOOL_ANDX:
- t = jj_consume_token(BOOL_ANDX);
- break;
- default:
- jj_la1[22] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- InclusiveOrExpression();
- BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- }
- }
- final public void InclusiveOrExpression() throws ParseException {
- Token t=null;
- ExclusiveOrExpression();
- label_7:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BIT_OR:
- case BIT_ORX:
- ;
- break;
- default:
- jj_la1[23] = jj_gen;
- break label_7;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BIT_OR:
- t = jj_consume_token(BIT_OR);
- break;
- case BIT_ORX:
- t = jj_consume_token(BIT_ORX);
- break;
- default:
- jj_la1[24] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- ExclusiveOrExpression();
- BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- }
- }
- final public void ExclusiveOrExpression() throws ParseException {
- Token t=null;
- AndExpression();
- label_8:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case XOR:
- ;
- break;
- default:
- jj_la1[25] = jj_gen;
- break label_8;
- }
- t = jj_consume_token(XOR);
- AndExpression();
- BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- }
- }
- final public void AndExpression() throws ParseException {
- Token t=null;
- EqualityExpression();
- label_9:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BIT_AND:
- case BIT_ANDX:
- ;
- break;
- default:
- jj_la1[26] = jj_gen;
- break label_9;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BIT_AND:
- t = jj_consume_token(BIT_AND);
- break;
- case BIT_ANDX:
- t = jj_consume_token(BIT_ANDX);
- break;
- default:
- jj_la1[27] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- EqualityExpression();
- BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- }
- }
- final public void EqualityExpression() throws ParseException {
- Token t = null;
- InstanceOfExpression();
- label_10:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case EQ:
- case NE:
- ;
- break;
- default:
- jj_la1[28] = jj_gen;
- break label_10;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case EQ:
- t = jj_consume_token(EQ);
- break;
- case NE:
- t = jj_consume_token(NE);
- break;
- default:
- jj_la1[29] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- InstanceOfExpression();
- BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- }
- }
- final public void InstanceOfExpression() throws ParseException {
- Token t = null;
- RelationalExpression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INSTANCEOF:
- t = jj_consume_token(INSTANCEOF);
- Type();
- BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- break;
- default:
- jj_la1[30] = jj_gen;
- ;
- }
- }
- final public void RelationalExpression() throws ParseException {
- Token t = null;
- ShiftExpression();
- label_11:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case GT:
- case GTX:
- case LT:
- case LTX:
- case LE:
- case LEX:
- case GE:
- case GEX:
- ;
- break;
- default:
- jj_la1[31] = jj_gen;
- break label_11;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LT:
- t = jj_consume_token(LT);
- break;
- case LTX:
- t = jj_consume_token(LTX);
- break;
- case GT:
- t = jj_consume_token(GT);
- break;
- case GTX:
- t = jj_consume_token(GTX);
- break;
- case LE:
- t = jj_consume_token(LE);
- break;
- case LEX:
- t = jj_consume_token(LEX);
- break;
- case GE:
- t = jj_consume_token(GE);
- break;
- case GEX:
- t = jj_consume_token(GEX);
- break;
- default:
- jj_la1[32] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- ShiftExpression();
- BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- }
- }
- final public void ShiftExpression() throws ParseException {
- Token t = null;
- AdditiveExpression();
- label_12:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LSHIFT:
- case LSHIFTX:
- case RSIGNEDSHIFT:
- case RSIGNEDSHIFTX:
- case RUNSIGNEDSHIFT:
- case RUNSIGNEDSHIFTX:
- ;
- break;
- default:
- jj_la1[33] = jj_gen;
- break label_12;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LSHIFT:
- t = jj_consume_token(LSHIFT);
- break;
- case LSHIFTX:
- t = jj_consume_token(LSHIFTX);
- break;
- case RSIGNEDSHIFT:
- t = jj_consume_token(RSIGNEDSHIFT);
- break;
- case RSIGNEDSHIFTX:
- t = jj_consume_token(RSIGNEDSHIFTX);
- break;
- case RUNSIGNEDSHIFT:
- t = jj_consume_token(RUNSIGNEDSHIFT);
- break;
- case RUNSIGNEDSHIFTX:
- t = jj_consume_token(RUNSIGNEDSHIFTX);
- break;
- default:
- jj_la1[34] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- AdditiveExpression();
- BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- }
- }
- final public void AdditiveExpression() throws ParseException {
- Token t = null;
- MultiplicativeExpression();
- label_13:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PLUS:
- case MINUS:
- ;
- break;
- default:
- jj_la1[35] = jj_gen;
- break label_13;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PLUS:
- t = jj_consume_token(PLUS);
- break;
- case MINUS:
- t = jj_consume_token(MINUS);
- break;
- default:
- jj_la1[36] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- MultiplicativeExpression();
- BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- }
- }
- final public void MultiplicativeExpression() throws ParseException {
- Token t = null;
- UnaryExpression();
- label_14:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STAR:
- case SLASH:
- case MOD:
- ;
- break;
- default:
- jj_la1[37] = jj_gen;
- break label_14;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STAR:
- t = jj_consume_token(STAR);
- break;
- case SLASH:
- t = jj_consume_token(SLASH);
- break;
- case MOD:
- t = jj_consume_token(MOD);
- break;
- default:
- jj_la1[38] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- UnaryExpression();
- BSHBinaryExpression jjtn001 = new BSHBinaryExpression(JJTBINARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 2);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- }
- }
- final public void UnaryExpression() throws ParseException {
- Token t = null;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PLUS:
- case MINUS:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PLUS:
- t = jj_consume_token(PLUS);
- break;
- case MINUS:
- t = jj_consume_token(MINUS);
- break;
- default:
- jj_la1[39] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- UnaryExpression();
- BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 1);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 1);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- break;
- case INCR:
- PreIncrementExpression();
- break;
- case DECR:
- PreDecrementExpression();
- break;
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case BANG:
- case TILDE:
- UnaryExpressionNotPlusMinus();
- break;
- default:
- jj_la1[40] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- final public void PreIncrementExpression() throws ParseException {
- Token t = null;
- t = jj_consume_token(INCR);
- LHSPrimaryExpression();
- BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 1);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 1);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- }
- final public void PreDecrementExpression() throws ParseException {
- Token t = null;
- t = jj_consume_token(DECR);
- LHSPrimaryExpression();
- BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 1);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 1);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- }
- final public void UnaryExpressionNotPlusMinus() throws ParseException {
- Token t = null;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BANG:
- case TILDE:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case TILDE:
- t = jj_consume_token(TILDE);
- break;
- case BANG:
- t = jj_consume_token(BANG);
- break;
- default:
- jj_la1[41] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- UnaryExpression();
- BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 1);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 1);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- break;
- default:
- jj_la1[42] = jj_gen;
- if (jj_2_10(2147483647)) {
- CastExpression();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- PostfixExpression();
- break;
- default:
- jj_la1[43] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
- }
- // This production is to determine lookahead only.
- final public void CastLookahead() throws ParseException {
- if (jj_2_11(2)) {
- jj_consume_token(LPAREN);
- PrimitiveType();
- } else if (jj_2_12(2147483647)) {
- jj_consume_token(LPAREN);
- AmbiguousName();
- jj_consume_token(LBRACKET);
- jj_consume_token(RBRACKET);
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
- jj_consume_token(LPAREN);
- AmbiguousName();
- jj_consume_token(RPAREN);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case TILDE:
- jj_consume_token(TILDE);
- break;
- case BANG:
- jj_consume_token(BANG);
- break;
- case LPAREN:
- jj_consume_token(LPAREN);
- break;
- case IDENTIFIER:
- jj_consume_token(IDENTIFIER);
- break;
- case NEW:
- jj_consume_token(NEW);
- break;
- case FALSE:
- case NULL:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- Literal();
- break;
- default:
- jj_la1[44] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- break;
- default:
- jj_la1[45] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
- final public void PostfixExpression() throws ParseException {
- Token t = null;
- if (jj_2_13(2147483647)) {
- LHSPrimaryExpression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INCR:
- t = jj_consume_token(INCR);
- break;
- case DECR:
- t = jj_consume_token(DECR);
- break;
- default:
- jj_la1[46] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- BSHUnaryExpression jjtn001 = new BSHUnaryExpression(JJTUNARYEXPRESSION);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- jjtreeOpenNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, 1);
- jjtc001 = false;
- jjtreeCloseNodeScope(jjtn001);
- jjtn001.kind = t.kind; jjtn001.postfix = true;
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, 1);
- jjtreeCloseNodeScope(jjtn001);
- }
- }
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- PrimaryExpression();
- break;
- default:
- jj_la1[47] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
- final public void CastExpression() throws ParseException {
- /*@bgen(jjtree) CastExpression */
- BSHCastExpression jjtn000 = new BSHCastExpression(JJTCASTEXPRESSION);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- jjtreeOpenNodeScope(jjtn000);
- try {
- if (jj_2_14(2147483647)) {
- jj_consume_token(LPAREN);
- Type();
- jj_consume_token(RPAREN);
- UnaryExpression();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
- jj_consume_token(LPAREN);
- Type();
- jj_consume_token(RPAREN);
- UnaryExpressionNotPlusMinus();
- break;
- default:
- jj_la1[48] = jj_gen;
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- jjtreeCloseNodeScope(jjtn000);
- }
- }
- }
- final public void PrimaryExpression() throws ParseException {
- /*@bgen(jjtree) PrimaryExpression */
- BSHPrimaryExpression jjtn000 = new BSHPrimaryExpression(JJTPRIMA…
Large files files are truncated, but you can click here to view the full file