From: kpouer Date: Tue, 6 May 2003 22:24:05 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://secure.phpeclipse.com?hp=5556678d6dc20ca6f47a439e3bf4a1a842308be7 *** empty log message *** --- diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.java b/net.sourceforge.phpeclipse/src/test/PHPParser.java index 4351df6..dd592a2 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.java +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.java @@ -62,6 +62,12 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon private static AstNode[] nodes; /** The cursor in expression stack. */ private static int nodePtr; + private static VariableDeclaration[] variableDeclarationStack; + private static int variableDeclarationPtr; + private static Statement[] statementStack; + private static int statementPtr; + private static ElseIf[] elseIfStack; + private static int elseIfPtr; public final void setFileToParse(final IFile fileToParse) { this.fileToParse = fileToParse; @@ -80,7 +86,11 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon */ private static final void init() { nodes = new AstNode[AstStackIncrement]; + statementStack = new Statement[AstStackIncrement]; + elseIfStack = new ElseIf[AstStackIncrement]; nodePtr = -1; + statementPtr = -1; + elseIfPtr = -1; htmlStart = 0; } @@ -101,6 +111,45 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon } } + private static final void pushOnVariableDeclarationStack(VariableDeclaration var) { + try { + variableDeclarationStack[++variableDeclarationPtr] = var; + } catch (IndexOutOfBoundsException e) { + int oldStackLength = variableDeclarationStack.length; + VariableDeclaration[] oldStack = variableDeclarationStack; + variableDeclarationStack = new VariableDeclaration[oldStackLength + AstStackIncrement]; + System.arraycopy(oldStack, 0, variableDeclarationStack, 0, oldStackLength); + variableDeclarationPtr = oldStackLength; + variableDeclarationStack[variableDeclarationPtr] = var; + } + } + + private static final void pushOnStatementStack(Statement statement) { + try { + statementStack[++statementPtr] = statement; + } catch (IndexOutOfBoundsException e) { + int oldStackLength = statementStack.length; + Statement[] oldStack = statementStack; + statementStack = new Statement[oldStackLength + AstStackIncrement]; + System.arraycopy(oldStack, 0, statementStack, 0, oldStackLength); + statementPtr = oldStackLength; + statementStack[statementPtr] = statement; + } + } + + private static final void pushOnElseIfStack(ElseIf elseIf) { + try { + elseIfStack[++elseIfPtr] = elseIf; + } catch (IndexOutOfBoundsException e) { + int oldStackLength = elseIfStack.length; + ElseIf[] oldStack = elseIfStack; + elseIfStack = new ElseIf[oldStackLength + AstStackIncrement]; + System.arraycopy(oldStack, 0, elseIfStack, 0, oldStackLength); + elseIfPtr = oldStackLength; + elseIfStack[elseIfPtr] = elseIf; + } + } + public static final void phpParserTester(final String strEval) throws CoreException, ParseException { PHPParserTokenManager.SwitchTo(PHPParserTokenManager.PHPPARSING); final StringReader stream = new StringReader(strEval); @@ -147,6 +196,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon init(); try { parse(); + phpDocument = new PHPDocument(null); + phpDocument.nodes = nodes; //PHPeclipsePlugin.log(1,phpDocument.toString()); } catch (ParseException e) { processParseException(e); @@ -686,11 +737,13 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon */ static final public FieldDeclaration FieldDeclaration() throws ParseException { VariableDeclaration variableDeclaration; - final ArrayList list = new ArrayList(); + variableDeclarationPtr = 0; + variableDeclarationStack = new VariableDeclaration[AstStackIncrement]; + VariableDeclaration[] list; final int pos = SimpleCharStream.getPosition(); jj_consume_token(VAR); variableDeclaration = VariableDeclarator(); - list.add(variableDeclaration); + pushOnVariableDeclarationStack(variableDeclaration); outlineInfo.addVariable(new String(variableDeclaration.name)); currentSegment.add(variableDeclaration); label_4: @@ -705,7 +758,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon } jj_consume_token(COMMA); variableDeclaration = VariableDeclarator(); - list.add(variableDeclaration); + pushOnVariableDeclarationStack(variableDeclaration); outlineInfo.addVariable(new String(variableDeclaration.name)); currentSegment.add(variableDeclaration); } @@ -718,7 +771,9 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon errorEnd = jj_input_stream.getPosition() + 1; {if (true) throw e;} } - {if (true) return new FieldDeclaration((VariableDeclaration[]) list.toArray(), + list = new VariableDeclaration[variableDeclarationPtr]; + System.arraycopy(variableDeclarationStack,0,list,0,variableDeclarationPtr); + {if (true) return new FieldDeclaration(list, pos, SimpleCharStream.getPosition());} throw new Error("Missing return statement in function"); @@ -1032,7 +1087,9 @@ Expression expr2 = null; ; } jj_consume_token(RPAREN); - {if (true) return (ArrayVariableDeclaration[]) list.toArray();} + ArrayVariableDeclaration[] vars = new ArrayVariableDeclaration[list.size()]; + list.toArray(vars); + {if (true) return vars;} throw new Error("Missing return statement in function"); } @@ -2428,26 +2485,8 @@ final int pos = SimpleCharStream.getPosition(); ArgumentDeclaration[] args = null; jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ARRAY: - case LIST: - case PRINT: - case NEW: - case NULL: - case TRUE: - case FALSE: - case AT: case DOLLAR: - case BANG: - case INCR: - case DECR: - case PLUS: - case MINUS: case BIT_AND: - case INTEGER_LITERAL: - case FLOATING_POINT_LITERAL: - case STRING_LITERAL: - case IDENTIFIER: - case LPAREN: case DOLLAR_ID: args = ArgumentList(); break; @@ -2469,10 +2508,11 @@ ArgumentDeclaration[] args = null; } static final public ArgumentDeclaration[] ArgumentList() throws ParseException { -Expression expr; +ArgumentDeclaration arg; final ArrayList list = new ArrayList(); - expr = Expression(); - list.add(expr); +ArgumentDeclaration argument; + arg = argumentDeclaration(); + list.add(arg); label_21: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -2485,8 +2525,8 @@ final ArrayList list = new ArrayList(); } jj_consume_token(COMMA); try { - expr = Expression(); - list.add(expr); + arg = argumentDeclaration(); + list.add(arg); } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. An expression expected after a comma in argument list"; errorLevel = ERROR; @@ -2495,7 +2535,53 @@ final ArrayList list = new ArrayList(); {if (true) throw e;} } } - {if (true) return (ArgumentDeclaration[]) list.toArray();} + ArgumentDeclaration[] args = new ArgumentDeclaration[list.size()]; + list.toArray(args); + {if (true) return args;} + throw new Error("Missing return statement in function"); + } + + static final public ArgumentDeclaration argumentDeclaration() throws ParseException { + boolean reference = false; + String varName; + Expression initializer = null; + final int pos = SimpleCharStream.getPosition(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case BIT_AND: + jj_consume_token(BIT_AND); + reference = true; + break; + default: + jj_la1[71] = jj_gen; + ; + } + varName = VariableDeclaratorId(); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ASSIGN: + jj_consume_token(ASSIGN); + try { + initializer = VariableInitializer(); + } catch (ParseException e) { + errorMessage = "Literal expression expected in variable initializer"; + errorLevel = ERROR; + errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = jj_input_stream.getPosition() + 1; + {if (true) throw e;} + } + break; + default: + jj_la1[72] = jj_gen; + ; + } + if (initializer == null) { + {if (true) return new ArgumentDeclaration(varName.toCharArray(), + reference, + pos);} + } + {if (true) return new ArgumentDeclaration(varName.toCharArray(), + reference, + initializer, + pos);} throw new Error("Missing return statement in function"); } @@ -2597,7 +2683,7 @@ final ArrayList list = new ArrayList(); token = jj_consume_token(AT); break; default: - jj_la1[71] = jj_gen; + jj_la1[73] = jj_gen; ; } statement = IncludeStatement(); @@ -2615,7 +2701,7 @@ final ArrayList list = new ArrayList(); {if (true) return statement;} break; default: - jj_la1[72] = jj_gen; + jj_la1[74] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2675,7 +2761,7 @@ final ArrayList list = new ArrayList(); {if (true) return statement;} break; default: - jj_la1[73] = jj_gen; + jj_la1[75] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2697,7 +2783,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[74] = jj_gen; + jj_la1[76] = jj_gen; break label_22; } phpEchoBlock(); @@ -2711,7 +2797,7 @@ final ArrayList list = new ArrayList(); jj_consume_token(PHPSTARTSHORT); break; default: - jj_la1[75] = jj_gen; + jj_la1[77] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2756,7 +2842,7 @@ final ArrayList list = new ArrayList(); keyword = InclusionStatement.INCLUDE_ONCE; break; default: - jj_la1[76] = jj_gen; + jj_la1[78] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2821,7 +2907,7 @@ final ArrayList list = new ArrayList(); list.add(expr); break; default: - jj_la1[77] = jj_gen; + jj_la1[79] = jj_gen; ; } if (expr == null) list.add(null); @@ -2832,7 +2918,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[78] = jj_gen; + jj_la1[80] = jj_gen; break label_23; } try { @@ -2860,13 +2946,20 @@ final ArrayList list = new ArrayList(); case ASSIGN: jj_consume_token(ASSIGN); expression = Expression(); - {if (true) return new ListExpression((String[]) list.toArray(),expression,pos,SimpleCharStream.getPosition());} + String[] strings = new String[list.size()]; + list.toArray(strings); + {if (true) return new ListExpression(strings, + expression, + pos, + SimpleCharStream.getPosition());} break; default: - jj_la1[79] = jj_gen; + jj_la1[81] = jj_gen; ; } - {if (true) return new ListExpression((String[]) list.toArray(),null,pos,SimpleCharStream.getPosition());} + String[] strings = new String[list.size()]; + list.toArray(strings); + {if (true) return new ListExpression(strings,pos,SimpleCharStream.getPosition());} throw new Error("Missing return statement in function"); } @@ -2888,7 +2981,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[80] = jj_gen; + jj_la1[82] = jj_gen; break label_24; } jj_consume_token(COMMA); @@ -2897,7 +2990,9 @@ final ArrayList list = new ArrayList(); } try { jj_consume_token(SEMICOLON); - {if (true) return new EchoStatement((Expression[]) expressions.toArray(),pos);} + Expression[] exprs = new Expression[expressions.size()]; + expressions.toArray(exprs); + {if (true) return new EchoStatement(exprs,pos);} } catch (ParseException e) { if (e.currentToken.next.kind != 4) { errorMessage = "';' expected after 'echo' statement"; @@ -2925,7 +3020,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[81] = jj_gen; + jj_la1[83] = jj_gen; break label_25; } jj_consume_token(COMMA); @@ -2934,10 +3029,12 @@ final ArrayList list = new ArrayList(); } try { jj_consume_token(SEMICOLON); - global = new GlobalStatement(currentSegment, - (String[]) vars.toArray(), - pos, - SimpleCharStream.getPosition()); + String[] strings = new String[vars.size()]; + vars.toArray(strings); + global = new GlobalStatement(currentSegment, + strings, + pos, + SimpleCharStream.getPosition()); currentSegment.add(global); {if (true) return global;} } catch (ParseException e) { @@ -2964,7 +3061,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[82] = jj_gen; + jj_la1[84] = jj_gen; break label_26; } jj_consume_token(COMMA); @@ -2973,7 +3070,9 @@ final ArrayList list = new ArrayList(); } try { jj_consume_token(SEMICOLON); - {if (true) return new StaticStatement((String[])vars.toArray(), + String[] strings = new String[vars.size()]; + vars.toArray(strings); + {if (true) return new StaticStatement(strings, pos, SimpleCharStream.getPosition());} } catch (ParseException e) { @@ -3006,6 +3105,10 @@ final ArrayList list = new ArrayList(); */ static final public Block Block() throws ParseException { final int pos = SimpleCharStream.getPosition(); + Statement[] statements; + Statement statement; + final int startingPtr = statementPtr; + final int length; try { jj_consume_token(LBRACE); } catch (ParseException e) { @@ -3063,7 +3166,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[83] = jj_gen; + jj_la1[85] = jj_gen; break label_27; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -3108,13 +3211,15 @@ final ArrayList list = new ArrayList(); case LBRACE: case SEMICOLON: case DOLLAR_ID: - BlockStatement(); + statement = BlockStatement(); + pushOnStatementStack(statement); break; case PHPEND: - htmlBlock(); + statement = htmlBlock(); + pushOnStatementStack(statement); break; default: - jj_la1[84] = jj_gen; + jj_la1[86] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3128,6 +3233,11 @@ final ArrayList list = new ArrayList(); errorEnd = jj_input_stream.getPosition() + 1; {if (true) throw e;} } + length = statementPtr-startingPtr+1; + statements = new Statement[length]; + System.arraycopy(variableDeclarationStack,startingPtr+1,statements,0,length); + statementPtr = startingPtr; + {if (true) return new Block(statements,pos,SimpleCharStream.getPosition());} throw new Error("Missing return statement in function"); } @@ -3185,7 +3295,7 @@ final ArrayList list = new ArrayList(); {if (true) return statement;} break; default: - jj_la1[85] = jj_gen; + jj_la1[87] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3248,7 +3358,7 @@ final ArrayList list = new ArrayList(); {if (true) return statement;} break; default: - jj_la1[86] = jj_gen; + jj_la1[88] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3267,14 +3377,16 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[87] = jj_gen; + jj_la1[89] = jj_gen; break label_28; } jj_consume_token(COMMA); var = LocalVariableDeclarator(); list.add(var); } - {if (true) return (VariableDeclaration[]) list.toArray();} + VariableDeclaration[] vars = new VariableDeclaration[list.size()]; + list.toArray(vars); + {if (true) return vars;} throw new Error("Missing return statement in function"); } @@ -3289,7 +3401,7 @@ final ArrayList list = new ArrayList(); initializer = Expression(); break; default: - jj_la1[88] = jj_gen; + jj_la1[90] = jj_gen; ; } if (initializer == null) { @@ -3373,18 +3485,18 @@ final ArrayList list = new ArrayList(); Expression(); break; default: - jj_la1[89] = jj_gen; + jj_la1[91] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: - jj_la1[90] = jj_gen; + jj_la1[92] = jj_gen; ; } break; default: - jj_la1[91] = jj_gen; + jj_la1[93] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3434,7 +3546,7 @@ final ArrayList list = new ArrayList(); cases = switchStatementColon(pos, pos + 6); break; default: - jj_la1[92] = jj_gen; + jj_la1[94] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3454,7 +3566,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[93] = jj_gen; + jj_la1[95] = jj_gen; break label_29; } cas = switchLabel0(); @@ -3462,7 +3574,9 @@ final ArrayList list = new ArrayList(); } try { jj_consume_token(RBRACE); - {if (true) return (AbstractCase[]) cases.toArray();} + AbstractCase[] abcase = new AbstractCase[cases.size()]; + cases.toArray(abcase); + {if (true) return abcase;} } catch (ParseException e) { errorMessage = "'}' expected"; errorLevel = ERROR; @@ -3500,7 +3614,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[94] = jj_gen; + jj_la1[96] = jj_gen; break label_30; } cas = switchLabel0(); @@ -3517,7 +3631,9 @@ final ArrayList list = new ArrayList(); } try { jj_consume_token(SEMICOLON); - {if (true) return (AbstractCase[]) cases.toArray();} + AbstractCase[] abcase = new AbstractCase[cases.size()]; + cases.toArray(abcase); + {if (true) return abcase;} } catch (ParseException e) { errorMessage = "';' expected after 'endswitch' keyword"; errorLevel = ERROR; @@ -3581,7 +3697,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[95] = jj_gen; + jj_la1[97] = jj_gen; break label_31; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -3633,7 +3749,7 @@ final ArrayList list = new ArrayList(); stmts.add(statement); break; default: - jj_la1[96] = jj_gen; + jj_la1[98] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3644,13 +3760,15 @@ final ArrayList list = new ArrayList(); stmts.add(statement); break; default: - jj_la1[97] = jj_gen; + jj_la1[99] = jj_gen; ; } - if (expr == null) {//it's a default - {if (true) return new DefaultCase((Statement[]) stmts.toArray(),pos,SimpleCharStream.getPosition());} + Statement[] stmtsArray = new Statement[stmts.size()]; + stmts.toArray(stmtsArray); + if (expr == null) {//it's a default + {if (true) return new DefaultCase(stmtsArray,pos,SimpleCharStream.getPosition());} } - {if (true) return new Case(expr,(Statement[]) stmts.toArray(),pos,SimpleCharStream.getPosition());} + {if (true) return new Case(expr,stmtsArray,pos,SimpleCharStream.getPosition());} throw new Error("Missing return statement in function"); } @@ -3701,7 +3819,7 @@ final ArrayList list = new ArrayList(); } break; default: - jj_la1[98] = jj_gen; + jj_la1[100] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3737,7 +3855,7 @@ final ArrayList list = new ArrayList(); expression = Expression(); break; default: - jj_la1[99] = jj_gen; + jj_la1[101] = jj_gen; ; } try { @@ -3791,14 +3909,19 @@ final ArrayList list = new ArrayList(); static final public IfStatement IfStatement0(Expression condition, final int start,final int end) throws ParseException { Statement statement; + Statement stmt; + final Statement[] statementsArray; ElseIf elseifStatement; Else elseStatement = null; - ArrayList stmts = new ArrayList(); - ArrayList elseifs = new ArrayList(); + ArrayList stmts; + final ArrayList elseIfList = new ArrayList(); + ElseIf[] elseIfs; int pos = SimpleCharStream.getPosition(); + int endStatements; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COLON: jj_consume_token(COLON); + stmts = new ArrayList(); label_32: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -3845,7 +3968,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[100] = jj_gen; + jj_la1[102] = jj_gen; break label_32; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -3896,11 +4019,12 @@ final ArrayList list = new ArrayList(); stmts.add(statement); break; default: - jj_la1[101] = jj_gen; + jj_la1[103] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } + endStatements = SimpleCharStream.getPosition(); label_33: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -3908,18 +4032,18 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[102] = jj_gen; + jj_la1[104] = jj_gen; break label_33; } elseifStatement = ElseIfStatementColon(); - elseifs.add(elseifStatement); + elseIfList.add(elseifStatement); } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ELSE: elseStatement = ElseStatementColon(); break; default: - jj_la1[103] = jj_gen; + jj_la1[105] = jj_gen; ; } try { @@ -3943,11 +4067,6 @@ final ArrayList list = new ArrayList(); } try { jj_consume_token(SEMICOLON); - {if (true) return new IfStatement(condition, - (ElseIf[]) elseifs.toArray(), - elseStatement, - pos, - SimpleCharStream.getPosition());} } catch (ParseException e) { errorMessage = "';' expected after 'endif' keyword"; errorLevel = ERROR; @@ -3955,6 +4074,25 @@ final ArrayList list = new ArrayList(); errorEnd = jj_input_stream.getPosition() + 1; {if (true) throw e;} } + elseIfs = new ElseIf[elseIfList.size()]; + elseIfList.toArray(elseIfs); + if (stmts.size() == 1) { + {if (true) return new IfStatement(condition, + (Statement) stmts.get(0), + elseIfs, + elseStatement, + pos, + SimpleCharStream.getPosition());} + } else { + statementsArray = new Statement[stmts.size()]; + stmts.toArray(statementsArray); + {if (true) return new IfStatement(condition, + new Block(statementsArray,pos,endStatements), + elseIfs, + elseStatement, + pos, + SimpleCharStream.getPosition());} + } break; case PHPEND: case IF: @@ -4036,17 +4174,16 @@ final ArrayList list = new ArrayList(); case LBRACE: case SEMICOLON: case DOLLAR_ID: - statement = Statement(); + stmt = Statement(); break; case PHPEND: - statement = htmlBlock(); + stmt = htmlBlock(); break; default: - jj_la1[104] = jj_gen; + jj_la1[106] = jj_gen; jj_consume_token(-1); throw new ParseException(); } - stmts.add(statement); label_34: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -4054,11 +4191,11 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[105] = jj_gen; + jj_la1[107] = jj_gen; break label_34; } elseifStatement = ElseIfStatement(); - elseifs.add(elseifStatement); + elseIfList.add(elseifStatement); } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ELSE: @@ -4079,17 +4216,20 @@ final ArrayList list = new ArrayList(); } break; default: - jj_la1[106] = jj_gen; + jj_la1[108] = jj_gen; ; } - {if (true) return new IfStatement(condition, - (ElseIf[]) elseifs.toArray(), - elseStatement, - pos, - SimpleCharStream.getPosition());} + elseIfs = new ElseIf[elseIfList.size()]; + elseIfList.toArray(elseIfs); + {if (true) return new IfStatement(condition, + stmt, + elseIfs, + elseStatement, + pos, + SimpleCharStream.getPosition());} break; default: - jj_la1[107] = jj_gen; + jj_la1[109] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -4150,7 +4290,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[108] = jj_gen; + jj_la1[110] = jj_gen; break label_35; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -4201,12 +4341,14 @@ final ArrayList list = new ArrayList(); list.add(statement); break; default: - jj_la1[109] = jj_gen; + jj_la1[111] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } - {if (true) return new ElseIf(condition,(Statement[]) list.toArray(),pos,SimpleCharStream.getPosition());} + Statement[] stmtsArray = new Statement[list.size()]; + list.toArray(stmtsArray); + {if (true) return new ElseIf(condition,stmtsArray ,pos,SimpleCharStream.getPosition());} throw new Error("Missing return statement in function"); } @@ -4262,7 +4404,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[110] = jj_gen; + jj_la1[112] = jj_gen; break label_36; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -4313,12 +4455,14 @@ final ArrayList list = new ArrayList(); list.add(statement); break; default: - jj_la1[111] = jj_gen; + jj_la1[113] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } - {if (true) return new Else((Statement[]) list.toArray(),pos,SimpleCharStream.getPosition());} + Statement[] stmtsArray = new Statement[list.size()]; + list.toArray(stmtsArray); + {if (true) return new Else(stmtsArray,pos,SimpleCharStream.getPosition());} throw new Error("Missing return statement in function"); } @@ -4331,7 +4475,9 @@ final ArrayList list = new ArrayList(); condition = Condition("elseif"); statement = Statement(); list.add(statement);/*todo:do better*/ - {if (true) return new ElseIf(condition,(Statement[]) list.toArray(),pos,SimpleCharStream.getPosition());} + Statement[] stmtsArray = new Statement[list.size()]; + list.toArray(stmtsArray); + {if (true) return new ElseIf(condition,stmtsArray,pos,SimpleCharStream.getPosition());} throw new Error("Missing return statement in function"); } @@ -4398,7 +4544,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[112] = jj_gen; + jj_la1[114] = jj_gen; break label_37; } statement = Statement(); @@ -4425,7 +4571,9 @@ final ArrayList list = new ArrayList(); } try { jj_consume_token(SEMICOLON); - {if (true) return new Block((Statement[]) stmts.toArray(),pos,SimpleCharStream.getPosition());} + Statement[] stmtsArray = new Statement[stmts.size()]; + stmts.toArray(stmtsArray); + {if (true) return new Block(stmtsArray,pos,SimpleCharStream.getPosition());} } catch (ParseException e) { errorMessage = "';' expected after 'endwhile' keyword"; errorLevel = ERROR; @@ -4477,7 +4625,7 @@ final ArrayList list = new ArrayList(); {if (true) return statement;} break; default: - jj_la1[113] = jj_gen; + jj_la1[115] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -4605,7 +4753,7 @@ final int startBlock, endBlock; initializations = ForInit(); break; default: - jj_la1[114] = jj_gen; + jj_la1[116] = jj_gen; ; } jj_consume_token(SEMICOLON); @@ -4634,7 +4782,7 @@ final int startBlock, endBlock; condition = Expression(); break; default: - jj_la1[115] = jj_gen; + jj_la1[117] = jj_gen; ; } jj_consume_token(SEMICOLON); @@ -4649,7 +4797,7 @@ final int startBlock, endBlock; increments = StatementExpressionList(); break; default: - jj_la1[116] = jj_gen; + jj_la1[118] = jj_gen; ; } jj_consume_token(RPAREN); @@ -4744,7 +4892,7 @@ final int startBlock, endBlock; ; break; default: - jj_la1[117] = jj_gen; + jj_la1[119] = jj_gen; break label_38; } action = Statement(); @@ -4772,7 +4920,9 @@ final int startBlock, endBlock; } try { jj_consume_token(SEMICOLON); - {if (true) return new ForStatement(initializations,condition,increments,new Block((Statement[])list.toArray(),startBlock,endBlock),pos,SimpleCharStream.getPosition());} + Statement[] stmtsArray = new Statement[list.size()]; + list.toArray(stmtsArray); + {if (true) return new ForStatement(initializations,condition,increments,new Block(stmtsArray,startBlock,endBlock),pos,SimpleCharStream.getPosition());} } catch (ParseException e) { errorMessage = "';' expected after 'endfor' keyword"; errorLevel = ERROR; @@ -4782,7 +4932,7 @@ final int startBlock, endBlock; } break; default: - jj_la1[118] = jj_gen; + jj_la1[120] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -4807,7 +4957,7 @@ final int startBlock, endBlock; {if (true) return statements;} break; default: - jj_la1[119] = jj_gen; + jj_la1[121] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -4827,14 +4977,16 @@ final int startBlock, endBlock; ; break; default: - jj_la1[120] = jj_gen; + jj_la1[122] = jj_gen; break label_39; } jj_consume_token(COMMA); StatementExpression(); list.add(expr); } - {if (true) return (Statement[]) list.toArray();} + Statement[] stmtsArray = new Statement[list.size()]; + list.toArray(stmtsArray); + {if (true) return stmtsArray;} throw new Error("Missing return statement in function"); } @@ -4867,7 +5019,7 @@ final int startBlock, endBlock; expr = Expression(); break; default: - jj_la1[121] = jj_gen; + jj_la1[123] = jj_gen; ; } try { @@ -4912,7 +5064,7 @@ final int startBlock, endBlock; expr = Expression(); break; default: - jj_la1[122] = jj_gen; + jj_la1[124] = jj_gen; ; } try { @@ -4984,161 +5136,91 @@ final int startBlock, endBlock; return retval; } - static final private boolean jj_3R_157() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_159()) { - jj_scanpos = xsp; - if (jj_3R_160()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_166()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - static final private boolean jj_3R_152() { - if (jj_3R_158()) return true; + static final private boolean jj_3R_147() { + if (jj_scan_token(REMAINDER)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_151() { - if (jj_3R_157()) return true; + static final private boolean jj_3R_146() { + if (jj_scan_token(SLASH)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_156() { - if (jj_scan_token(MINUS)) return true; + static final private boolean jj_3R_145() { + if (jj_scan_token(STAR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_155() { - if (jj_scan_token(PLUS)) return true; + static final private boolean jj_3_7() { + if (jj_3R_46()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_148() { + static final private boolean jj_3R_140() { Token xsp; xsp = jj_scanpos; - if (jj_3R_150()) { + if (jj_3R_145()) { jj_scanpos = xsp; - if (jj_3R_151()) { + if (jj_3R_146()) { jj_scanpos = xsp; - if (jj_3R_152()) return true; + if (jj_3R_147()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - static final private boolean jj_3R_150() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_155()) { - jj_scanpos = xsp; - if (jj_3R_156()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_139()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_154() { - if (jj_3R_148()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - static final private boolean jj_3R_149() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_153()) { - jj_scanpos = xsp; - if (jj_3R_154()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - static final private boolean jj_3R_153() { - if (jj_scan_token(AT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_149()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - static final private boolean jj_3R_144() { - if (jj_3R_149()) return true; + static final private boolean jj_3R_57() { + if (jj_3R_50()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - static final private boolean jj_3R_139() { Token xsp; xsp = jj_scanpos; - if (jj_3R_143()) { - jj_scanpos = xsp; - if (jj_3R_144()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_87()) jj_scanpos = xsp; + else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_143() { - if (jj_scan_token(BIT_AND)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_148()) return true; + static final private boolean jj_3R_58() { + if (jj_scan_token(COMMA)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - static final private boolean jj_3R_147() { - if (jj_scan_token(REMAINDER)) return true; + if (jj_3R_57()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_146() { - if (jj_scan_token(SLASH)) return true; + static final private boolean jj_3_6() { + if (jj_3R_45()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - static final private boolean jj_3R_145() { - if (jj_scan_token(STAR)) return true; + if (jj_scan_token(SEMICOLON)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_140() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_145()) { - jj_scanpos = xsp; - if (jj_3R_146()) { - jj_scanpos = xsp; - if (jj_3R_147()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + static final private boolean jj_3R_134() { if (jj_3R_139()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_140()) { jj_scanpos = xsp; break; } + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } return false; } - static final private boolean jj_3R_134() { - if (jj_3R_139()) return true; + static final private boolean jj_3R_47() { + if (jj_3R_57()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_140()) { jj_scanpos = xsp; break; } + if (jj_3R_58()) { jj_scanpos = xsp; break; } if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } return false; @@ -5181,36 +5263,42 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_87() { - if (jj_scan_token(ASSIGN)) return true; + static final private boolean jj_3R_198() { + if (jj_scan_token(COMMA)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_45()) return true; + return false; + } + + static final private boolean jj_3R_138() { + if (jj_scan_token(RUNSIGNEDSHIFT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_198() { + static final private boolean jj_3_2() { if (jj_scan_token(COMMA)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_41()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3_7() { - if (jj_3R_46()) return true; + static final private boolean jj_3R_137() { + if (jj_scan_token(RSIGNEDSHIFT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3_2() { - if (jj_scan_token(COMMA)) return true; + static final private boolean jj_3R_206() { + if (jj_scan_token(ASSIGN)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_41()) return true; + if (jj_3R_207()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_138() { - if (jj_scan_token(RUNSIGNEDSHIFT)) return true; + static final private boolean jj_3R_136() { + if (jj_scan_token(LSHIFT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } @@ -5235,18 +5323,6 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_137() { - if (jj_scan_token(RSIGNEDSHIFT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - static final private boolean jj_3R_136() { - if (jj_scan_token(LSHIFT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - static final private boolean jj_3R_129() { Token xsp; xsp = jj_scanpos; @@ -5263,6 +5339,12 @@ final int startBlock, endBlock; return false; } + static final private boolean jj_3R_205() { + if (jj_scan_token(BIT_AND)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static final private boolean jj_3R_121() { if (jj_3R_128()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5275,10 +5357,27 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3_6() { - if (jj_3R_45()) return true; + static final private boolean jj_3R_203() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_205()) jj_scanpos = xsp; + else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_50()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(SEMICOLON)) return true; + xsp = jj_scanpos; + if (jj_3R_206()) jj_scanpos = xsp; + else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_216() { + if (jj_scan_token(FLOATING_POINT_LITERAL)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_214() { + if (jj_scan_token(FLOATING_POINT_LITERAL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } @@ -5322,16 +5421,6 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_41() { - if (jj_3R_45()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_201()) jj_scanpos = xsp; - else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - static final private boolean jj_3R_122() { Token xsp; xsp = jj_scanpos; @@ -5363,53 +5452,57 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_57() { - if (jj_3R_50()) return true; + static final private boolean jj_3R_41() { + if (jj_3R_45()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; Token xsp; xsp = jj_scanpos; - if (jj_3R_87()) jj_scanpos = xsp; + if (jj_3R_201()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_203() { + static final private boolean jj_3R_204() { if (jj_scan_token(COMMA)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_45()) return true; + if (jj_3R_203()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_212() { + if (jj_scan_token(IDENTIFIER)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } static final private boolean jj_3R_202() { - if (jj_3R_45()) return true; + if (jj_3R_203()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_203()) { jj_scanpos = xsp; break; } + if (jj_3R_204()) { jj_scanpos = xsp; break; } if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } return false; } - static final private boolean jj_3R_58() { - if (jj_scan_token(COMMA)) return true; + static final private boolean jj_3R_215() { + if (jj_scan_token(INTEGER_LITERAL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_57()) return true; + return false; + } + + static final private boolean jj_3R_211() { + if (jj_3R_182()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_47() { - if (jj_3R_57()) return true; + static final private boolean jj_3R_213() { + if (jj_scan_token(INTEGER_LITERAL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_58()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } return false; } @@ -5419,6 +5512,19 @@ final int startBlock, endBlock; return false; } + static final private boolean jj_3R_210() { + if (jj_scan_token(PLUS)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_215()) { + jj_scanpos = xsp; + if (jj_3R_216()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static final private boolean jj_3R_127() { if (jj_scan_token(TRIPLEEQUAL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5449,12 +5555,59 @@ final int startBlock, endBlock; return false; } + static final private boolean jj_3R_209() { + if (jj_scan_token(MINUS)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_213()) { + jj_scanpos = xsp; + if (jj_3R_214()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static final private boolean jj_3R_93() { if (jj_3R_52()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } + static final private boolean jj_3R_46() { + if (jj_scan_token(IDENTIFIER)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(COLON)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_208() { + if (jj_3R_169()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_207() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_208()) { + jj_scanpos = xsp; + if (jj_3R_209()) { + jj_scanpos = xsp; + if (jj_3R_210()) { + jj_scanpos = xsp; + if (jj_3R_211()) { + jj_scanpos = xsp; + if (jj_3R_212()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static final private boolean jj_3R_199() { if (jj_scan_token(LPAREN)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5501,6 +5654,12 @@ final int startBlock, endBlock; return false; } + static final private boolean jj_3_8() { + if (jj_3R_47()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static final private boolean jj_3R_108() { if (jj_scan_token(LBRACE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5511,14 +5670,14 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_91() { - if (jj_scan_token(DOLLAR_ID)) return true; + static final private boolean jj_3R_177() { + if (jj_scan_token(NULL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_177() { - if (jj_scan_token(NULL)) return true; + static final private boolean jj_3R_91() { + if (jj_scan_token(DOLLAR_ID)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } @@ -5543,14 +5702,6 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_90() { - if (jj_scan_token(DOLLAR)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_59()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - static final private boolean jj_3R_174() { if (jj_scan_token(STRING_LITERAL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5569,6 +5720,14 @@ final int startBlock, endBlock; return false; } + static final private boolean jj_3R_90() { + if (jj_scan_token(DOLLAR)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_59()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static final private boolean jj_3R_173() { if (jj_scan_token(FLOATING_POINT_LITERAL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5767,14 +5926,6 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_46() { - if (jj_scan_token(IDENTIFIER)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(COLON)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - static final private boolean jj_3R_94() { if (jj_scan_token(DOLLAR_ID)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5891,12 +6042,6 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3_1() { - if (jj_3R_40()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - static final private boolean jj_3R_107() { if (jj_scan_token(_ORL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5909,15 +6054,9 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_50() { - if (jj_3R_61()) return true; + static final private boolean jj_3_1() { + if (jj_3R_40()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_1()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } return false; } @@ -5934,6 +6073,18 @@ final int startBlock, endBlock; return false; } + static final private boolean jj_3R_50() { + if (jj_3R_61()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_1()) { jj_scanpos = xsp; break; } + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } + return false; + } + static final private boolean jj_3R_96() { if (jj_3R_102()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -5976,6 +6127,14 @@ final int startBlock, endBlock; return false; } + static final private boolean jj_3R_101() { + if (jj_scan_token(ASSIGN)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_45()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static final private boolean jj_3R_73() { if (jj_scan_token(DOTASSIGN)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6112,16 +6271,18 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3_8() { - if (jj_3R_47()) return true; + static final private boolean jj_3R_182() { + if (jj_scan_token(ARRAY)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_192()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } - static final private boolean jj_3R_182() { - if (jj_scan_token(ARRAY)) return true; + static final private boolean jj_3R_100() { + if (jj_scan_token(COMMA)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_192()) return true; + if (jj_3R_50()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } @@ -6132,6 +6293,12 @@ final int startBlock, endBlock; return false; } + static final private boolean jj_3R_99() { + if (jj_3R_50()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static final private boolean jj_3R_181() { if (jj_3R_188()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6166,14 +6333,6 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_101() { - if (jj_scan_token(ASSIGN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_45()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - static final private boolean jj_3_5() { if (jj_scan_token(IDENTIFIER)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6204,12 +6363,42 @@ final int startBlock, endBlock; return false; } + static final private boolean jj_3R_85() { + if (jj_scan_token(LIST)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_scan_token(LPAREN)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_99()) jj_scanpos = xsp; + else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + while (true) { + xsp = jj_scanpos; + if (jj_3R_100()) { jj_scanpos = xsp; break; } + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } + if (jj_scan_token(RPAREN)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + xsp = jj_scanpos; + if (jj_3R_101()) jj_scanpos = xsp; + else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static final private boolean jj_3_3() { if (jj_3R_42()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; } + static final private boolean jj_3R_84() { + if (jj_scan_token(PRINT)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_45()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static final private boolean jj_3R_56() { if (jj_3R_86()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6284,20 +6473,6 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_100() { - if (jj_scan_token(COMMA)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_50()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - - static final private boolean jj_3R_99() { - if (jj_3R_50()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - static final private boolean jj_3R_83() { if (jj_scan_token(OBJECT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6369,28 +6544,6 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_85() { - if (jj_scan_token(LIST)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_scan_token(LPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_99()) jj_scanpos = xsp; - else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - while (true) { - xsp = jj_scanpos; - if (jj_3R_100()) { jj_scanpos = xsp; break; } - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - } - if (jj_scan_token(RPAREN)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - xsp = jj_scanpos; - if (jj_3R_101()) jj_scanpos = xsp; - else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - static final private boolean jj_3R_78() { if (jj_scan_token(REAL)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6424,14 +6577,6 @@ final int startBlock, endBlock; return false; } - static final private boolean jj_3R_84() { - if (jj_scan_token(PRINT)) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - if (jj_3R_45()) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; - return false; - } - static final private boolean jj_3R_75() { if (jj_scan_token(STRING)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; @@ -6538,6 +6683,128 @@ final int startBlock, endBlock; return false; } + static final private boolean jj_3R_157() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_159()) { + jj_scanpos = xsp; + if (jj_3R_160()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_166()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_152() { + if (jj_3R_158()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_151() { + if (jj_3R_157()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_156() { + if (jj_scan_token(MINUS)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_155() { + if (jj_scan_token(PLUS)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_148() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_150()) { + jj_scanpos = xsp; + if (jj_3R_151()) { + jj_scanpos = xsp; + if (jj_3R_152()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_150() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_155()) { + jj_scanpos = xsp; + if (jj_3R_156()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_139()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_87() { + if (jj_scan_token(ASSIGN)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_45()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_154() { + if (jj_3R_148()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_149() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_153()) { + jj_scanpos = xsp; + if (jj_3R_154()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_153() { + if (jj_scan_token(AT)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_149()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_144() { + if (jj_3R_149()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_139() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_143()) { + jj_scanpos = xsp; + if (jj_3R_144()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + + static final private boolean jj_3R_143() { + if (jj_scan_token(BIT_AND)) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + if (jj_3R_148()) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; + return false; + } + static private boolean jj_initialized_once = false; static public PHPParserTokenManager token_source; static SimpleCharStream jj_input_stream; @@ -6548,7 +6815,7 @@ final int startBlock, endBlock; static public boolean lookingAhead = false; static private boolean jj_semLA; static private int jj_gen; - static final private int[] jj_la1 = new int[123]; + static final private int[] jj_la1 = new int[125]; static private int[] jj_la1_0; static private int[] jj_la1_1; static private int[] jj_la1_2; @@ -6562,19 +6829,19 @@ final int startBlock, endBlock; jj_la1_4(); } private static void jj_la1_0() { - jj_la1_0 = new int[] {0xfcb0001e,0x6,0x6,0xfcb0001e,0x0,0xfcb00000,0x0,0x600000,0x600000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000000,0x0,0x34000000,0x0,0x0,0x0,0x0,0x0,0x0,0x30000000,0x4000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000000,0x4000000,0x0,0x4000000,0x0,0x0,0x4000000,0x4000000,0x0,0x0,0x0,0x0,0x4000000,0x0,0x4000000,0x0,0x0,0x34000000,0x34000000,0x0,0x0,0x34000000,0x0,0x0,0xc4800000,0xfc800000,0x8,0x6,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0xfcb00010,0xfcb00010,0xfcb00000,0xf4b00000,0x0,0x0,0x0,0x0,0x4000000,0x0,0x0,0x0,0xf4b00010,0xf4b00010,0x8000000,0x0,0x34000000,0xfc800010,0xfc800010,0x1000000,0x2000000,0xfc800010,0x1000000,0x2000000,0xfc800010,0xfc800010,0xfc800010,0xfc800010,0xfc800010,0xfc800000,0xfc800000,0x4000000,0x34000000,0x4000000,0xfc800000,0xfc800000,0x4000000,0x0,0x34000000,0x34000000,}; + jj_la1_0 = new int[] {0xfcb0001e,0x6,0x6,0xfcb0001e,0x0,0xfcb00000,0x0,0x600000,0x600000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000000,0x0,0x34000000,0x0,0x0,0x0,0x0,0x0,0x0,0x30000000,0x4000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4000000,0x4000000,0x0,0x4000000,0x0,0x0,0x4000000,0x4000000,0x0,0x0,0x0,0x0,0x4000000,0x0,0x4000000,0x0,0x0,0x34000000,0x34000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc4800000,0xfc800000,0x8,0x6,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0xfcb00010,0xfcb00010,0xfcb00000,0xf4b00000,0x0,0x0,0x0,0x0,0x4000000,0x0,0x0,0x0,0xf4b00010,0xf4b00010,0x8000000,0x0,0x34000000,0xfc800010,0xfc800010,0x1000000,0x2000000,0xfc800010,0x1000000,0x2000000,0xfc800010,0xfc800010,0xfc800010,0xfc800010,0xfc800010,0xfc800000,0xfc800000,0x4000000,0x34000000,0x4000000,0xfc800000,0xfc800000,0x4000000,0x0,0x34000000,0x34000000,}; } private static void jj_la1_1() { - jj_la1_1 = new int[] {0x21d7541f,0x0,0x0,0x21d7541f,0x0,0x21d7541f,0x2000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc20000,0x80,0xc30000,0x0,0x0,0x0,0x0,0x0,0x80000000,0x0,0xc30000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc30000,0xc30000,0x0,0xc30000,0x0,0x0,0xc30000,0x80000000,0x0,0x0,0x20,0x20,0x10000,0x10000,0x10000,0x0,0x20,0x80c30000,0x80c30000,0x20,0xc20000,0xc30000,0x0,0x0,0x2115541f,0x21d7541f,0x0,0x0,0x7,0x0,0x0,0x0,0x0,0x0,0x0,0x21d7541f,0x21d7541f,0x21d7541f,0x21d7541f,0x0,0x0,0x0,0x0,0x10000,0x0,0x900,0x900,0x21d7541f,0x21d7541f,0x0,0x900,0xc30000,0x21d7541f,0x21d7541f,0x0,0x0,0x21d7541f,0x0,0x0,0x21d7541f,0x21d7541f,0x21d7541f,0x21d7541f,0x21d7541f,0x21d7541f,0x21d7541f,0x10000,0xc30000,0x10000,0x21d7541f,0x21d7541f,0x10000,0x0,0xc30000,0xc30000,}; + jj_la1_1 = new int[] {0x21d7541f,0x0,0x0,0x21d7541f,0x0,0x21d7541f,0x2000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc20000,0x80,0xc30000,0x0,0x0,0x0,0x0,0x0,0x80000000,0x0,0xc30000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc30000,0xc30000,0x0,0xc30000,0x0,0x0,0xc30000,0x80000000,0x0,0x0,0x20,0x20,0x10000,0x10000,0x10000,0x0,0x20,0x80c30000,0x80c30000,0x20,0xc20000,0x0,0x0,0x0,0x0,0x0,0x2115541f,0x21d7541f,0x0,0x0,0x7,0x0,0x0,0x0,0x0,0x0,0x0,0x21d7541f,0x21d7541f,0x21d7541f,0x21d7541f,0x0,0x0,0x0,0x0,0x10000,0x0,0x900,0x900,0x21d7541f,0x21d7541f,0x0,0x900,0xc30000,0x21d7541f,0x21d7541f,0x0,0x0,0x21d7541f,0x0,0x0,0x21d7541f,0x21d7541f,0x21d7541f,0x21d7541f,0x21d7541f,0x21d7541f,0x21d7541f,0x10000,0xc30000,0x10000,0x21d7541f,0x21d7541f,0x10000,0x0,0xc30000,0xc30000,}; } private static void jj_la1_2() { - jj_la1_2 = new int[] {0x804f0700,0x0,0x0,0x804f0700,0x0,0x804f0700,0x0,0x0,0x0,0x0,0x0,0x0,0x200,0x0,0x200,0x80000000,0x80000000,0x800c0000,0x0,0x804f0700,0x0,0x400000,0x0,0x400200,0x400000,0xff,0x0,0x804f0700,0x0,0x1000,0x20004000,0x20004000,0x40008000,0x40008000,0x0,0x800000,0x1000000,0x400000,0x0,0x0,0x0,0x0,0x1c000000,0x1c000000,0xc0000,0xc0000,0x2300000,0x2300000,0x804f0700,0x800f0700,0xc0000,0x800f0600,0x30000,0x400,0x80000200,0xff,0x30000,0x30000,0x0,0x0,0x200,0x200,0x200,0x200,0x0,0x804f07ff,0x804f07ff,0x0,0x80000000,0x804f0700,0x0,0x100,0x30300,0x804f0700,0x0,0x0,0x0,0x200,0x0,0x0,0x0,0x0,0x0,0x804f0700,0x804f0700,0x804f0700,0x804f0700,0x0,0x0,0x30000,0x30000,0x30200,0x2000,0x0,0x0,0x804f0700,0x804f0700,0x0,0x0,0x804f0700,0x804f0700,0x804f0700,0x0,0x0,0x804f0700,0x0,0x0,0x804f2700,0x804f0700,0x804f0700,0x804f0700,0x804f0700,0x804f0700,0x804f2700,0x30200,0x804f0700,0x30200,0x804f0700,0x804f2700,0x30200,0x0,0x804f0700,0x804f0700,}; + jj_la1_2 = new int[] {0x804f0700,0x0,0x0,0x804f0700,0x0,0x804f0700,0x0,0x0,0x0,0x0,0x0,0x0,0x200,0x0,0x200,0x80000000,0x80000000,0x800c0000,0x0,0x804f0700,0x0,0x400000,0x0,0x400200,0x400000,0xff,0x0,0x804f0700,0x0,0x1000,0x20004000,0x20004000,0x40008000,0x40008000,0x0,0x800000,0x1000000,0x400000,0x0,0x0,0x0,0x0,0x1c000000,0x1c000000,0xc0000,0xc0000,0x2300000,0x2300000,0x804f0700,0x800f0700,0xc0000,0x800f0600,0x30000,0x400,0x80000200,0xff,0x30000,0x30000,0x0,0x0,0x200,0x200,0x200,0x200,0x0,0x804f07ff,0x804f07ff,0x0,0x80000000,0x400200,0x0,0x400000,0x0,0x100,0x30300,0x804f0700,0x0,0x0,0x0,0x200,0x0,0x0,0x0,0x0,0x0,0x804f0700,0x804f0700,0x804f0700,0x804f0700,0x0,0x0,0x30000,0x30000,0x30200,0x2000,0x0,0x0,0x804f0700,0x804f0700,0x0,0x0,0x804f0700,0x804f0700,0x804f0700,0x0,0x0,0x804f0700,0x0,0x0,0x804f2700,0x804f0700,0x804f0700,0x804f0700,0x804f0700,0x804f0700,0x804f2700,0x30200,0x804f0700,0x30200,0x804f0700,0x804f2700,0x30200,0x0,0x804f0700,0x804f0700,}; } private static void jj_la1_3() { - jj_la1_3 = new int[] {0x8a228,0x0,0x0,0x8a228,0x80000,0x8a228,0x0,0x0,0x0,0x100000,0x80000000,0x8000,0x0,0x8000,0x8200,0x8,0x8,0x228,0x0,0x2228,0x100000,0x0,0x100000,0x0,0x0,0x0,0x0,0x2228,0x80000000,0x0,0x0,0x0,0x0,0x0,0x200000,0x0,0x0,0x0,0x79000000,0x79000000,0x6c00000,0x6c00000,0x0,0x0,0x0,0x0,0x0,0x0,0x2228,0x2228,0x0,0x2228,0x0,0x0,0x2228,0x0,0x0,0x0,0x22000,0x22000,0x200,0x200,0x200,0x200,0x22000,0x2228,0x2228,0x20000,0x28,0x2228,0x100000,0x0,0x88200,0x8a228,0x0,0x0,0x0,0x0,0x100000,0x80000000,0x100000,0x100000,0x100000,0x8a228,0x8a228,0x8a228,0x8a228,0x100000,0x80000000,0x80000000,0x80000000,0x200,0x8000,0x0,0x0,0x8a228,0x8a228,0x0,0x0,0x2228,0x8a228,0x8a228,0x0,0x0,0x8a228,0x0,0x0,0x8a228,0x8a228,0x8a228,0x8a228,0x8a228,0x8a228,0x8a228,0x200,0x2228,0x200,0x8a228,0x8a228,0x200,0x100000,0x2228,0x2228,}; + jj_la1_3 = new int[] {0x8a228,0x0,0x0,0x8a228,0x80000,0x8a228,0x0,0x0,0x0,0x100000,0x80000000,0x8000,0x0,0x8000,0x8200,0x8,0x8,0x228,0x0,0x2228,0x100000,0x0,0x100000,0x0,0x0,0x0,0x0,0x2228,0x80000000,0x0,0x0,0x0,0x0,0x0,0x200000,0x0,0x0,0x0,0x79000000,0x79000000,0x6c00000,0x6c00000,0x0,0x0,0x0,0x0,0x0,0x0,0x2228,0x2228,0x0,0x2228,0x0,0x0,0x2228,0x0,0x0,0x0,0x22000,0x22000,0x200,0x200,0x200,0x200,0x22000,0x2228,0x2228,0x20000,0x28,0x0,0x100000,0x0,0x80000000,0x0,0x88200,0x8a228,0x0,0x0,0x0,0x0,0x100000,0x80000000,0x100000,0x100000,0x100000,0x8a228,0x8a228,0x8a228,0x8a228,0x100000,0x80000000,0x80000000,0x80000000,0x200,0x8000,0x0,0x0,0x8a228,0x8a228,0x0,0x0,0x2228,0x8a228,0x8a228,0x0,0x0,0x8a228,0x0,0x0,0x8a228,0x8a228,0x8a228,0x8a228,0x8a228,0x8a228,0x8a228,0x200,0x2228,0x200,0x8a228,0x8a228,0x200,0x100000,0x2228,0x2228,}; } private static void jj_la1_4() { - jj_la1_4 = new int[] {0x1000,0x0,0x0,0x1000,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x0,0x1000,0x0,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x1000,0xfff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x1000,0x0,0x1000,0x0,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x1000,0x1000,0x1000,0x1000,0x0,0x1000,0x1000,0x0,0x0,0x1000,0x0,0x0,0x1000,0x1000,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x1000,0x1000,0x1000,0x1000,0x0,0x0,0xfff,0xfff,0x1000,0x0,0x0,0x0,0x1000,0x1000,0x0,0x0,0x1000,0x1000,0x1000,0x0,0x0,0x1000,0x0,0x0,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x0,0x1000,0x1000,}; + jj_la1_4 = new int[] {0x1000,0x0,0x0,0x1000,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x0,0x1000,0x0,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x1000,0xfff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x1000,0x0,0x1000,0x0,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x1000,0x1000,0x1000,0x1000,0x0,0x1000,0x1000,0x0,0x0,0x1000,0x0,0x0,0x0,0x0,0x1000,0x1000,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x1000,0x1000,0x1000,0x1000,0x0,0x0,0xfff,0xfff,0x1000,0x0,0x0,0x0,0x1000,0x1000,0x0,0x0,0x1000,0x1000,0x1000,0x0,0x0,0x1000,0x0,0x0,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x0,0x1000,0x1000,}; } static final private JJCalls[] jj_2_rtns = new JJCalls[8]; static private boolean jj_rescan = false; @@ -6593,7 +6860,7 @@ final int startBlock, endBlock; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 123; i++) jj_la1[i] = -1; + for (int i = 0; i < 125; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -6603,7 +6870,7 @@ final int startBlock, endBlock; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 123; i++) jj_la1[i] = -1; + for (int i = 0; i < 125; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -6620,7 +6887,7 @@ final int startBlock, endBlock; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 123; i++) jj_la1[i] = -1; + for (int i = 0; i < 125; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -6630,7 +6897,7 @@ final int startBlock, endBlock; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 123; i++) jj_la1[i] = -1; + for (int i = 0; i < 125; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -6646,7 +6913,7 @@ final int startBlock, endBlock; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 123; i++) jj_la1[i] = -1; + for (int i = 0; i < 125; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -6655,7 +6922,7 @@ final int startBlock, endBlock; token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 123; i++) jj_la1[i] = -1; + for (int i = 0; i < 125; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -6770,7 +7037,7 @@ final int startBlock, endBlock; la1tokens[jj_kind] = true; jj_kind = -1; } - for (int i = 0; i < 123; i++) { + for (int i = 0; i < 125; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { if ((jj_la1_0[i] & (1< variableDeclaration = VariableDeclarator() { - list.add(variableDeclaration); + pushOnVariableDeclarationStack(variableDeclaration); outlineInfo.addVariable(new String(variableDeclaration.name)); currentSegment.add(variableDeclaration); } ( variableDeclaration = VariableDeclarator() - {list.add(variableDeclaration); + {pushOnVariableDeclarationStack(variableDeclaration); outlineInfo.addVariable(new String(variableDeclaration.name)); currentSegment.add(variableDeclaration);} )* @@ -844,7 +897,10 @@ FieldDeclaration FieldDeclaration() : errorEnd = jj_input_stream.getPosition() + 1; throw e; } - {return new FieldDeclaration((VariableDeclaration[]) list.toArray(), + + {list = new VariableDeclaration[variableDeclarationPtr]; + System.arraycopy(variableDeclarationStack,0,list,0,variableDeclarationPtr); + return new FieldDeclaration(list, pos, SimpleCharStream.getPosition());} } @@ -1030,7 +1086,10 @@ ArrayVariableDeclaration[] ArrayInitializer() : ] [ {list.add(null);}] - {return (ArrayVariableDeclaration[]) list.toArray();} + { + ArrayVariableDeclaration[] vars = new ArrayVariableDeclaration[list.size()]; + list.toArray(vars); + return vars;} } /** @@ -1760,16 +1819,17 @@ ArgumentDeclaration[] args = null; ArgumentDeclaration[] ArgumentList() : { -Expression expr; +ArgumentDeclaration arg; final ArrayList list = new ArrayList(); +ArgumentDeclaration argument; } { - expr = Expression() - {list.add(expr);} + arg = argumentDeclaration() + {list.add(arg);} ( try { - expr = Expression() - {list.add(expr);} + arg = argumentDeclaration() + {list.add(arg);} } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. An expression expected after a comma in argument list"; errorLevel = ERROR; @@ -1778,9 +1838,46 @@ final ArrayList list = new ArrayList(); throw e; } )* - {return (ArgumentDeclaration[]) list.toArray();} + { + ArgumentDeclaration[] args = new ArgumentDeclaration[list.size()]; + list.toArray(args); + return args;} } +ArgumentDeclaration argumentDeclaration() : +{ + boolean reference = false; + String varName; + Expression initializer = null; + final int pos = SimpleCharStream.getPosition(); +} +{ + [ {reference = true;}] + varName = VariableDeclaratorId() + [ + + try { + initializer = VariableInitializer() + } catch (ParseException e) { + errorMessage = "Literal expression expected in variable initializer"; + errorLevel = ERROR; + errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = jj_input_stream.getPosition() + 1; + throw e; + } + ] + { + if (initializer == null) { + return new ArgumentDeclaration(varName.toCharArray(), + reference, + pos); + } + return new ArgumentDeclaration(varName.toCharArray(), + reference, + initializer, + pos); + } +} /** * A Statement without break. */ @@ -1977,8 +2074,18 @@ ListExpression ListExpression() : throw e; } [ expression = Expression() - {return new ListExpression((String[]) list.toArray(),expression,pos,SimpleCharStream.getPosition());}] - {return new ListExpression((String[]) list.toArray(),null,pos,SimpleCharStream.getPosition());} + { + String[] strings = new String[list.size()]; + list.toArray(strings); + return new ListExpression(strings, + expression, + pos, + SimpleCharStream.getPosition());} + ] + { + String[] strings = new String[list.size()]; + list.toArray(strings); + return new ListExpression(strings,pos,SimpleCharStream.getPosition());} } /** @@ -2000,7 +2107,10 @@ EchoStatement EchoStatement() : )* try { - {return new EchoStatement((Expression[]) expressions.toArray(),pos);} + { + Expression[] exprs = new Expression[expressions.size()]; + expressions.toArray(exprs); + return new EchoStatement(exprs,pos);} } catch (ParseException e) { if (e.currentToken.next.kind != 4) { errorMessage = "';' expected after 'echo' statement"; @@ -2029,10 +2139,13 @@ GlobalStatement GlobalStatement() : )* try { - {global = new GlobalStatement(currentSegment, - (String[]) vars.toArray(), - pos, - SimpleCharStream.getPosition()); + { + String[] strings = new String[vars.size()]; + vars.toArray(strings); + global = new GlobalStatement(currentSegment, + strings, + pos, + SimpleCharStream.getPosition()); currentSegment.add(global); return global;} } catch (ParseException e) { @@ -2055,7 +2168,10 @@ StaticStatement StaticStatement() : ( expr = VariableDeclarator() {vars.add(new String(expr.name));})* try { - {return new StaticStatement((String[])vars.toArray(), + { + String[] strings = new String[vars.size()]; + vars.toArray(strings); + return new StaticStatement(strings, pos, SimpleCharStream.getPosition());} } catch (ParseException e) { @@ -2088,6 +2204,10 @@ LabeledStatement LabeledStatement() : Block Block() : { final int pos = SimpleCharStream.getPosition(); + Statement[] statements; + Statement statement; + final int startingPtr = statementPtr; + final int length; } { try { @@ -2099,7 +2219,8 @@ Block Block() : errorEnd = jj_input_stream.getPosition() + 1; throw e; } - ( BlockStatement() | htmlBlock())* + ( statement = BlockStatement() {pushOnStatementStack(statement);} + | statement = htmlBlock() {pushOnStatementStack(statement);})* try { } catch (ParseException e) { @@ -2109,6 +2230,12 @@ Block Block() : errorEnd = jj_input_stream.getPosition() + 1; throw e; } + { + length = statementPtr-startingPtr+1; + statements = new Statement[length]; + System.arraycopy(variableDeclarationStack,startingPtr+1,statements,0,length); + statementPtr = startingPtr; + return new Block(statements,pos,SimpleCharStream.getPosition());} } Statement BlockStatement() : @@ -2143,7 +2270,10 @@ VariableDeclaration[] LocalVariableDeclaration() : var = LocalVariableDeclarator() {list.add(var);} ( var = LocalVariableDeclarator() {list.add(var);})* - {return (VariableDeclaration[]) list.toArray();} + { + VariableDeclaration[] vars = new VariableDeclaration[list.size()]; + list.toArray(vars); + return vars;} } VariableDeclaration LocalVariableDeclarator() : @@ -2247,7 +2377,10 @@ AbstractCase[] switchStatementBrace() : ( cas = switchLabel0() {cases.add(cas);})* try { - {return (AbstractCase[]) cases.toArray();} + { + AbstractCase[] abcase = new AbstractCase[cases.size()]; + cases.toArray(abcase); + return abcase;} } catch (ParseException e) { errorMessage = "'}' expected"; errorLevel = ERROR; @@ -2290,7 +2423,10 @@ AbstractCase[] switchStatementColon(final int start, final int end) : } try { - {return (AbstractCase[]) cases.toArray();} + { + AbstractCase[] abcase = new AbstractCase[cases.size()]; + cases.toArray(abcase); + return abcase;} } catch (ParseException e) { errorMessage = "';' expected after 'endswitch' keyword"; errorLevel = ERROR; @@ -2312,10 +2448,13 @@ AbstractCase switchLabel0() : ( statement = BlockStatementNoBreak() {stmts.add(statement);} | statement = htmlBlock() {stmts.add(statement);})* [ statement = BreakStatement() {stmts.add(statement);}] - {if (expr == null) {//it's a default - return new DefaultCase((Statement[]) stmts.toArray(),pos,SimpleCharStream.getPosition()); + { + Statement[] stmtsArray = new Statement[stmts.size()]; + stmts.toArray(stmtsArray); + if (expr == null) {//it's a default + return new DefaultCase(stmtsArray,pos,SimpleCharStream.getPosition()); } - return new Case(expr,(Statement[]) stmts.toArray(),pos,SimpleCharStream.getPosition());} + return new Case(expr,stmtsArray,pos,SimpleCharStream.getPosition());} } /** @@ -2426,17 +2565,23 @@ Expression Condition(final String keyword) : IfStatement IfStatement0(Expression condition, final int start,final int end) : { Statement statement; + Statement stmt; + final Statement[] statementsArray; ElseIf elseifStatement; Else elseStatement = null; - ArrayList stmts = new ArrayList(); - ArrayList elseifs = new ArrayList(); + ArrayList stmts; + final ArrayList elseIfList = new ArrayList(); + ElseIf[] elseIfs; int pos = SimpleCharStream.getPosition(); + int endStatements; } { + {stmts = new ArrayList();} ( statement = Statement() {stmts.add(statement);} | statement = htmlBlock() {stmts.add(statement);})* - (elseifStatement = ElseIfStatementColon() {elseifs.add(elseifStatement);})* + {endStatements = SimpleCharStream.getPosition();} + (elseifStatement = ElseIfStatementColon() {elseIfList.add(elseifStatement);})* [elseStatement = ElseStatementColon()] {try { @@ -2460,11 +2605,6 @@ IfStatement IfStatement0(Expression condition, final int start,final int end) : } try { - {return new IfStatement(condition, - (ElseIf[]) elseifs.toArray(), - elseStatement, - pos, - SimpleCharStream.getPosition());} } catch (ParseException e) { errorMessage = "';' expected after 'endif' keyword"; errorLevel = ERROR; @@ -2472,10 +2612,31 @@ IfStatement IfStatement0(Expression condition, final int start,final int end) : errorEnd = jj_input_stream.getPosition() + 1; throw e; } + { + elseIfs = new ElseIf[elseIfList.size()]; + elseIfList.toArray(elseIfs); + if (stmts.size() == 1) { + return new IfStatement(condition, + (Statement) stmts.get(0), + elseIfs, + elseStatement, + pos, + SimpleCharStream.getPosition()); + } else { + statementsArray = new Statement[stmts.size()]; + stmts.toArray(statementsArray); + return new IfStatement(condition, + new Block(statementsArray,pos,endStatements), + elseIfs, + elseStatement, + pos, + SimpleCharStream.getPosition()); + } + } + | - (statement = Statement() | statement = htmlBlock()) - {stmts.add(statement);} - ( LOOKAHEAD(1) elseifStatement = ElseIfStatement() {elseifs.add(elseifStatement);})* + (stmt = Statement() | stmt = htmlBlock()) + ( LOOKAHEAD(1) elseifStatement = ElseIfStatement() {elseIfList.add(elseifStatement);})* [ LOOKAHEAD(1) try { @@ -2493,11 +2654,15 @@ IfStatement IfStatement0(Expression condition, final int start,final int end) : throw e; } ] - {return new IfStatement(condition, - (ElseIf[]) elseifs.toArray(), - elseStatement, - pos, - SimpleCharStream.getPosition());} + { + elseIfs = new ElseIf[elseIfList.size()]; + elseIfList.toArray(elseIfs); + return new IfStatement(condition, + stmt, + elseIfs, + elseStatement, + pos, + SimpleCharStream.getPosition());} } ElseIf ElseIfStatementColon() : @@ -2511,7 +2676,10 @@ ElseIf ElseIfStatementColon() : condition = Condition("elseif") ( statement = Statement() {list.add(statement);} | statement = htmlBlock() {list.add(statement);})* - {return new ElseIf(condition,(Statement[]) list.toArray(),pos,SimpleCharStream.getPosition());} + { + Statement[] stmtsArray = new Statement[list.size()]; + list.toArray(stmtsArray); + return new ElseIf(condition,stmtsArray ,pos,SimpleCharStream.getPosition());} } Else ElseStatementColon() : @@ -2523,7 +2691,10 @@ Else ElseStatementColon() : { ( statement = Statement() {list.add(statement);} | statement = htmlBlock() {list.add(statement);})* - {return new Else((Statement[]) list.toArray(),pos,SimpleCharStream.getPosition());} + { + Statement[] stmtsArray = new Statement[list.size()]; + list.toArray(stmtsArray); + return new Else(stmtsArray,pos,SimpleCharStream.getPosition());} } ElseIf ElseIfStatement() : @@ -2535,7 +2706,10 @@ ElseIf ElseIfStatement() : } { condition = Condition("elseif") statement = Statement() {list.add(statement);/*todo:do better*/} - {return new ElseIf(condition,(Statement[]) list.toArray(),pos,SimpleCharStream.getPosition());} + { + Statement[] stmtsArray = new Statement[list.size()]; + list.toArray(stmtsArray); + return new ElseIf(condition,stmtsArray,pos,SimpleCharStream.getPosition());} } WhileStatement WhileStatement() : @@ -2580,7 +2754,10 @@ Statement WhileStatement0(final int start, final int end) : } try { - {return new Block((Statement[]) stmts.toArray(),pos,SimpleCharStream.getPosition());} + { + Statement[] stmtsArray = new Statement[stmts.size()]; + stmts.toArray(stmtsArray); + return new Block(stmtsArray,pos,SimpleCharStream.getPosition());} } catch (ParseException e) { errorMessage = "';' expected after 'endwhile' keyword"; errorLevel = ERROR; @@ -2742,7 +2919,10 @@ final int startBlock, endBlock; } try { - {return new ForStatement(initializations,condition,increments,new Block((Statement[])list.toArray(),startBlock,endBlock),pos,SimpleCharStream.getPosition());} + { + Statement[] stmtsArray = new Statement[list.size()]; + list.toArray(stmtsArray); + return new ForStatement(initializations,condition,increments,new Block(stmtsArray,startBlock,endBlock),pos,SimpleCharStream.getPosition());} } catch (ParseException e) { errorMessage = "';' expected after 'endfor' keyword"; errorLevel = ERROR; @@ -2774,7 +2954,10 @@ Statement[] StatementExpressionList() : { expr = StatementExpression() {list.add(expr);} ( StatementExpression() {list.add(expr);})* - {return (Statement[]) list.toArray();} + { + Statement[] stmtsArray = new Statement[list.size()]; + list.toArray(stmtsArray); + return stmtsArray;} } Continue ContinueStatement() :