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 aba9b11..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;
/**
@@ -167,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,
@@ -281,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();
}
@@ -307,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:
@@ -322,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:
@@ -343,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();
@@ -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:
@@ -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;
@@ -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;
@@ -970,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:
@@ -1022,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();
@@ -1034,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");
}
@@ -1078,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");
}
@@ -1100,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:
@@ -1134,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");
@@ -1245,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:
@@ -1275,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;}
@@ -1293,7 +1290,7 @@ Expression expr,expr2;
{if (true) throw e;}
}
{if (true) return new VarAssignation(varName.toCharArray(),
- expression,
+ initializer,
assignOperator,
pos,
SimpleCharStream.getPosition());}
@@ -1796,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:
@@ -1833,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:
@@ -1878,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;
@@ -1912,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;
@@ -2025,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;
@@ -2057,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();
@@ -2068,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);
@@ -2090,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);
@@ -2109,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();
}
@@ -2117,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();
@@ -2148,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();
}
@@ -2180,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,
@@ -2208,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();
}
@@ -2228,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();
}
@@ -2277,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:
@@ -2299,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:
@@ -2324,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 {
@@ -2345,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();
}
@@ -2387,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();
}
@@ -2408,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:
@@ -2422,7 +2415,7 @@ Expression[] args = null;
args = ArgumentList();
break;
default:
- jj_la1[69] = jj_gen;
+ jj_la1[67] = jj_gen;
;
}
try {
@@ -2455,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);
@@ -2482,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);
@@ -2496,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 {
@@ -2512,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();
@@ -2574,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();
@@ -2591,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();
}
@@ -2600,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.
*/
@@ -2616,6 +2707,7 @@ final ArrayList list = new ArrayList();
case INCLUDE_ONCE:
case REQUIRE_ONCE:
case GLOBAL:
+ case DEFINE:
case STATIC:
case CONTINUE:
case DO:
@@ -2631,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:
@@ -2693,7 +2785,7 @@ final ArrayList list = new ArrayList();
throw new ParseException();
}
} catch (ParseException e) {
- errorMessage = "End of file unexpected, '= 0) {
@@ -6841,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;
@@ -6866,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) {
@@ -6880,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;