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;
*/
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;
}
}
}
+ 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);
init();
try {
parse();
+ phpDocument = new PHPDocument(null);
+ phpDocument.nodes = nodes;
//PHPeclipsePlugin.log(1,phpDocument.toString());
} catch (ParseException e) {
processParseException(e);
*/
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:
}
jj_consume_token(COMMA);
variableDeclaration = VariableDeclarator();
- list.add(variableDeclaration);
+ pushOnVariableDeclarationStack(variableDeclaration);
outlineInfo.addVariable(new String(variableDeclaration.name));
currentSegment.add(variableDeclaration);
}
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");
;
}
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");
}
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;
}
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) {
}
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;
{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");
}
token = jj_consume_token(AT);
break;
default:
- jj_la1[71] = jj_gen;
+ jj_la1[73] = jj_gen;
;
}
statement = IncludeStatement();
{if (true) return statement;}
break;
default:
- jj_la1[72] = jj_gen;
+ jj_la1[74] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return statement;}
break;
default:
- jj_la1[73] = jj_gen;
+ jj_la1[75] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
;
break;
default:
- jj_la1[74] = jj_gen;
+ jj_la1[76] = jj_gen;
break label_22;
}
phpEchoBlock();
jj_consume_token(PHPSTARTSHORT);
break;
default:
- jj_la1[75] = jj_gen;
+ jj_la1[77] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
keyword = InclusionStatement.INCLUDE_ONCE;
break;
default:
- jj_la1[76] = jj_gen;
+ jj_la1[78] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
list.add(expr);
break;
default:
- jj_la1[77] = jj_gen;
+ jj_la1[79] = jj_gen;
;
}
if (expr == null) list.add(null);
;
break;
default:
- jj_la1[78] = jj_gen;
+ jj_la1[80] = jj_gen;
break label_23;
}
try {
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");
}
;
break;
default:
- jj_la1[80] = jj_gen;
+ jj_la1[82] = jj_gen;
break label_24;
}
jj_consume_token(COMMA);
}
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";
;
break;
default:
- jj_la1[81] = jj_gen;
+ jj_la1[83] = jj_gen;
break label_25;
}
jj_consume_token(COMMA);
}
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) {
;
break;
default:
- jj_la1[82] = jj_gen;
+ jj_la1[84] = jj_gen;
break label_26;
}
jj_consume_token(COMMA);
}
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) {
*/
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) {
;
break;
default:
- jj_la1[83] = jj_gen;
+ jj_la1[85] = jj_gen;
break label_27;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
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();
}
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");
}
{if (true) return statement;}
break;
default:
- jj_la1[85] = jj_gen;
+ jj_la1[87] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return statement;}
break;
default:
- jj_la1[86] = jj_gen;
+ jj_la1[88] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
;
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");
}
initializer = Expression();
break;
default:
- jj_la1[88] = jj_gen;
+ jj_la1[90] = jj_gen;
;
}
if (initializer == null) {
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();
}
cases = switchStatementColon(pos, pos + 6);
break;
default:
- jj_la1[92] = jj_gen;
+ jj_la1[94] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
;
break;
default:
- jj_la1[93] = jj_gen;
+ jj_la1[95] = jj_gen;
break label_29;
}
cas = switchLabel0();
}
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;
;
break;
default:
- jj_la1[94] = jj_gen;
+ jj_la1[96] = jj_gen;
break label_30;
}
cas = switchLabel0();
}
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;
;
break;
default:
- jj_la1[95] = jj_gen;
+ jj_la1[97] = jj_gen;
break label_31;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
stmts.add(statement);
break;
default:
- jj_la1[96] = jj_gen;
+ jj_la1[98] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
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");
}
}
break;
default:
- jj_la1[98] = jj_gen;
+ jj_la1[100] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
expression = Expression();
break;
default:
- jj_la1[99] = jj_gen;
+ jj_la1[101] = jj_gen;
;
}
try {
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) {
;
break;
default:
- jj_la1[100] = jj_gen;
+ jj_la1[102] = jj_gen;
break label_32;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
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) {
;
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 {
}
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;
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:
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) {
;
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:
}
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();
}
;
break;
default:
- jj_la1[108] = jj_gen;
+ jj_la1[110] = jj_gen;
break label_35;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
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");
}
;
break;
default:
- jj_la1[110] = jj_gen;
+ jj_la1[112] = jj_gen;
break label_36;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
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");
}
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");
}
;
break;
default:
- jj_la1[112] = jj_gen;
+ jj_la1[114] = jj_gen;
break label_37;
}
statement = Statement();
}
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;
{if (true) return statement;}
break;
default:
- jj_la1[113] = jj_gen;
+ jj_la1[115] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
initializations = ForInit();
break;
default:
- jj_la1[114] = jj_gen;
+ jj_la1[116] = jj_gen;
;
}
jj_consume_token(SEMICOLON);
condition = Expression();
break;
default:
- jj_la1[115] = jj_gen;
+ jj_la1[117] = jj_gen;
;
}
jj_consume_token(SEMICOLON);
increments = StatementExpressionList();
break;
default:
- jj_la1[116] = jj_gen;
+ jj_la1[118] = jj_gen;
;
}
jj_consume_token(RPAREN);
;
break;
default:
- jj_la1[117] = jj_gen;
+ jj_la1[119] = jj_gen;
break label_38;
}
action = Statement();
}
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;
}
break;
default:
- jj_la1[118] = jj_gen;
+ jj_la1[120] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return statements;}
break;
default:
- jj_la1[119] = jj_gen;
+ jj_la1[121] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
;
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");
}
expr = Expression();
break;
default:
- jj_la1[121] = jj_gen;
+ jj_la1[123] = jj_gen;
;
}
try {
expr = Expression();
break;
default:
- jj_la1[122] = jj_gen;
+ jj_la1[124] = jj_gen;
;
}
try {
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;
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;
}
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;
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;
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;
}
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;
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;
}
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;
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;
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;
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;
}
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;
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;
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;
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;
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;
}
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;
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;
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;
}
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;
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;
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;
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;
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;
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;
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;
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;
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;
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();
}
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();
}
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();
}
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();
}
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();
}
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();
}
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<<j)) != 0) {
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;
*/
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;
}
}
}
+ 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);
init();
try {
parse();
- //PHPeclipsePlugin.log(1,phpDocument.toString());
+ phpDocument = new PHPDocument(null);
+ phpDocument.nodes = nodes;
+ PHPeclipsePlugin.log(1,phpDocument.toString());
} catch (ParseException e) {
processParseException(e);
}
FieldDeclaration FieldDeclaration() :
{
VariableDeclaration variableDeclaration;
- final ArrayList list = new ArrayList();
+ variableDeclarationPtr = 0;
+ variableDeclarationStack = new VariableDeclaration[AstStackIncrement];
+ VariableDeclaration[] list;
final int pos = SimpleCharStream.getPosition();
}
{
<VAR> variableDeclaration = VariableDeclarator()
{
- list.add(variableDeclaration);
+ pushOnVariableDeclarationStack(variableDeclaration);
outlineInfo.addVariable(new String(variableDeclaration.name));
currentSegment.add(variableDeclaration);
}
( <COMMA>
variableDeclaration = VariableDeclarator()
- {list.add(variableDeclaration);
+ {pushOnVariableDeclarationStack(variableDeclaration);
outlineInfo.addVariable(new String(variableDeclaration.name));
currentSegment.add(variableDeclaration);}
)*
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());}
}
]
[<COMMA> {list.add(null);}]
<RPAREN>
- {return (ArrayVariableDeclaration[]) list.toArray();}
+ {
+ ArrayVariableDeclaration[] vars = new ArrayVariableDeclaration[list.size()];
+ list.toArray(vars);
+ return vars;}
}
/**
ArgumentDeclaration[] ArgumentList() :
{
-Expression expr;
+ArgumentDeclaration arg;
final ArrayList list = new ArrayList();
+ArgumentDeclaration argument;
}
{
- expr = Expression()
- {list.add(expr);}
+ arg = argumentDeclaration()
+ {list.add(arg);}
( <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;
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();
+}
+{
+ [<BIT_AND> {reference = true;}]
+ varName = VariableDeclaratorId()
+ [
+ <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;
+ throw e;
+ }
+ ]
+ {
+ if (initializer == null) {
+ return new ArgumentDeclaration(varName.toCharArray(),
+ reference,
+ pos);
+ }
+ return new ArgumentDeclaration(varName.toCharArray(),
+ reference,
+ initializer,
+ pos);
+ }
+}
/**
* A Statement without break.
*/
throw e;
}
[ <ASSIGN> 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());}
}
/**
)*
try {
<SEMICOLON>
- {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";
)*
try {
<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);
return global;}
} catch (ParseException e) {
(<COMMA> expr = VariableDeclarator() {vars.add(new String(expr.name));})*
try {
<SEMICOLON>
- {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) {
Block Block() :
{
final int pos = SimpleCharStream.getPosition();
+ Statement[] statements;
+ Statement statement;
+ final int startingPtr = statementPtr;
+ final int length;
}
{
try {
errorEnd = jj_input_stream.getPosition() + 1;
throw e;
}
- ( BlockStatement() | htmlBlock())*
+ ( statement = BlockStatement() {pushOnStatementStack(statement);}
+ | statement = htmlBlock() {pushOnStatementStack(statement);})*
try {
<RBRACE>
} catch (ParseException e) {
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() :
var = LocalVariableDeclarator()
{list.add(var);}
( <COMMA> var = LocalVariableDeclarator() {list.add(var);})*
- {return (VariableDeclaration[]) list.toArray();}
+ {
+ VariableDeclaration[] vars = new VariableDeclaration[list.size()];
+ list.toArray(vars);
+ return vars;}
}
VariableDeclaration LocalVariableDeclarator() :
( cas = switchLabel0() {cases.add(cas);})*
try {
<RBRACE>
- {return (AbstractCase[]) cases.toArray();}
+ {
+ AbstractCase[] abcase = new AbstractCase[cases.size()];
+ cases.toArray(abcase);
+ return abcase;}
} catch (ParseException e) {
errorMessage = "'}' expected";
errorLevel = ERROR;
}
try {
<SEMICOLON>
- {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;
( 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());}
}
/**
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;
}
{
<COLON>
+ {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 {
}
try {
<SEMICOLON>
- {return new IfStatement(condition,
- (ElseIf[]) elseifs.toArray(),
- elseStatement,
- pos,
- SimpleCharStream.getPosition());}
} catch (ParseException e) {
errorMessage = "';' expected after 'endif' keyword";
errorLevel = ERROR;
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)
<ELSE>
try {
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() :
<ELSEIF> condition = Condition("elseif")
<COLON> ( 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() :
{
<ELSE> <COLON> ( 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() :
}
{
<ELSEIF> 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() :
}
try {
<SEMICOLON>
- {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;
}
try {
<SEMICOLON>
- {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;
{
expr = StatementExpression() {list.add(expr);}
(<COMMA> StatementExpression() {list.add(expr);})*
- {return (Statement[]) list.toArray();}
+ {
+ Statement[] stmtsArray = new Statement[list.size()];
+ list.toArray(stmtsArray);
+ return stmtsArray;}
}
Continue ContinueStatement() :