X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/test/PHPParser.jj b/net.sourceforge.phpeclipse/src/test/PHPParser.jj index 438fa59..34f35cc 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.jj +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.jj @@ -60,7 +60,6 @@ public final class PHPParser extends PHPParserSuperclass { private static final String PARSE_WARNING_STRING = "Warning"; //$NON-NLS-1$ static PHPOutlineInfo outlineInfo; - public static MethodDeclaration currentFunction; private static boolean assigning; /** The error level of the current ParseException. */ @@ -124,7 +123,7 @@ public final class PHPParser extends PHPParserSuperclass { public final PHPOutlineInfo parseInfo(final Object parent, final String s) { currentSegment = new PHPDocument(parent); - outlineInfo = new PHPOutlineInfo(parent); + outlineInfo = new PHPOutlineInfo(parent, currentSegment); final StringReader stream = new StringReader(s); if (jj_input_stream == null) { jj_input_stream = new SimpleCharStream(stream, 1, 1); @@ -136,7 +135,6 @@ public final class PHPParser extends PHPParserSuperclass { phpDocument = new PHPDocument(null); phpDocument.nodes = new AstNode[nodes.length]; System.arraycopy(nodes,0,phpDocument.nodes,0,nodes.length); - PHPeclipsePlugin.log(1,phpDocument.toString()); } catch (ParseException e) { processParseException(e); } @@ -152,7 +150,7 @@ public final class PHPParser extends PHPParserSuperclass { if (errorMessage == null) { PHPeclipsePlugin.log(e); errorMessage = "this exception wasn't handled by the parser please tell us how to reproduce it"; - errorStart = jj_input_stream.getPosition(); + errorStart = SimpleCharStream.getPosition(); errorEnd = errorStart + 1; } setMarker(e); @@ -631,7 +629,7 @@ void phpFile() : */ void PhpBlock() : { - final int start = jj_input_stream.getPosition(); + final int start = SimpleCharStream.getPosition(); } { phpEchoBlock() @@ -642,7 +640,7 @@ void PhpBlock() : setMarker(fileToParse, "You should use '' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } @@ -691,13 +689,13 @@ ClassDeclaration ClassDeclaration() : { try { - {pos = jj_input_stream.getPosition();} + {pos = SimpleCharStream.getPosition();} className = } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', identifier expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } [ @@ -707,8 +705,8 @@ ClassDeclaration ClassDeclaration() : } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', identifier expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } ] @@ -768,7 +766,8 @@ void ClassBodyDeclaration(ClassDeclaration classDeclaration) : FieldDeclaration field; } { - method = MethodDeclaration() {classDeclaration.addMethod(method);} + method = MethodDeclaration() {method.setParent(classDeclaration); + classDeclaration.addMethod(method);} | field = FieldDeclaration() {classDeclaration.addVariable(field);} } @@ -806,14 +805,15 @@ FieldDeclaration FieldDeclaration() : arrayList.toArray(list); return new FieldDeclaration(list, pos, - SimpleCharStream.getPosition());} + SimpleCharStream.getPosition(), + currentSegment);} } VariableDeclaration VariableDeclarator() : { final String varName; Expression initializer = null; - final int pos = jj_input_stream.getPosition(); + final int pos = SimpleCharStream.getPosition(); } { varName = VariableDeclaratorId() @@ -824,8 +824,8 @@ VariableDeclaration VariableDeclarator() : } 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; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } ] @@ -834,7 +834,7 @@ VariableDeclaration VariableDeclarator() : return new VariableDeclaration(currentSegment, varName.toCharArray(), pos, - jj_input_stream.getPosition()); + SimpleCharStream.getPosition()); } return new VariableDeclaration(currentSegment, varName.toCharArray(), @@ -869,8 +869,8 @@ String VariableDeclaratorId() : } catch (ParseException e) { errorMessage = "'$' expected for variable identifier"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } @@ -908,9 +908,9 @@ String VariableName(): } { expression = Expression() - {buff = new StringBuffer('{'); + {buff = new StringBuffer("{"); buff.append(expression.toStringExpression()); - buff.append('}'); + buff.append("}"); return buff.toString();} | token = [ expression = Expression() ] @@ -1016,8 +1016,8 @@ MethodDeclaration MethodDeclaration() : if (errorMessage != null) throw e; errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', function identifier expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } { @@ -1025,12 +1025,10 @@ MethodDeclaration MethodDeclaration() : currentSegment.add(functionDeclaration); currentSegment = functionDeclaration; } - currentFunction = functionDeclaration; } block = Block() { functionDeclaration.statements = block.statements; - currentFunction = null; if (currentSegment != null) { currentSegment = (OutlineableWithChildren) currentSegment.getParent(); } @@ -1076,8 +1074,8 @@ Hashtable FormalParameters() : } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', '(' expected after function identifier"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } [ var = FormalParameter() @@ -1092,8 +1090,8 @@ Hashtable FormalParameters() : } catch (ParseException e) { errorMessage = "')' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } {return parameters;} @@ -1183,8 +1181,8 @@ VarAssignation varAssignation() : } errorMessage = "expression expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } {return new VarAssignation(varName.toCharArray(), @@ -1335,8 +1333,8 @@ Expression EqualityExpression() : } errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', expression expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } { @@ -1409,8 +1407,8 @@ Expression MultiplicativeExpression() : if (errorMessage != null) throw e; errorMessage = "unexpected token '"+e.currentToken.next.image+"'"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } ( @@ -1503,8 +1501,8 @@ Expression UnaryExpressionNotPlusMinus() : } catch (ParseException e) { errorMessage = "')' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } {return expr;} @@ -1654,8 +1652,8 @@ AbstractSuffixExpression VariableSuffix(Expression prefix) : } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', function call or field access expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } {return new ClassAccess(prefix, @@ -1668,8 +1666,8 @@ AbstractSuffixExpression VariableSuffix(Expression prefix) : } catch (ParseException e) { errorMessage = "']' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } {return new ArrayDeclarator(prefix,expression,SimpleCharStream.getPosition());} @@ -1706,8 +1704,8 @@ Expression[] args = null; } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ')' expected to close the argument list"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } {return new FunctionCall(func,args,SimpleCharStream.getPosition());} @@ -1733,8 +1731,8 @@ final ArrayList list = new ArrayList(); } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. An expression expected after a comma in argument list"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } )* @@ -1761,8 +1759,8 @@ Statement StatementNoBreak() : if (e.currentToken.next.kind != 4) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } @@ -1777,8 +1775,8 @@ Statement StatementNoBreak() : } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } {return statement;} @@ -1828,8 +1826,8 @@ HTMLBlock htmlBlock() : } catch (ParseException e) { errorMessage = "End of file unexpected, ' expression = Expression() @@ -1980,8 +1978,8 @@ EchoStatement EchoStatement() : if (e.currentToken.next.kind != 4) { errorMessage = "';' expected after 'echo' statement"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } @@ -1989,7 +1987,7 @@ EchoStatement EchoStatement() : GlobalStatement GlobalStatement() : { - final int pos = jj_input_stream.getPosition(); + final int pos = SimpleCharStream.getPosition(); String expr; ArrayList vars = new ArrayList(); GlobalStatement global; @@ -2016,8 +2014,8 @@ GlobalStatement GlobalStatement() : } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. a ';' was expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } @@ -2042,8 +2040,8 @@ StaticStatement StaticStatement() : } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. a ';' was expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } @@ -2078,8 +2076,8 @@ Block Block() : } catch (ParseException e) { errorMessage = "'{' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } ( statement = BlockStatement() {list.add(statement);} @@ -2089,8 +2087,8 @@ Block Block() : } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.image +"', '}' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } { @@ -2150,7 +2148,7 @@ VariableDeclaration LocalVariableDeclarator() : return new VariableDeclaration(currentSegment, varName.toCharArray(), pos, - jj_input_stream.getPosition()); + SimpleCharStream.getPosition()); } return new VariableDeclaration(currentSegment, varName.toCharArray(), @@ -2203,8 +2201,8 @@ SwitchStatement SwitchStatement() : } catch (ParseException e) { errorMessage = "'(' expected after 'switch'"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } try { @@ -2215,8 +2213,8 @@ SwitchStatement SwitchStatement() : } errorMessage = "expression expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } try { @@ -2224,8 +2222,8 @@ SwitchStatement SwitchStatement() : } catch (ParseException e) { errorMessage = "')' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } (cases = switchStatementBrace() | cases = switchStatementColon(pos, pos + 6)) @@ -2249,8 +2247,8 @@ AbstractCase[] switchStatementBrace() : } catch (ParseException e) { errorMessage = "'}' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } @@ -2282,8 +2280,8 @@ AbstractCase[] switchStatementColon(final int start, final int end) : } catch (ParseException e) { errorMessage = "'endswitch' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } try { @@ -2295,8 +2293,8 @@ AbstractCase[] switchStatementColon(final int start, final int end) : } catch (ParseException e) { errorMessage = "';' expected after 'endswitch' keyword"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } @@ -2340,8 +2338,8 @@ Expression SwitchLabel() : if (errorMessage != null) throw e; errorMessage = "expression expected after 'case' keyword"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } try { @@ -2350,8 +2348,8 @@ Expression SwitchLabel() : } catch (ParseException e) { errorMessage = "':' expected after case expression"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } | @@ -2362,8 +2360,8 @@ Expression SwitchLabel() : } catch (ParseException e) { errorMessage = "':' expected after 'default' keyword"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } @@ -2380,8 +2378,8 @@ Break BreakStatement() : } catch (ParseException e) { errorMessage = "';' expected after 'break' keyword"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } {return new Break(expression, start, SimpleCharStream.getPosition());} @@ -2389,7 +2387,7 @@ Break BreakStatement() : IfStatement IfStatement() : { - final int pos = jj_input_stream.getPosition(); + final int pos = SimpleCharStream.getPosition(); Expression condition; IfStatement ifStatement; } @@ -2409,7 +2407,7 @@ Expression Condition(final String keyword) : } catch (ParseException e) { errorMessage = "'(' expected after " + keyword + " keyword"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length(); + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length(); errorEnd = errorStart +1; processParseException(e); } @@ -2420,8 +2418,8 @@ Expression Condition(final String keyword) : } catch (ParseException e) { errorMessage = "')' expected after " + keyword + " keyword"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } @@ -2463,8 +2461,8 @@ IfStatement IfStatement0(Expression condition, final int start,final int end) : } catch (ParseException e) { errorMessage = "'endif' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } try { @@ -2472,8 +2470,8 @@ IfStatement IfStatement0(Expression condition, final int start,final int end) : } catch (ParseException e) { errorMessage = "';' expected after 'endif' keyword"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } { @@ -2513,8 +2511,8 @@ IfStatement IfStatement0(Expression condition, final int start,final int end) : } errorMessage = "unexpected token '"+e.currentToken.next.image+"', a statement was expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } ] @@ -2612,8 +2610,8 @@ Statement WhileStatement0(final int start, final int end) : } catch (ParseException e) { errorMessage = "'endwhile' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } try { @@ -2625,8 +2623,8 @@ Statement WhileStatement0(final int start, final int end) : } catch (ParseException e) { errorMessage = "';' expected after 'endwhile' keyword"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } | @@ -2648,8 +2646,8 @@ DoStatement DoStatement() : } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"'. A ';' was expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } @@ -2668,8 +2666,8 @@ ForeachStatement ForeachStatement() : } catch (ParseException e) { errorMessage = "'(' expected after 'foreach' keyword"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } try { @@ -2677,8 +2675,8 @@ ForeachStatement ForeachStatement() : } catch (ParseException e) { errorMessage = "variable expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } try { @@ -2686,8 +2684,8 @@ ForeachStatement ForeachStatement() : } catch (ParseException e) { errorMessage = "'as' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } try { @@ -2695,8 +2693,8 @@ ForeachStatement ForeachStatement() : } catch (ParseException e) { errorMessage = "variable expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } try { @@ -2704,8 +2702,8 @@ ForeachStatement ForeachStatement() : } catch (ParseException e) { errorMessage = "')' expected after 'foreach' keyword"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } try { @@ -2714,8 +2712,8 @@ ForeachStatement ForeachStatement() : if (errorMessage != null) throw e; errorMessage = "statement expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } {return new ForeachStatement(expression, @@ -2744,8 +2742,8 @@ final int startBlock, endBlock; } catch (ParseException e) { errorMessage = "'(' expected after 'for' keyword"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } [ initializations = ForInit() ] @@ -2776,8 +2774,8 @@ final int startBlock, endBlock; } catch (ParseException e) { errorMessage = "'endfor' expected"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } try { @@ -2789,8 +2787,8 @@ final int startBlock, endBlock; } catch (ParseException e) { errorMessage = "';' expected after 'endfor' keyword"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } ) @@ -2836,8 +2834,8 @@ Continue ContinueStatement() : } catch (ParseException e) { errorMessage = "';' expected after 'continue' statement"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } @@ -2855,8 +2853,8 @@ ReturnStatement ReturnStatement() : } catch (ParseException e) { errorMessage = "';' expected after 'return' statement"; errorLevel = ERROR; - errorStart = jj_input_stream.getPosition() - e.currentToken.next.image.length() + 1; - errorEnd = jj_input_stream.getPosition() + 1; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; throw e; } } \ No newline at end of file