X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.java b/net.sourceforge.phpeclipse/src/test/PHPParser.java index 8d0645d..4030cca 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.java +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.java @@ -1,25 +1,83 @@ /* Generated By:JavaCC: Do not edit this line. PHPParser.java */ package test; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.ui.texteditor.MarkerUtilities; -import org.eclipse.jface.preference.IPreferenceStore; - -import java.util.Hashtable; -import java.util.ArrayList; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.Reader; import java.io.StringReader; -import java.io.*; import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Hashtable; -import net.sourceforge.phpeclipse.actions.PHPStartApacheAction; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; -import net.sourceforge.phpdt.internal.compiler.ast.*; -import net.sourceforge.phpdt.internal.compiler.parser.OutlineableWithChildren; +import net.sourceforge.phpdt.core.IJavaModelMarker; +import net.sourceforge.phpdt.internal.compiler.ast.AbstractCase; +import net.sourceforge.phpdt.internal.compiler.ast.AbstractVariable; +import net.sourceforge.phpdt.internal.compiler.ast.ArrayDeclarator; +import net.sourceforge.phpdt.internal.compiler.ast.ArrayInitializer; +import net.sourceforge.phpdt.internal.compiler.ast.ArrayVariableDeclaration; +import net.sourceforge.phpdt.internal.compiler.ast.AstNode; +import net.sourceforge.phpdt.internal.compiler.ast.BinaryExpression; +import net.sourceforge.phpdt.internal.compiler.ast.Block; +import net.sourceforge.phpdt.internal.compiler.ast.Break; +import net.sourceforge.phpdt.internal.compiler.ast.Case; +import net.sourceforge.phpdt.internal.compiler.ast.CastExpression; +import net.sourceforge.phpdt.internal.compiler.ast.ClassAccess; +import net.sourceforge.phpdt.internal.compiler.ast.ClassDeclaration; +import net.sourceforge.phpdt.internal.compiler.ast.ClassInstantiation; +import net.sourceforge.phpdt.internal.compiler.ast.ConditionalExpression; +import net.sourceforge.phpdt.internal.compiler.ast.ConstantIdentifier; +import net.sourceforge.phpdt.internal.compiler.ast.Continue; +import net.sourceforge.phpdt.internal.compiler.ast.DefaultCase; +import net.sourceforge.phpdt.internal.compiler.ast.Define; +import net.sourceforge.phpdt.internal.compiler.ast.DoStatement; +import net.sourceforge.phpdt.internal.compiler.ast.EchoStatement; +import net.sourceforge.phpdt.internal.compiler.ast.Else; +import net.sourceforge.phpdt.internal.compiler.ast.ElseIf; +import net.sourceforge.phpdt.internal.compiler.ast.EmptyStatement; +import net.sourceforge.phpdt.internal.compiler.ast.Expression; +import net.sourceforge.phpdt.internal.compiler.ast.FalseLiteral; +import net.sourceforge.phpdt.internal.compiler.ast.FieldDeclaration; +import net.sourceforge.phpdt.internal.compiler.ast.ForStatement; +import net.sourceforge.phpdt.internal.compiler.ast.ForeachStatement; +import net.sourceforge.phpdt.internal.compiler.ast.FunctionCall; +import net.sourceforge.phpdt.internal.compiler.ast.GlobalStatement; +import net.sourceforge.phpdt.internal.compiler.ast.HTMLBlock; +import net.sourceforge.phpdt.internal.compiler.ast.HTMLCode; +import net.sourceforge.phpdt.internal.compiler.ast.IfStatement; +import net.sourceforge.phpdt.internal.compiler.ast.InclusionStatement; +import net.sourceforge.phpdt.internal.compiler.ast.LabeledStatement; +import net.sourceforge.phpdt.internal.compiler.ast.ListExpression; +import net.sourceforge.phpdt.internal.compiler.ast.Literal; +import net.sourceforge.phpdt.internal.compiler.ast.MethodDeclaration; +import net.sourceforge.phpdt.internal.compiler.ast.NullLiteral; +import net.sourceforge.phpdt.internal.compiler.ast.NumberLiteral; +import net.sourceforge.phpdt.internal.compiler.ast.OperatorIds; +import net.sourceforge.phpdt.internal.compiler.ast.PHPDocument; +import net.sourceforge.phpdt.internal.compiler.ast.PHPEchoBlock; +import net.sourceforge.phpdt.internal.compiler.ast.PostfixedUnaryExpression; +import net.sourceforge.phpdt.internal.compiler.ast.PrefixedUnaryExpression; +import net.sourceforge.phpdt.internal.compiler.ast.PrintExpression; +import net.sourceforge.phpdt.internal.compiler.ast.ReturnStatement; +import net.sourceforge.phpdt.internal.compiler.ast.Statement; +import net.sourceforge.phpdt.internal.compiler.ast.StaticStatement; +import net.sourceforge.phpdt.internal.compiler.ast.StringLiteral; +import net.sourceforge.phpdt.internal.compiler.ast.SwitchStatement; +import net.sourceforge.phpdt.internal.compiler.ast.TrueLiteral; +import net.sourceforge.phpdt.internal.compiler.ast.Variable; +import net.sourceforge.phpdt.internal.compiler.ast.VariableDeclaration; +import net.sourceforge.phpdt.internal.compiler.ast.WhileStatement; import net.sourceforge.phpdt.internal.compiler.parser.Outlineable; +import net.sourceforge.phpdt.internal.compiler.parser.OutlineableWithChildren; import net.sourceforge.phpdt.internal.compiler.parser.PHPOutlineInfo; -import net.sourceforge.phpdt.internal.corext.Assert; +import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.actions.PHPStartApacheAction; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.ui.texteditor.MarkerUtilities; /** * A new php parser. @@ -28,7 +86,7 @@ import net.sourceforge.phpdt.internal.corext.Assert; * You can test the parser with the PHPParserTestCase2.java * @author Matthieu Casanova */ -public final class PHPParser extends PHPParserSuperclass implements PHPParserConstants { +public class PHPParser extends PHPParserSuperclass implements PHPParserConstants { //todo : fix the variables names bug //todo : handle tilde operator @@ -60,11 +118,11 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon //ast stack private final static int AstStackIncrement = 100; /** The stack of node. */ - private static AstNode[] nodes; + protected static AstNode[] nodes; /** The cursor in expression stack. */ private static int nodePtr; - public static final boolean PARSER_DEBUG = true; + public static final boolean PARSER_DEBUG = false; public final void setFileToParse(final IFile fileToParse) { PHPParser.fileToParse = fileToParse; @@ -121,7 +179,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon /** * Reinitialize the parser. */ - private static final void init() { + protected static final void init() { nodes = new AstNode[AstStackIncrement]; nodePtr = -1; htmlStart = 0; @@ -209,14 +267,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; } @@ -261,7 +319,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon else attributes.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_INFO)); MarkerUtilities.setLineNumber(attributes, lineNumber); - MarkerUtilities.createMarker(file, attributes, IMarker.PROBLEM); +// MarkerUtilities.createMarker(file, attributes, IMarker.PROBLEM); + MarkerUtilities.createMarker(file, attributes, IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER); } } } @@ -312,9 +371,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon currentPosition > SimpleCharStream.currentBuffer.length()) { return; } - final char[] chars = SimpleCharStream.currentBuffer.substring(htmlStart, - currentPosition).toCharArray(); - pushOnAstNodes(new HTMLCode(chars, htmlStart,currentPosition)); + final String html = SimpleCharStream.currentBuffer.substring(htmlStart, currentPosition); + pushOnAstNodes(new HTMLCode(html, htmlStart,currentPosition)); } /** Create a new task. */ @@ -335,7 +393,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon } } - private static final void parse() throws ParseException { + protected static final void parse() throws ParseException { phpFile(); } @@ -396,6 +454,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -473,6 +532,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -516,8 +576,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon } catch (ParseException e) { errorMessage = "'?>' expected"; errorLevel = ERROR; - errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = SimpleCharStream.getPosition() + 1; + errorStart = e.currentToken.sourceStart; + errorEnd = e.currentToken.sourceEnd; processParseExceptionDebug(e); } break; @@ -593,6 +653,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -683,8 +744,8 @@ Token token; } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image + "'. '{' expected"; errorLevel = ERROR; - errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = SimpleCharStream.getPosition() + 1; + errorStart = e.currentToken.sourceStart; + errorEnd = e.currentToken.sourceEnd; processParseExceptionDebug(e); } label_3: @@ -706,8 +767,8 @@ Token token; } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. 'var', 'function' or '}' expected"; errorLevel = ERROR; - errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = SimpleCharStream.getPosition() + 1; + errorStart = e.currentToken.sourceStart; + errorEnd = e.currentToken.sourceEnd; processParseExceptionDebug(e); {if (true) return PHPParser.token.sourceEnd;} } @@ -751,7 +812,6 @@ Token token; token = jj_consume_token(VAR); variableDeclaration = VariableDeclaratorNoSuffix(); arrayList.add(variableDeclaration); - outlineInfo.addVariable(variableDeclaration.name()); pos = variableDeclaration.sourceEnd; label_4: while (true) { @@ -798,21 +858,21 @@ Token token; * It will be used by fields and formal parameters */ static final public VariableDeclaration VariableDeclaratorNoSuffix() throws ParseException { - final Token dollar, token, lbrace,rbrace; + final Token token, lbrace,rbrace; Expression expr, initializer = null; Token assignToken; Variable variable; - dollar = jj_consume_token(DOLLAR); + jj_consume_token(DOLLAR); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: token = jj_consume_token(IDENTIFIER); - variable = new Variable(token.image,dollar.sourceStart,token.sourceEnd); + variable = new Variable(token.image,token.sourceStart,token.sourceEnd); break; case LBRACE: lbrace = jj_consume_token(LBRACE); expr = Expression(); rbrace = jj_consume_token(RBRACE); - variable = new Variable(expr,dollar.sourceStart,rbrace.sourceEnd); + variable = new Variable(expr,lbrace.sourceStart,rbrace.sourceEnd); break; default: jj_la1[10] = jj_gen; @@ -914,8 +974,8 @@ Token token; } catch (ParseException e) { errorMessage = "'$' expected for variable identifier"; errorLevel = ERROR; - errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = SimpleCharStream.getPosition() + 1; + errorStart = e.currentToken.sourceStart; + errorEnd = e.currentToken.sourceEnd; {if (true) throw e;} } throw new Error("Missing return statement in function"); @@ -925,12 +985,12 @@ Token token; Variable variable = null; final Token token; token = jj_consume_token(DOLLAR); - variable = Var(token); - {if (true) return new Variable(variable,token.sourceStart,variable.sourceEnd);} + variable = Var(); + {if (true) return variable;} throw new Error("Missing return statement in function"); } - static final public Variable Var(final Token dollar) throws ParseException { + static final public Variable Var() throws ParseException { Variable variable = null; final Token token,token2; ConstantIdentifier constant; @@ -938,20 +998,21 @@ Token token; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DOLLAR: token = jj_consume_token(DOLLAR); - variable = Var(token); - {if (true) return new Variable(variable,dollar.sourceStart,variable.sourceEnd);} + variable = Var(); + {if (true) return new Variable(variable,variable.sourceStart,variable.sourceEnd);} break; case LBRACE: token = jj_consume_token(LBRACE); expression = Expression(); token2 = jj_consume_token(RBRACE); {if (true) return new Variable(expression, - dollar.sourceStart, + token.sourceStart, token2.sourceEnd);} break; case IDENTIFIER: token = jj_consume_token(IDENTIFIER); - {if (true) return new Variable(token.image,dollar.sourceStart,token.sourceEnd);} + outlineInfo.addVariable('$' + token.image); + {if (true) return new Variable(token.image,token.sourceStart,token.sourceEnd);} break; default: jj_la1[13] = jj_gen; @@ -971,6 +1032,7 @@ Token token; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: expr = Literal(); {if (true) return expr;} break; @@ -1066,6 +1128,7 @@ final Expression expr,expr2; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -1120,8 +1183,8 @@ final Expression expr,expr2; if (errorMessage != null) {if (true) throw e;} errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', function identifier expected"; errorLevel = ERROR; - errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = SimpleCharStream.getPosition() + 1; + errorStart = e.currentToken.sourceStart; + errorEnd = e.currentToken.sourceEnd; {if (true) throw e;} } currentSegment = functionDeclaration; @@ -1140,7 +1203,7 @@ final Expression expr,expr2; static final public MethodDeclaration MethodDeclarator(final int start) throws ParseException { Token identifier = null; Token reference = null; - final Hashtable formalParameters = new Hashtable(); + final ArrayList formalParameters = new ArrayList(); String identifierChar = SYNTAX_ERROR_CHAR; int end = start; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1192,7 +1255,7 @@ final Expression expr,expr2; * FormalParameters follows method identifier. * (FormalParameter()) */ - static final public int FormalParameters(final Hashtable parameters) throws ParseException { + static final public int FormalParameters(final ArrayList parameters) throws ParseException { VariableDeclaration var; final Token token; Token tok = PHPParser.token; @@ -1211,7 +1274,7 @@ final Expression expr,expr2; case BIT_AND: case DOLLAR: var = FormalParameter(); - parameters.put(var.name(),var);end = var.sourceEnd; + parameters.add(var);end = var.sourceEnd; label_7: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1224,7 +1287,7 @@ final Expression expr,expr2; } jj_consume_token(COMMA); var = FormalParameter(); - parameters.put(var.name(),var);end = var.sourceEnd; + parameters.add(var);end = var.sourceEnd; } break; default: @@ -1261,6 +1324,7 @@ final Expression expr,expr2; ; } variableDeclaration = VariableDeclaratorNoSuffix(); + outlineInfo.addVariable('$'+variableDeclaration.name()); if (token != null) { variableDeclaration.setReference(true); } @@ -1336,6 +1400,7 @@ final Expression expr,expr2; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -1882,7 +1947,7 @@ final Expression expr,expr2; 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; @@ -1970,6 +2035,7 @@ final Expression expr,expr2; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -2015,6 +2081,7 @@ final Expression expr,expr2; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -2061,6 +2128,7 @@ final Expression expr,expr2; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -2119,6 +2187,7 @@ final Token token; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: expr = Literal(); {if (true) return expr;} break; @@ -2400,7 +2469,7 @@ final Token token,token1; break; case IDENTIFIER: token = jj_consume_token(IDENTIFIER); - expression = new Variable(token.image,token.sourceStart,token.sourceEnd); + expression = new ConstantIdentifier(token.image,token.sourceStart,token.sourceEnd); break; case DOLLAR: expression = Variable(); @@ -2452,6 +2521,7 @@ final Token token,token1; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -2474,6 +2544,7 @@ final Token token,token1; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -2545,6 +2616,7 @@ final Token token,token1; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -2567,6 +2639,7 @@ final Token token,token1; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -2617,6 +2690,7 @@ final Token token,token1; static final public Literal Literal() throws ParseException { final Token token; + StringLiteral literal; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INTEGER_LITERAL: token = jj_consume_token(INTEGER_LITERAL); @@ -2642,6 +2716,10 @@ final Token token,token1; token = jj_consume_token(NULL); {if (true) return new NullLiteral(token);} break; + case DOUBLEQUOTE: + literal = evaluableString(); + {if (true) return literal;} + break; default: jj_la1[71] = jj_gen; jj_consume_token(-1); @@ -2650,10 +2728,59 @@ final Token token,token1; throw new Error("Missing return statement in function"); } + static final public StringLiteral evaluableString() throws ParseException { + ArrayList list = new ArrayList(); + Token start,end; + Token token,lbrace,rbrace; + AbstractVariable var; + Expression expr; + start = jj_consume_token(DOUBLEQUOTE); + label_20: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case DOLLARS: + ; + break; + default: + jj_la1[72] = jj_gen; + break label_20; + } + jj_consume_token(DOLLARS); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case IDENTIFIER: + token = jj_consume_token(IDENTIFIER); + list.add(new Variable(token.image, + token.sourceStart, + token.sourceEnd)); + break; + case LBRACE1: + lbrace = jj_consume_token(LBRACE1); + token = jj_consume_token(ID); + list.add(new Variable(token.image, + token.sourceStart, + token.sourceEnd)); + rbrace = jj_consume_token(RBRACE1); + break; + default: + jj_la1[73] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + 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), + start.sourceStart, + end.sourceEnd, + vars);} + throw new Error("Missing return statement in function"); + } + static final public FunctionCall Arguments(final Expression func) throws ParseException { Expression[] args = null; -final Token token; - jj_consume_token(LPAREN); +final Token token,lparen; + lparen = jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ARRAY: case LIST: @@ -2673,13 +2800,14 @@ final Token token; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: args = ArgumentList(); break; default: - jj_la1[72] = jj_gen; + jj_la1[74] = jj_gen; ; } try { @@ -2688,11 +2816,17 @@ final Token token; } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ')' expected to close the argument list"; errorLevel = ERROR; - errorStart = args[args.length-1].sourceEnd+1; - errorEnd = args[args.length-1].sourceEnd+1; + if (args == null) { + errorStart = lparen.sourceEnd+1; + errorEnd = lparen.sourceEnd+2; + } else { + errorStart = args[args.length-1].sourceEnd+1; + errorEnd = args[args.length-1].sourceEnd+2; + } processParseExceptionDebug(e); } - {if (true) return new FunctionCall(func,args,args[args.length-1].sourceEnd);} + int sourceEnd = (args == null && args.length != 0) ? lparen.sourceEnd+1 : args[args.length-1].sourceEnd; + {if (true) return new FunctionCall(func,args,sourceEnd);} throw new Error("Missing return statement in function"); } @@ -2708,15 +2842,15 @@ int pos; Token token; arg = Expression(); list.add(arg);pos = arg.sourceEnd; - label_20: + label_21: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: - jj_la1[73] = jj_gen; - break label_20; + jj_la1[75] = jj_gen; + break label_21; } token = jj_consume_token(COMMA); pos = token.sourceEnd; @@ -2808,7 +2942,7 @@ Token token; token = jj_consume_token(AT); break; default: - jj_la1[74] = jj_gen; + jj_la1[76] = jj_gen; ; } statement = IncludeStatement(); @@ -2831,7 +2965,7 @@ Token token; currentSegment.add((Outlineable)statement);{if (true) return statement;} break; default: - jj_la1[75] = jj_gen; + jj_la1[77] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2971,6 +3105,7 @@ Token token; case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case STRING_LITERAL: + case DOUBLEQUOTE: case DOLLAR: case IDENTIFIER: case LPAREN: @@ -2984,7 +3119,7 @@ Token token; {if (true) return statement;} break; default: - jj_la1[76] = jj_gen; + jj_la1[78] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3001,15 +3136,15 @@ Token token; final Token phpEnd; phpEnd = jj_consume_token(PHPEND); htmlStart = phpEnd.sourceEnd; - label_21: + label_22: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PHPECHOSTART: ; break; default: - jj_la1[77] = jj_gen; - break label_21; + jj_la1[79] = jj_gen; + break label_22; } phpEchoBlock(); } @@ -3022,7 +3157,7 @@ Token token; jj_consume_token(PHPSTARTSHORT); break; default: - jj_la1[78] = jj_gen; + jj_la1[80] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3030,8 +3165,8 @@ Token token; } catch (ParseException e) { errorMessage = "unexpected end of file , '= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } - for (int i = 0; i < 126; i++) { + for (int i = 0; i < 128; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { if ((jj_la1_0[i] & (1<