X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.java b/net.sourceforge.phpeclipse/src/test/PHPParser.java index 07c6773..15fd16e 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.java +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.java @@ -78,24 +78,26 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon PHPParser.fileToParse = fileToParse; } - public static final void phpParserTester(final String strEval) throws ParseException { + public final void phpParserTester(final String strEval) throws ParseException { final StringReader stream = new StringReader(strEval); if (jj_input_stream == null) { jj_input_stream = new SimpleCharStream(stream, 1, 1); + token_source = new PHPParserTokenManager(jj_input_stream); } ReInit(new StringReader(strEval)); init(); phpDocument = new PHPDocument(null,"_root".toCharArray()); currentSegment = phpDocument; outlineInfo = new PHPOutlineInfo(null, currentSegment); - PHPParserTokenManager.SwitchTo(PHPParserTokenManager.PHPPARSING); + token_source.SwitchTo(PHPParserTokenManager.PHPPARSING); phpTest(); } - public static final void htmlParserTester(final File fileName) throws FileNotFoundException, ParseException { + public final void htmlParserTester(final File fileName) throws FileNotFoundException, ParseException { final Reader stream = new FileReader(fileName); if (jj_input_stream == null) { jj_input_stream = new SimpleCharStream(stream, 1, 1); + token_source = new PHPParserTokenManager(jj_input_stream); } ReInit(stream); init(); @@ -105,10 +107,11 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon phpFile(); } - public static final void htmlParserTester(final String strEval) throws ParseException { + public final void htmlParserTester(final String strEval) throws ParseException { final StringReader stream = new StringReader(strEval); if (jj_input_stream == null) { jj_input_stream = new SimpleCharStream(stream, 1, 1); + token_source = new PHPParserTokenManager(jj_input_stream); } ReInit(stream); init(); @@ -151,6 +154,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon final StringReader stream = new StringReader(s); if (jj_input_stream == null) { jj_input_stream = new SimpleCharStream(stream, 1, 1); + token_source = new PHPParserTokenManager(jj_input_stream); } ReInit(stream); init(); @@ -209,14 +213,14 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon e.currentToken.sourceStart, e.currentToken.sourceEnd, errorLevel, - "Line " + e.currentToken.beginLine+", "+e.currentToken.sourceStart+":"+e.currentToken.sourceEnd); + "Line " + e.currentToken.beginLine+", "+e.currentToken.sourceStart+':'+e.currentToken.sourceEnd); } else { setMarker(fileToParse, errorMessage, errorStart, errorEnd, errorLevel, - "Line " + e.currentToken.beginLine+", "+errorStart+":"+errorEnd); + "Line " + e.currentToken.beginLine+", "+errorStart+':'+errorEnd); errorStart = -1; errorEnd = -1; } @@ -270,6 +274,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon final StringReader stream = new StringReader(s); if (jj_input_stream == null) { jj_input_stream = new SimpleCharStream(stream, 1, 1); + token_source = new PHPParserTokenManager(jj_input_stream); } ReInit(stream); init(); @@ -305,52 +310,51 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon /** * Put a new html block in the stack. */ - public static final void createNewHTMLCode() { + public final void createNewHTMLCode() { final int currentPosition = token.sourceStart; if (currentPosition == htmlStart || currentPosition < htmlStart || - currentPosition > SimpleCharStream.currentBuffer.length()) { + currentPosition > jj_input_stream.getCurrentBuffer().length()) { return; } - final char[] chars = SimpleCharStream.currentBuffer.substring(htmlStart, - currentPosition).toCharArray(); - pushOnAstNodes(new HTMLCode(chars, htmlStart,currentPosition)); + final String html = jj_input_stream.getCurrentBuffer().substring(htmlStart, currentPosition); + pushOnAstNodes(new HTMLCode(html, htmlStart,currentPosition)); } /** Create a new task. */ - public static final void createNewTask(final int todoStart) { - final String todo = SimpleCharStream.currentBuffer.substring(todoStart, - SimpleCharStream.currentBuffer.indexOf("\n", + public final void createNewTask(final int todoStart) { + final String todo = jj_input_stream.getCurrentBuffer().substring(todoStart, + jj_input_stream.getCurrentBuffer().indexOf("\n", todoStart)-1); if (!PARSER_DEBUG) { try { setMarker(fileToParse, todo, - SimpleCharStream.getBeginLine(), + jj_input_stream.getBeginLine(), TASK, - "Line "+SimpleCharStream.getBeginLine()); + "Line "+jj_input_stream.getBeginLine()); } catch (CoreException e) { PHPeclipsePlugin.log(e); } } } - private static final void parse() throws ParseException { + private final void parse() throws ParseException { phpFile(); } - static final public void todo() throws ParseException { + final public void todo() throws ParseException { Token todoToken; todoToken = jj_consume_token(23); createNewTask(todoToken.sourceStart); } - static final public void phpTest() throws ParseException { + final public void phpTest() throws ParseException { Php(); jj_consume_token(0); } - static final public void phpFile() throws ParseException { + final public void phpFile() throws ParseException { try { label_1: while (true) { @@ -410,11 +414,11 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon } PhpBlock(); } - PHPParser.createNewHTMLCode(); + createNewHTMLCode(); } catch (TokenMgrError e) { PHPeclipsePlugin.log(e); - errorStart = SimpleCharStream.beginOffset; - errorEnd = SimpleCharStream.endOffset; + errorStart = jj_input_stream.getBeginOffset(); + errorEnd = jj_input_stream.getEndOffset(); errorMessage = e.getMessage(); errorLevel = ERROR; {if (true) throw generateParseException();} @@ -426,7 +430,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon * or * or */ - static final public void PhpBlock() throws ParseException { + final public void PhpBlock() throws ParseException { final PHPEchoBlock phpEchoBlock; final Token token,phpEnd; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -510,7 +514,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon jj_la1[2] = jj_gen; ; } - PHPParser.createNewHTMLCode(); + createNewHTMLCode(); Php(); try { phpEnd = jj_consume_token(PHPEND); @@ -530,12 +534,12 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon } } - static final public PHPEchoBlock phpEchoBlock() throws ParseException { + final public PHPEchoBlock phpEchoBlock() throws ParseException { final Expression expr; final PHPEchoBlock echoBlock; final Token token, token2; token = jj_consume_token(PHPECHOSTART); - PHPParser.createNewHTMLCode(); + createNewHTMLCode(); expr = Expression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SEMICOLON: @@ -554,7 +558,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon throw new Error("Missing return statement in function"); } - static final public void Php() throws ParseException { + final public void Php() throws ParseException { label_2: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -611,7 +615,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon } } - static final public ClassDeclaration ClassDeclaration() throws ParseException { + final public ClassDeclaration ClassDeclaration() throws ParseException { final ClassDeclaration classDeclaration; Token className = null; final Token superclassName, token, extendsToken; @@ -679,7 +683,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon throw new Error("Missing return statement in function"); } - static final public int ClassBody(final ClassDeclaration classDeclaration) throws ParseException { + final public int ClassBody(final ClassDeclaration classDeclaration) throws ParseException { Token token; try { jj_consume_token(LBRACE); @@ -712,7 +716,7 @@ Token token; errorStart = e.currentToken.sourceStart; errorEnd = e.currentToken.sourceEnd; processParseExceptionDebug(e); - {if (true) return PHPParser.token.sourceEnd;} + {if (true) return this.token.sourceEnd;} } throw new Error("Missing return statement in function"); } @@ -720,7 +724,7 @@ Token token; /** * A class can contain only methods and fields. */ - static final public void ClassBodyDeclaration(final ClassDeclaration classDeclaration) throws ParseException { + final public void ClassBodyDeclaration(final ClassDeclaration classDeclaration) throws ParseException { final MethodDeclaration method; final FieldDeclaration field; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -744,7 +748,7 @@ Token token; * A class field declaration : it's var VariableDeclarator() (, VariableDeclarator())*;. * it is only used by ClassBodyDeclaration() */ - static final public FieldDeclaration FieldDeclaration() throws ParseException { + final public FieldDeclaration FieldDeclaration() throws ParseException { VariableDeclaration variableDeclaration; final VariableDeclaration[] list; final ArrayList arrayList = new ArrayList(); @@ -799,7 +803,7 @@ Token token; * a strict variable declarator : there cannot be a suffix here. * It will be used by fields and formal parameters */ - static final public VariableDeclaration VariableDeclaratorNoSuffix() throws ParseException { + final public VariableDeclaration VariableDeclaratorNoSuffix() throws ParseException { final Token token, lbrace,rbrace; Expression expr, initializer = null; Token assignToken; @@ -855,7 +859,7 @@ Token token; /** * this will be used by static statement */ - static final public VariableDeclaration VariableDeclarator() throws ParseException { + final public VariableDeclaration VariableDeclarator() throws ParseException { final AbstractVariable variable; Expression initializer = null; final Token token; @@ -895,7 +899,7 @@ Token token; * A Variable name. * @return the variable name (with suffix) */ - static final public AbstractVariable VariableDeclaratorId() throws ParseException { + final public AbstractVariable VariableDeclaratorId() throws ParseException { final Variable var; AbstractVariable expression = null; try { @@ -923,7 +927,7 @@ Token token; throw new Error("Missing return statement in function"); } - static final public Variable Variable() throws ParseException { + final public Variable Variable() throws ParseException { Variable variable = null; final Token token; token = jj_consume_token(DOLLAR); @@ -932,7 +936,7 @@ Token token; throw new Error("Missing return statement in function"); } - static final public Variable Var() throws ParseException { + final public Variable Var() throws ParseException { Variable variable = null; final Token token,token2; ConstantIdentifier constant; @@ -953,7 +957,7 @@ Token token; break; case IDENTIFIER: token = jj_consume_token(IDENTIFIER); - outlineInfo.addVariable("$" + token.image); + outlineInfo.addVariable('$' + token.image); {if (true) return new Variable(token.image,token.sourceStart,token.sourceEnd);} break; default: @@ -964,7 +968,7 @@ Token token; throw new Error("Missing return statement in function"); } - static final public Expression VariableInitializer() throws ParseException { + final public Expression VariableInitializer() throws ParseException { final Expression expr; final Token token, token2; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1030,7 +1034,7 @@ Token token; throw new Error("Missing return statement in function"); } - static final public ArrayVariableDeclaration ArrayVariable() throws ParseException { + final public ArrayVariableDeclaration ArrayVariable() throws ParseException { final Expression expr,expr2; expr = Expression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1043,11 +1047,11 @@ final Expression expr,expr2; jj_la1[17] = jj_gen; ; } - {if (true) return new ArrayVariableDeclaration(expr,SimpleCharStream.getPosition());} + {if (true) return new ArrayVariableDeclaration(expr,jj_input_stream.getPosition());} throw new Error("Missing return statement in function"); } - static final public ArrayVariableDeclaration[] ArrayInitializer() throws ParseException { + final public ArrayVariableDeclaration[] ArrayInitializer() throws ParseException { ArrayVariableDeclaration expr; final ArrayList list = new ArrayList(); jj_consume_token(LPAREN); @@ -1112,7 +1116,7 @@ final Expression expr,expr2; * A Method Declaration. * function MetodDeclarator() Block() */ - static final public MethodDeclaration MethodDeclaration() throws ParseException { + final public MethodDeclaration MethodDeclaration() throws ParseException { final MethodDeclaration functionDeclaration; final Block block; final OutlineableWithChildren seg = currentSegment; @@ -1142,7 +1146,7 @@ final Expression expr,expr2; * [&] IDENTIFIER(parameters ...). * @return a function description for the outline */ - static final public MethodDeclaration MethodDeclarator(final int start) throws ParseException { + final public MethodDeclaration MethodDeclarator(final int start) throws ParseException { Token identifier = null; Token reference = null; final ArrayList formalParameters = new ArrayList(); @@ -1197,10 +1201,10 @@ final Expression expr,expr2; * FormalParameters follows method identifier. * (FormalParameter()) */ - static final public int FormalParameters(final ArrayList parameters) throws ParseException { + final public int FormalParameters(final ArrayList parameters) throws ParseException { VariableDeclaration var; final Token token; - Token tok = PHPParser.token; + Token tok = this.token; int end = tok.sourceEnd; try { tok = jj_consume_token(LPAREN); @@ -1254,7 +1258,7 @@ final Expression expr,expr2; * A formal parameter. * $varname[=value] (,$varname[=value]) */ - static final public VariableDeclaration FormalParameter() throws ParseException { + final public VariableDeclaration FormalParameter() throws ParseException { final VariableDeclaration variableDeclaration; Token token = null; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1266,7 +1270,7 @@ final Expression expr,expr2; ; } variableDeclaration = VariableDeclaratorNoSuffix(); - outlineInfo.addVariable("$"+variableDeclaration.name()); + outlineInfo.addVariable('$'+variableDeclaration.name()); if (token != null) { variableDeclaration.setReference(true); } @@ -1274,7 +1278,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public ConstantIdentifier Type() throws ParseException { + final public ConstantIdentifier Type() throws ParseException { final Token token; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STRING: @@ -1321,7 +1325,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression Expression() throws ParseException { + final public Expression Expression() throws ParseException { final Expression expr; Expression initializer = null; int assignOperator = -1; @@ -1370,7 +1374,7 @@ final Expression expr,expr2; } errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', expression expected"; errorLevel = ERROR; - errorEnd = SimpleCharStream.getPosition(); + errorEnd = jj_input_stream.getPosition(); {if (true) throw e;} } break; @@ -1409,7 +1413,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression ExpressionWBang() throws ParseException { + final public Expression ExpressionWBang() throws ParseException { final Expression expr; final Token token; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1431,7 +1435,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression ExpressionNoBang() throws ParseException { + final public Expression ExpressionNoBang() throws ParseException { Expression expr; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LIST: @@ -1454,7 +1458,7 @@ final Expression expr,expr2; * Any assignement operator. * @return the assignement operator id */ - static final public int AssignmentOperator() throws ParseException { + final public int AssignmentOperator() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ASSIGN: jj_consume_token(ASSIGN); @@ -1516,7 +1520,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression ConditionalExpression() throws ParseException { + final public Expression ConditionalExpression() throws ParseException { final Expression expr; Expression expr2 = null; Expression expr3 = null; @@ -1539,7 +1543,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression ConditionalOrExpression() throws ParseException { + final public Expression ConditionalOrExpression() throws ParseException { Expression expr,expr2; int operator; expr = ConditionalAndExpression(); @@ -1575,7 +1579,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression ConditionalAndExpression() throws ParseException { + final public Expression ConditionalAndExpression() throws ParseException { Expression expr,expr2; int operator; expr = ConcatExpression(); @@ -1611,7 +1615,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression ConcatExpression() throws ParseException { + final public Expression ConcatExpression() throws ParseException { Expression expr,expr2; expr = InclusiveOrExpression(); label_10: @@ -1632,7 +1636,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression InclusiveOrExpression() throws ParseException { + final public Expression InclusiveOrExpression() throws ParseException { Expression expr,expr2; expr = ExclusiveOrExpression(); label_11: @@ -1653,7 +1657,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression ExclusiveOrExpression() throws ParseException { + final public Expression ExclusiveOrExpression() throws ParseException { Expression expr,expr2; expr = AndExpression(); label_12: @@ -1674,7 +1678,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression AndExpression() throws ParseException { + final public Expression AndExpression() throws ParseException { Expression expr,expr2; expr = EqualityExpression(); label_13: @@ -1695,7 +1699,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression EqualityExpression() throws ParseException { + final public Expression EqualityExpression() throws ParseException { Expression expr,expr2; int operator; Token token; @@ -1759,7 +1763,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression RelationalExpression() throws ParseException { + final public Expression RelationalExpression() throws ParseException { Expression expr,expr2; int operator; expr = ShiftExpression(); @@ -1805,7 +1809,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression ShiftExpression() throws ParseException { + final public Expression ShiftExpression() throws ParseException { Expression expr,expr2; int operator; expr = AdditiveExpression(); @@ -1846,7 +1850,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression AdditiveExpression() throws ParseException { + final public Expression AdditiveExpression() throws ParseException { Expression expr,expr2; int operator; expr = MultiplicativeExpression(); @@ -1882,17 +1886,17 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression MultiplicativeExpression() throws ParseException { + final public Expression MultiplicativeExpression() throws ParseException { Expression expr,expr2; int operator; try { expr = UnaryExpression(); } catch (ParseException e) { if (errorMessage != null) {if (true) throw e;} - errorMessage = "unexpected token '"+e.currentToken.next.image+"'"; + errorMessage = "unexpected token '"+e.currentToken.next.image+'\''; errorLevel = ERROR; - errorStart = PHPParser.token.sourceStart; - errorEnd = PHPParser.token.sourceEnd; + errorStart = this.token.sourceStart; + errorEnd = this.token.sourceEnd; {if (true) throw e;} } label_18: @@ -1935,7 +1939,7 @@ final Expression expr,expr2; /** * An unary expression starting with @, & or nothing */ - static final public Expression UnaryExpression() throws ParseException { + final public Expression UnaryExpression() throws ParseException { final Expression expr; /* expr = UnaryExpressionNoPrefix() //why did I had that ? {return new PrefixedUnaryExpression(expr,OperatorIds.AND,pos);} @@ -1945,7 +1949,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression AtNotTildeUnaryExpression() throws ParseException { + final public Expression AtNotTildeUnaryExpression() throws ParseException { final Expression expr; final Token token; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1996,7 +2000,7 @@ final Expression expr,expr2; * An expression prefixed (or not) by one or more @ and !. * @return the expression */ - static final public Expression AtNotUnaryExpression() throws ParseException { + final public Expression AtNotUnaryExpression() throws ParseException { final Expression expr; final Token token; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -2038,7 +2042,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression UnaryExpressionNoPrefix() throws ParseException { + final public Expression UnaryExpressionNoPrefix() throws ParseException { final Expression expr; final Token token; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -2085,7 +2089,7 @@ final Expression expr,expr2; throw new Error("Missing return statement in function"); } - static final public Expression PreIncDecExpression() throws ParseException { + final public Expression PreIncDecExpression() throws ParseException { final Expression expr; final int operator; final Token token; @@ -2108,7 +2112,7 @@ final Token token; throw new Error("Missing return statement in function"); } - static final public Expression UnaryExpressionNotPlusMinus() throws ParseException { + final public Expression UnaryExpressionNotPlusMinus() throws ParseException { final Expression expr; if (jj_2_3(2147483647)) { expr = CastExpression(); @@ -2156,7 +2160,7 @@ final Token token; throw new Error("Missing return statement in function"); } - static final public CastExpression CastExpression() throws ParseException { + final public CastExpression CastExpression() throws ParseException { final ConstantIdentifier type; final Expression expr; final Token token,token1; @@ -2188,7 +2192,7 @@ final Token token,token1; throw new Error("Missing return statement in function"); } - static final public Expression PostfixExpression() throws ParseException { + final public Expression PostfixExpression() throws ParseException { final Expression expr; int operator = -1; Token token = null; @@ -2222,7 +2226,7 @@ final Token token,token1; throw new Error("Missing return statement in function"); } - static final public Expression PrimaryExpression() throws ParseException { + final public Expression PrimaryExpression() throws ParseException { Expression expr; Token token = null; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -2253,7 +2257,7 @@ final Token token,token1; throw new Error("Missing return statement in function"); } - static final public Expression refPrimaryExpression(final Token reference) throws ParseException { + final public Expression refPrimaryExpression(final Token reference) throws ParseException { Expression expr; Expression expr2 = null; final Token identifier; @@ -2345,18 +2349,18 @@ final Token token,token1; * array(vars) * @return an array */ - static final public ArrayInitializer ArrayDeclarator() throws ParseException { + final public ArrayInitializer ArrayDeclarator() throws ParseException { final ArrayVariableDeclaration[] vars; final Token token; token = jj_consume_token(ARRAY); vars = ArrayInitializer(); {if (true) return new ArrayInitializer(vars, token.sourceStart, - PHPParser.token.sourceEnd);} + this.token.sourceEnd);} throw new Error("Missing return statement in function"); } - static final public Expression ClassIdentifier() throws ParseException { + final public Expression ClassIdentifier() throws ParseException { final Expression expr; final Token token; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -2391,7 +2395,7 @@ final Token token,token1; /** * Used by Variabledeclaratorid and primarysuffix */ - static final public AbstractVariable VariableSuffix(final AbstractVariable prefix) throws ParseException { + final public AbstractVariable VariableSuffix(final AbstractVariable prefix) throws ParseException { Expression expression = null; final Token classAccessToken,lbrace,rbrace; Token token; @@ -2630,7 +2634,7 @@ final Token token,token1; throw new Error("Missing return statement in function"); } - static final public Literal Literal() throws ParseException { + final public Literal Literal() throws ParseException { final Token token; StringLiteral literal; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -2670,7 +2674,7 @@ final Token token,token1; throw new Error("Missing return statement in function"); } - static final public StringLiteral evaluableString() throws ParseException { + final public StringLiteral evaluableString() throws ParseException { ArrayList list = new ArrayList(); Token start,end; Token token,lbrace,rbrace; @@ -2712,14 +2716,14 @@ final Token token,token1; end = jj_consume_token(DOUBLEQUOTE2); AbstractVariable[] vars = new AbstractVariable[list.size()]; list.toArray(vars); - {if (true) return new StringLiteral(SimpleCharStream.currentBuffer.substring(start.sourceEnd,end.sourceStart), + {if (true) return new StringLiteral(jj_input_stream.getCurrentBuffer().substring(start.sourceEnd,end.sourceStart), start.sourceStart, end.sourceEnd, vars);} throw new Error("Missing return statement in function"); } - static final public FunctionCall Arguments(final Expression func) throws ParseException { + final public FunctionCall Arguments(final Expression func) throws ParseException { Expression[] args = null; final Token token,lparen; lparen = jj_consume_token(LPAREN); @@ -2777,7 +2781,7 @@ final Token token,lparen; * argumentDeclaration() (, argumentDeclaration)* * @return an array of arguments */ - static final public Expression[] ArgumentList() throws ParseException { + final public Expression[] ArgumentList() throws ParseException { Expression arg; final ArrayList list = new ArrayList(); int pos; @@ -2818,7 +2822,7 @@ Token token; * A Statement without break. * @return a statement */ - static final public Statement StatementNoBreak() throws ParseException { + final public Statement StatementNoBreak() throws ParseException { final Statement statement; Token token = null; if (jj_2_4(2)) { @@ -2920,7 +2924,7 @@ Token token; * expression ; * @return an expression */ - static final public Statement expressionStatement() throws ParseException { + final public Statement expressionStatement() throws ParseException { final Statement statement; final Token token; statement = Expression(); @@ -2940,7 +2944,7 @@ Token token; throw new Error("Missing return statement in function"); } - static final public Define defineStatement() throws ParseException { + final public Define defineStatement() throws ParseException { Expression defineName,defineValue; final Token defineToken; Token token; @@ -3010,7 +3014,7 @@ Token token; /** * A Normal statement. */ - static final public Statement Statement() throws ParseException { + final public Statement Statement() throws ParseException { final Statement statement; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IF: @@ -3071,7 +3075,7 @@ Token token; /** * An html block inside a php syntax. */ - static final public HTMLBlock htmlBlock() throws ParseException { + final public HTMLBlock htmlBlock() throws ParseException { final int startIndex = nodePtr; final AstNode[] blockNodes; final int nbNodes; @@ -3103,7 +3107,7 @@ Token token; jj_consume_token(-1); throw new ParseException(); } - PHPParser.createNewHTMLCode(); + createNewHTMLCode(); } catch (ParseException e) { errorMessage = "unexpected end of file , '= 100) return; if (pos == jj_endpos + 1) { jj_lasttokens[jj_endpos++] = kind; @@ -7484,7 +7466,7 @@ final ArrayList list = new ArrayList(); } } - static public ParseException generateParseException() { + public ParseException generateParseException() { jj_expentries.removeAllElements(); boolean[] la1tokens = new boolean[160]; for (int i = 0; i < 160; i++) { @@ -7532,13 +7514,13 @@ final ArrayList list = new ArrayList(); return new ParseException(token, exptokseq, tokenImage); } - static final public void enable_tracing() { + final public void enable_tracing() { } - static final public void disable_tracing() { + final public void disable_tracing() { } - static final private void jj_rescan_token() { + final private void jj_rescan_token() { jj_rescan = true; for (int i = 0; i < 5; i++) { JJCalls p = jj_2_rtns[i]; @@ -7559,7 +7541,7 @@ final ArrayList list = new ArrayList(); jj_rescan = false; } - static final private void jj_save(int index, int xla) { + final private void jj_save(int index, int xla) { JJCalls p = jj_2_rtns[index]; while (p.gen > jj_gen) { if (p.next == null) { p = p.next = new JJCalls(); break; }