public static void main( String [] args ) throws IOException, ParseException { boolean print = false; int i=0; if ( args[0].equals("-p") ) { i++; print=true; } for(; i< args.length; i++) { Reader in = new FileReader(args[i]); Parser parser = new Parser(in); parser.setRetainComments(true); while( !parser.Line()/*eof*/ ) if ( print ) System.out.println( parser.popNode() ); } }
final public void PrimaryPrefix() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FALSE: case NULL: case STRING_LITERAL: case LONG_STRING_LITERAL: Literal(); break; case LPAREN: jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); break; case NEW: AllocationExpression(); break; default: if (jj_2_14(2147483647)) { MethodInvocation(); } else if (jj_2_15(2147483647)) { Type(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: AmbiguousName(); break; default: jj_consume_token(-1); throw new ParseException();
boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_18(2)) { jj_consume_token(NEW); PrimitiveType(); ArrayDimensions(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case NEW: jj_consume_token(NEW); AmbiguousName(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LT: TypeArguments(); break; default: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ArrayDimensions(); break; case LPAREN: Arguments(); if (jj_2_17(2)) { Block(); } else {
final public int NameList() throws ParseException { int count = 0; AmbiguousName(); ++count; label_6: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: break label_6; } jj_consume_token(COMMA); AmbiguousName(); ++count; } {if (true) return count;} throw new Error("Missing return statement in function"); }
final public int NameList() throws ParseException {int count = 1; AmbiguousName(); label_9: while (true) { switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case COMMA:{ break; } default: jj_la1[33] = jj_gen; break label_9; } jj_consume_token(COMMA); AmbiguousName(); ++count; } {if ("" != null) return count;} throw new IllegalStateException ("Missing return statement in function"); }
final public void Statement() throws ParseException { if (jj_2_20(2)) { LabeledStatement(); } else if (jj_2_21(3)) { Block(); } else { switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case SEMICOLON:{ EmptyStatement(); break; case PLUS: case MINUS:{ StatementExpression(); jj_consume_token(SEMICOLON); break; SwitchStatement(); break; IfStatement(); break; WhileStatement(); break; DoStatement(); break;
final public void Statement() throws ParseException { if (jj_2_22(2)) { LabeledStatement(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: EmptyStatement(); break; case BOOLEAN: case PLUS: case MINUS: StatementExpression(); jj_consume_token(SEMICOLON); break; case SWITCH: SwitchStatement(); break; case IF: IfStatement(); break; case WHILE: WhileStatement(); break; case DO: DoStatement(); break;
final public void PrimaryPrefix() throws ParseException { switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case FALSE: case NULL: case STRING_LITERAL: case LONG_STRING_LITERAL:{ Literal(); break; jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); break; case LBRACE: case LBRACKET:{ AllocationExpression(); break; if (jj_2_11(2147483647)) { MethodInvocation(); } else if (jj_2_12(2147483647)) { Type(); } else { switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case IDENTIFIER:{ AmbiguousName(); break;
boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; Modifiers mods; int count; try { mods = Modifiers(Modifiers.METHOD, false); jjtn000.modifiers = mods; if (jj_2_2(2147483647)) { t = jj_consume_token(IDENTIFIER); jjtn000.name = t.image; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case VOID: case IDENTIFIER: ReturnType(); t = jj_consume_token(IDENTIFIER); jjtn000.name = t.image; break; default: jj_consume_token(-1); throw new ParseException(); FormalParameters(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case THROWS:
boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; Modifiers mods; int count; try { mods = Modifiers(Modifiers.METHOD, false); if (null != mods) jjtn000.modifiers = mods; if (jj_2_3(2147483647)) { t = jj_consume_token(IDENTIFIER); jjtn000.name = t.image; } else { switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case BOOLEAN: case BYTE: case VOID: case IDENTIFIER:{ ReturnType(); t = jj_consume_token(IDENTIFIER); jjtn000.name = t.image; break; jj_consume_token(-1); throw new ParseException(); FormalParameters(); switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case THROWS:{
boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case NEW:{ jj_consume_token(NEW); switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case BOOLEAN: case BYTE: case LONG: case SHORT:{ PrimitiveType(); ArrayDimensions(); break; AmbiguousName(); switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case LBRACE: case LBRACKET:{ ArrayDimensions(); break; Arguments(); if (jj_2_16(2)) { Block(); } else {
boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; try { if (jj_2_13(2)) { jj_consume_token(DOT); jj_consume_token(CLASS); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; if (jjtree.nodeCreated()) { jjtreeCloseNodeScope(jjtn000); switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case LBRACKET:{ jj_consume_token(LBRACKET); switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case BOOLEAN: case BYTE: case PLUS: case MINUS:{ Expression(); jjtn000.hasLeftIndex = true; break; switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case COLON:{ jj_consume_token(COLON); jjtn000.slice = true;
boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_21(2)) { label_19: while (true) { jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); jjtn000.addDefinedDimension(); if (jj_2_19(2)) { if (jj_2_20(2)) { jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addUndefinedDimension(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: label_21: while (true) { jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addUndefinedDimension(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET:
boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_19(2)) { label_15: while (true) { jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); jjtn000.addDefinedDimension(); if (jj_2_17(2)) { } else { break label_15; if (jj_2_18(2)) { } else { break label_16; jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); jjtn000.addUndefinedDimension(); switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case LBRACKET:{ label_17: while (true) { jj_consume_token(LBRACKET); jj_consume_token(RBRACKET);
boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Modifiers mods; Token name; int numInterfaces; try { mods = Modifiers(Modifiers.CLASS, false); switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case CLASS: case INTERFACE:{ switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case CLASS:{ jj_consume_token(CLASS); jjtn000.type = ClassGenerator.Type.CLASS; name = jj_consume_token(IDENTIFIER); switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case EXTENDS:{ jj_consume_token(EXTENDS); AmbiguousName(); jjtn000.extend = true; break; switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case IMPLEMENTS:{ jj_consume_token(IMPLEMENTS); numInterfaces = NameList(); jjtn000.numInterfaces=numInterfaces; break;
boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Modifiers mods; Token name; int numInterfaces; try { mods = Modifiers(Modifiers.CLASS, false); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CLASS: jj_consume_token(CLASS); break; case INTERFACE: jj_consume_token(INTERFACE); jjtn000.isInterface=true; break; default: jj_consume_token(-1); throw new ParseException(); name = jj_consume_token(IDENTIFIER); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EXTENDS: jj_consume_token(EXTENDS); AmbiguousName(); jjtn000.extend = true; break; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IMPLEMENTS:
final public void CastLookahead() throws ParseException { if (jj_2_10(2)) { jj_consume_token(LPAREN); PrimitiveType(); } else if (jj_2_11(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);
boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);boolean closed = false; try { jj_consume_token(TRY); Block(); label_27: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CATCH: jj_consume_token(CATCH); jj_consume_token(LPAREN); FormalParameter(); jj_consume_token(RPAREN); Block(); closed = true; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FINALLY: jj_consume_token(FINALLY); Block(); closed = true; break; jjtreeCloseNodeScope(jjtn000); if ( !closed ) {if (true) throw generateParseException();} } catch (Throwable jjte000) { if (jjtc000) {
boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);boolean closed = false; try { jj_consume_token(TRY); switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case LPAREN:{ TryWithResources(); break; Block(); label_23: while (true) { switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case CATCH:{ break; jj_consume_token(CATCH); jj_consume_token(LPAREN); MultiCatch(); jj_consume_token(RPAREN); Block(); closed = true; switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) { case FINALLY:{ jj_consume_token(FINALLY); Block(); closed = true;
boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);Token t = null; try { if (jj_2_16(2)) { jj_consume_token(DOT); jj_consume_token(CLASS); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.CLASS; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000.operation = BSHPrimarySuffix.INDEX; break; case DOT: jj_consume_token(DOT); t = jj_consume_token(IDENTIFIER); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: Arguments(); break;