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 f0ea36f..8f6e050 100644 --- a/net.sourceforge.phpeclipse/src/test/PHPParser.java +++ b/net.sourceforge.phpeclipse/src/test/PHPParser.java @@ -8,7 +8,6 @@ import org.eclipse.ui.texteditor.MarkerUtilities; import org.eclipse.jface.preference.IPreferenceStore; import java.util.Hashtable; -import java.util.Enumeration; import java.util.ArrayList; import java.io.StringReader; import java.io.*; @@ -18,6 +17,7 @@ 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.internal.compiler.parser.Outlineable; import net.sourceforge.phpdt.internal.compiler.parser.PHPOutlineInfo; /** @@ -39,8 +39,6 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon private static final String PARSE_WARNING_STRING = "Warning"; //$NON-NLS-1$ static PHPOutlineInfo outlineInfo; - private static boolean assigning; - /** The error level of the current ParseException. */ private static int errorLevel = ERROR; /** The message of the current ParseException. If it's null it's because the parse exception wasn't handled */ @@ -169,31 +167,6 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon } } - /** - * Create markers according to the external parser output - */ - private static void createMarkers(final String output, final IFile file) throws CoreException { - // delete all markers - file.deleteMarkers(IMarker.PROBLEM, false, 0); - - int indx = 0; - int brIndx; - boolean flag = true; - while ((brIndx = output.indexOf("
", indx)) != -1) { - // newer php error output (tested with 4.2.3) - scanLine(output, file, indx, brIndx); - indx = brIndx + 6; - flag = false; - } - if (flag) { - while ((brIndx = output.indexOf("
", indx)) != -1) { - // older php error output (tested with 4.2.3) - scanLine(output, file, indx, brIndx); - indx = brIndx + 4; - } - } - } - private static void scanLine(final String output, final IFile file, final int indx, @@ -283,6 +256,25 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon pushOnAstNodes(new HTMLCode(chars, htmlStart,currentPosition)); } + /** + * Create a new task. + */ + public static final void createNewTask() { + final int currentPosition = SimpleCharStream.getPosition(); + final String todo = SimpleCharStream.currentBuffer.substring(currentPosition+1, + SimpleCharStream.currentBuffer.indexOf("\n", + currentPosition)-1); + try { + setMarker(fileToParse, + "todo : " + todo, + SimpleCharStream.getBeginLine(), + TASK, + "Line "+SimpleCharStream.getBeginLine()); + } catch (CoreException e) { + PHPeclipsePlugin.log(e); + } + } + private static final void parse() throws ParseException { phpFile(); } @@ -309,6 +301,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon case INCLUDE_ONCE: case REQUIRE_ONCE: case GLOBAL: + case DEFINE: case STATIC: case CONTINUE: case DO: @@ -324,8 +317,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon case AT: case DOLLAR: case BANG: - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: case PLUS: case MINUS: case BIT_AND: @@ -345,7 +338,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon } PhpBlock(); } - jj_consume_token(0); + PHPParser.createNewHTMLCode(); } catch (TokenMgrError e) { PHPeclipsePlugin.log(e); errorStart = SimpleCharStream.getPosition(); @@ -363,9 +356,11 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon */ static final public void PhpBlock() throws ParseException { final int start = SimpleCharStream.getPosition(); + final PHPEchoBlock phpEchoBlock; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PHPECHOSTART: - phpEchoBlock(); + phpEchoBlock = phpEchoBlock(); + pushOnAstNodes(phpEchoBlock); break; case PHPSTARTSHORT: case PHPSTARTLONG: @@ -383,6 +378,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon case INCLUDE_ONCE: case REQUIRE_ONCE: case GLOBAL: + case DEFINE: case STATIC: case CONTINUE: case DO: @@ -398,8 +394,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon case AT: case DOLLAR: case BANG: - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: case PLUS: case MINUS: case BIT_AND: @@ -497,6 +493,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon case INCLUDE_ONCE: case REQUIRE_ONCE: case GLOBAL: + case DEFINE: case STATIC: case CONTINUE: case DO: @@ -512,8 +509,8 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon case AT: case DOLLAR: case BANG: - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: case PLUS: case MINUS: case BIT_AND: @@ -559,7 +556,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon jj_consume_token(EXTENDS); try { superclassName = jj_consume_token(IDENTIFIER); - superclassNameImage = superclassName .image.toCharArray(); + superclassNameImage = superclassName.image.toCharArray(); } catch (ParseException e) { errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', identifier expected"; errorLevel = ERROR; @@ -638,10 +635,11 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FUNCTION: method = MethodDeclaration(); - method.setParent(classDeclaration); + classDeclaration.addMethod(method); break; case VAR: field = FieldDeclaration(); + classDeclaration.addField(field); break; default: jj_la1[8] = jj_gen; @@ -662,7 +660,6 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon variableDeclaration = VariableDeclarator(); arrayList.add(variableDeclaration); outlineInfo.addVariable(new String(variableDeclaration.name)); - currentSegment.add(variableDeclaration); label_4: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -677,7 +674,6 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon variableDeclaration = VariableDeclarator(); arrayList.add(variableDeclaration); outlineInfo.addVariable(new String(variableDeclaration.name)); - currentSegment.add(variableDeclaration); } try { jj_consume_token(SEMICOLON); @@ -738,13 +734,12 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon */ static final public String VariableDeclaratorId() throws ParseException { String expr; - Expression expression; + Expression expression = null; final StringBuffer buff = new StringBuffer(); final int pos = SimpleCharStream.getPosition(); ConstantIdentifier ex; try { expr = Variable(); - buff.append(expr); label_5: while (true) { if (jj_2_1(2)) { @@ -756,9 +751,11 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon pos, SimpleCharStream.getPosition()); expression = VariableSuffix(ex); - buff.append(expression.toStringExpression()); } - {if (true) return buff.toString();} + if (expression == null) { + {if (true) return expr;} + } + {if (true) return expression.toStringExpression();} } catch (ParseException e) { errorMessage = "'$' expected for variable identifier"; errorLevel = ERROR; @@ -769,6 +766,10 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon throw new Error("Missing return statement in function"); } +/** + * Return a variablename without the $. + * @return a variable name + */ static final public String Variable() throws ParseException { final StringBuffer buff; Expression expression = null; @@ -787,7 +788,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon jj_la1[11] = jj_gen; ; } - if (expression == null && !assigning) { + if (expression == null) { {if (true) return token.image.substring(1);} } buff = new StringBuffer(token.image); @@ -799,7 +800,7 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon case DOLLAR: jj_consume_token(DOLLAR); expr = VariableName(); - {if (true) return "$" + expr;} + {if (true) return expr;} break; default: jj_la1[12] = jj_gen; @@ -809,6 +810,10 @@ public final class PHPParser extends PHPParserSuperclass implements PHPParserCon throw new Error("Missing return statement in function"); } +/** + * A Variable name (without the $) + * @return a variable name String + */ static final public String VariableName() throws ParseException { final StringBuffer buff; String expr = null; @@ -966,8 +971,8 @@ Expression expr,expr2; case AT: case DOLLAR: case BANG: - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: case PLUS: case MINUS: case BIT_AND: @@ -1018,6 +1023,7 @@ Expression expr,expr2; static final public MethodDeclaration MethodDeclaration() throws ParseException { final MethodDeclaration functionDeclaration; final Block block; + final OutlineableWithChildren seg = currentSegment; jj_consume_token(FUNCTION); try { functionDeclaration = MethodDeclarator(); @@ -1030,16 +1036,11 @@ Expression expr,expr2; errorEnd = SimpleCharStream.getPosition() + 1; {if (true) throw e;} } - if (currentSegment != null) { - currentSegment.add(functionDeclaration); - currentSegment = functionDeclaration; - } + currentSegment = functionDeclaration; block = Block(); - functionDeclaration.statements = block.statements; - if (currentSegment != null) { - currentSegment = (OutlineableWithChildren) currentSegment.getParent(); - } - {if (true) return functionDeclaration;} + functionDeclaration.statements = block.statements; + currentSegment = seg; + {if (true) return functionDeclaration;} throw new Error("Missing return statement in function"); } @@ -1074,11 +1075,11 @@ Expression expr,expr2; } formalParameters = FormalParameters(); {if (true) return new MethodDeclaration(currentSegment, - identifierChar, - formalParameters, - reference != null, - pos, - SimpleCharStream.getPosition());} + identifierChar, + formalParameters, + reference != null, + pos, + SimpleCharStream.getPosition());} throw new Error("Missing return statement in function"); } @@ -1096,7 +1097,7 @@ Expression expr,expr2; errorLevel = ERROR; errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; errorEnd = SimpleCharStream.getPosition() + 1; - {if (true) throw e;} + processParseException(e); } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DOLLAR: @@ -1130,7 +1131,7 @@ Expression expr,expr2; errorLevel = ERROR; errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; errorEnd = SimpleCharStream.getPosition() + 1; - {if (true) throw e;} + processParseException(e); } {if (true) return parameters;} throw new Error("Missing return statement in function"); @@ -1241,8 +1242,8 @@ Expression expr,expr2; case AT: case DOLLAR: case BANG: - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: case PLUS: case MINUS: case BIT_AND: @@ -1271,13 +1272,13 @@ Expression expr,expr2; */ static final public VarAssignation varAssignation() throws ParseException { String varName; - final Expression expression; + final Expression initializer; final int assignOperator; final int pos = SimpleCharStream.getPosition(); varName = VariableDeclaratorId(); assignOperator = AssignmentOperator(); try { - expression = Expression(); + initializer = Expression(); } catch (ParseException e) { if (errorMessage != null) { {if (true) throw e;} @@ -1289,7 +1290,7 @@ Expression expr,expr2; {if (true) throw e;} } {if (true) return new VarAssignation(varName.toCharArray(), - expression, + initializer, assignOperator, pos, SimpleCharStream.getPosition());} @@ -1792,8 +1793,8 @@ Expression expr,expr2; case AT: case DOLLAR: case BANG: - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: case PLUS: case MINUS: case INTEGER_LITERAL: @@ -1829,8 +1830,8 @@ Expression expr,expr2; case FALSE: case DOLLAR: case BANG: - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: case PLUS: case MINUS: case INTEGER_LITERAL: @@ -1874,8 +1875,8 @@ Expression expr,expr2; expr = UnaryExpression(); {if (true) return new PrefixedUnaryExpression(expr,operator,pos);} break; - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: expr = PreIncDecExpression(); {if (true) return expr;} break; @@ -1908,13 +1909,13 @@ final Expression expr; final int operator; final int pos = SimpleCharStream.getPosition(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INCR: - jj_consume_token(INCR); - operator = OperatorIds.PLUS_PLUS; + case PLUS_PLUS: + jj_consume_token(PLUS_PLUS); + operator = OperatorIds.PLUS_PLUS; break; - case DECR: - jj_consume_token(DECR); - operator = OperatorIds.MINUS_MINUS; + case MINUS_MINUS: + jj_consume_token(MINUS_MINUS); + operator = OperatorIds.MINUS_MINUS; break; default: jj_la1[52] = jj_gen; @@ -2021,16 +2022,16 @@ final int pos = SimpleCharStream.getPosition(); final int pos = SimpleCharStream.getPosition(); expr = PrimaryExpression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INCR: - jj_consume_token(INCR); - operator = OperatorIds.PLUS_PLUS; + case PLUS_PLUS: + jj_consume_token(PLUS_PLUS); + operator = OperatorIds.PLUS_PLUS; break; - case DECR: - jj_consume_token(DECR); - operator = OperatorIds.MINUS_MINUS; + case MINUS_MINUS: + jj_consume_token(MINUS_MINUS); + operator = OperatorIds.MINUS_MINUS; break; default: jj_la1[56] = jj_gen; @@ -2053,7 +2054,7 @@ final int pos = SimpleCharStream.getPosition(); final Token identifier; Expression expr; final int pos = SimpleCharStream.getPosition(); - if (jj_2_5(2)) { + if (jj_2_7(2)) { identifier = jj_consume_token(IDENTIFIER); jj_consume_token(STATICCLASSACCESS); expr = ClassIdentifier(); @@ -2064,14 +2065,9 @@ final int pos = SimpleCharStream.getPosition(); ClassAccess.STATIC); label_19: while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CLASSACCESS: - case LPAREN: - case LBRACKET: + if (jj_2_5(2147483647)) { ; - break; - default: - jj_la1[58] = jj_gen; + } else { break label_19; } expr = PrimarySuffix(expr); @@ -2086,14 +2082,9 @@ final int pos = SimpleCharStream.getPosition(); expr = PrimaryPrefix(); label_20: while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CLASSACCESS: - case LPAREN: - case LBRACKET: + if (jj_2_6(2147483647)) { ; - break; - default: - jj_la1[59] = jj_gen; + } else { break label_20; } expr = PrimarySuffix(expr); @@ -2105,7 +2096,7 @@ final int pos = SimpleCharStream.getPosition(); {if (true) return expr;} break; default: - jj_la1[60] = jj_gen; + jj_la1[58] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2113,6 +2104,11 @@ final int pos = SimpleCharStream.getPosition(); throw new Error("Missing return statement in function"); } +/** + * An array declarator. + * array(vars) + * @return an array + */ static final public ArrayInitializer ArrayDeclarator() throws ParseException { final ArrayVariableDeclaration[] vars; final int pos = SimpleCharStream.getPosition(); @@ -2144,12 +2140,13 @@ final int pos = SimpleCharStream.getPosition(); case DOLLAR: case DOLLAR_ID: var = VariableDeclaratorId(); - {if (true) return new ConstantIdentifier(var.toCharArray(), - pos, - SimpleCharStream.getPosition());} + {if (true) return new VariableDeclaration(currentSegment, + var.toCharArray(), + pos, + SimpleCharStream.getPosition());} break; default: - jj_la1[61] = jj_gen; + jj_la1[59] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2176,7 +2173,7 @@ final int pos = SimpleCharStream.getPosition(); SimpleCharStream.getPosition()); break; default: - jj_la1[62] = jj_gen; + jj_la1[60] = jj_gen; ; } {if (true) return new PrefixedUnaryExpression(expr, @@ -2204,7 +2201,7 @@ final int pos = SimpleCharStream.getPosition(); SimpleCharStream.getPosition());} break; default: - jj_la1[63] = jj_gen; + jj_la1[61] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2224,7 +2221,7 @@ final int pos = SimpleCharStream.getPosition(); {if (true) return expr;} break; default: - jj_la1[64] = jj_gen; + jj_la1[62] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2273,8 +2270,8 @@ final int pos = SimpleCharStream.getPosition(); case AT: case DOLLAR: case BANG: - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: case PLUS: case MINUS: case BIT_AND: @@ -2295,8 +2292,8 @@ final int pos = SimpleCharStream.getPosition(); case AT: case DOLLAR: case BANG: - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: case PLUS: case MINUS: case BIT_AND: @@ -2320,13 +2317,13 @@ final int pos = SimpleCharStream.getPosition(); expression = Type(); break; default: - jj_la1[65] = jj_gen; + jj_la1[63] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: - jj_la1[66] = jj_gen; + jj_la1[64] = jj_gen; ; } try { @@ -2341,7 +2338,7 @@ final int pos = SimpleCharStream.getPosition(); {if (true) return new ArrayDeclarator(prefix,expression,SimpleCharStream.getPosition());} break; default: - jj_la1[67] = jj_gen; + jj_la1[65] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2383,7 +2380,7 @@ final int pos = SimpleCharStream.getPosition(); {if (true) return new NullLiteral(pos-4,pos);} break; default: - jj_la1[68] = jj_gen; + jj_la1[66] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2404,8 +2401,8 @@ Expression[] args = null; case AT: case DOLLAR: case BANG: - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: case PLUS: case MINUS: case BIT_AND: @@ -2418,7 +2415,7 @@ Expression[] args = null; args = ArgumentList(); break; default: - jj_la1[69] = jj_gen; + jj_la1[67] = jj_gen; ; } try { @@ -2451,7 +2448,7 @@ final ArrayList list = new ArrayList(); ; break; default: - jj_la1[70] = jj_gen; + jj_la1[68] = jj_gen; break label_21; } jj_consume_token(COMMA); @@ -2478,7 +2475,7 @@ final ArrayList list = new ArrayList(); static final public Statement StatementNoBreak() throws ParseException { final Statement statement; Token token = null; - if (jj_2_6(2)) { + if (jj_2_8(2)) { statement = Expression(); try { jj_consume_token(SEMICOLON); @@ -2492,7 +2489,7 @@ final ArrayList list = new ArrayList(); } } {if (true) return statement;} - } else if (jj_2_7(2)) { + } else if (jj_2_9(2)) { statement = LabeledStatement(); {if (true) return statement;} } else { @@ -2508,8 +2505,8 @@ final ArrayList list = new ArrayList(); case ARRAY: case NEW: case DOLLAR: - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: case IDENTIFIER: case DOLLAR_ID: statement = StatementExpression(); @@ -2570,7 +2567,7 @@ final ArrayList list = new ArrayList(); token = jj_consume_token(AT); break; default: - jj_la1[71] = jj_gen; + jj_la1[69] = jj_gen; ; } statement = IncludeStatement(); @@ -2587,8 +2584,12 @@ final ArrayList list = new ArrayList(); statement = GlobalStatement(); {if (true) return statement;} break; + case DEFINE: + statement = defineStatement(); + currentSegment.add((Outlineable)statement);{if (true) return statement;} + break; default: - jj_la1[72] = jj_gen; + jj_la1[70] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2596,6 +2597,100 @@ final ArrayList list = new ArrayList(); throw new Error("Missing return statement in function"); } + static final public Define defineStatement() throws ParseException { + final int start = SimpleCharStream.getPosition(); + Expression defineName,defineValue; + jj_consume_token(DEFINE); + try { + jj_consume_token(LPAREN); + } 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; + processParseException(e); + } + try { + defineName = Expression(); + } catch (ParseException e) { + errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', expression expected"; + errorLevel = ERROR; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; + {if (true) throw e;} + } + try { + jj_consume_token(COMMA); + } 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; + processParseException(e); + } + try { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case PRINT: + defineValue = PrintExpression(); + break; + default: + jj_la1[71] = jj_gen; + if (jj_2_10(2147483647)) { + defineValue = varAssignation(); + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case ARRAY: + case NEW: + case NULL: + case TRUE: + case FALSE: + case AT: + case DOLLAR: + case BANG: + case PLUS_PLUS: + case MINUS_MINUS: + case PLUS: + case MINUS: + case BIT_AND: + case INTEGER_LITERAL: + case FLOATING_POINT_LITERAL: + case STRING_LITERAL: + case IDENTIFIER: + case LPAREN: + case DOLLAR_ID: + defineValue = ConditionalExpression(); + break; + default: + jj_la1[72] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + } catch (ParseException e) { + errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', expression expected"; + errorLevel = ERROR; + errorStart = SimpleCharStream.getPosition() - e.currentToken.next.image.length() + 1; + errorEnd = SimpleCharStream.getPosition() + 1; + {if (true) throw e;} + } + try { + jj_consume_token(RPAREN); + } 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; + processParseException(e); + } + {if (true) return new Define(currentSegment, + defineName, + defineValue, + start, + SimpleCharStream.getPosition());} + throw new Error("Missing return statement in function"); + } + /** * A Normal statement. */ @@ -2612,6 +2707,7 @@ final ArrayList list = new ArrayList(); case INCLUDE_ONCE: case REQUIRE_ONCE: case GLOBAL: + case DEFINE: case STATIC: case CONTINUE: case DO: @@ -2627,8 +2723,8 @@ final ArrayList list = new ArrayList(); case AT: case DOLLAR: case BANG: - case INCR: - case DECR: + case PLUS_PLUS: + case MINUS_MINUS: case PLUS: case MINUS: case BIT_AND: @@ -2689,7 +2785,7 @@ final ArrayList list = new ArrayList(); throw new ParseException(); } } catch (ParseException e) { - errorMessage = "End of file unexpected, '= 0) { @@ -6837,7 +6993,7 @@ final int startBlock, endBlock; } } } - for (int i = 0; i < 141; i++) { + for (int i = 0; i < 143; i++) { if (la1tokens[i]) { jj_expentry = new int[1]; jj_expentry[0] = i; @@ -6862,7 +7018,7 @@ final int startBlock, endBlock; static final private void jj_rescan_token() { jj_rescan = true; - for (int i = 0; i < 8; i++) { + for (int i = 0; i < 11; i++) { JJCalls p = jj_2_rtns[i]; do { if (p.gen > jj_gen) { @@ -6876,6 +7032,9 @@ final int startBlock, endBlock; case 5: jj_3_6(); break; case 6: jj_3_7(); break; case 7: jj_3_8(); break; + case 8: jj_3_9(); break; + case 9: jj_3_10(); break; + case 10: jj_3_11(); break; } } p = p.next;