} 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;
} 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:
} 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;}
}
token = jj_consume_token(VAR);
variableDeclaration = VariableDeclaratorNoSuffix();
arrayList.add(variableDeclaration);
- outlineInfo.addVariable(variableDeclaration.name());
pos = variableDeclaration.sourceEnd;
label_4:
while (true) {
} 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");
break;
case IDENTIFIER:
token = jj_consume_token(IDENTIFIER);
+ outlineInfo.addVariable("$" + token.image);
{if (true) return new Variable(token.image,token.sourceStart,token.sourceEnd);}
break;
default:
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;
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) {
* 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;
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) {
}
jj_consume_token(COMMA);
var = FormalParameter();
- parameters.put(var.name(),var);end = var.sourceEnd;
+ parameters.add(var);end = var.sourceEnd;
}
break;
default:
;
}
variableDeclaration = VariableDeclaratorNoSuffix();
+ outlineInfo.addVariable("$"+variableDeclaration.name());
if (token != null) {
variableDeclaration.setReference(true);
}
}
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");
}
} catch (ParseException e) {
errorMessage = "unexpected end of file , '<?php' expected";
errorLevel = ERROR;
- errorStart = SimpleCharStream.getPosition();
- errorEnd = SimpleCharStream.getPosition();
+ errorStart = e.currentToken.sourceStart;
+ errorEnd = e.currentToken.sourceEnd;
{if (true) throw e;}
}
nbNodes = nodePtr - startIndex;
}
try {
token = jj_consume_token(COLON);
- {if (true) return expr;}
} catch (ParseException e) {
errorMessage = "':' expected after case expression";
errorLevel = ERROR;
errorEnd = expr.sourceEnd+1;
processParseExceptionDebug(e);
}
+ {if (true) return expr;}
break;
case _DEFAULT:
token = jj_consume_token(_DEFAULT);
} catch (ParseException e) {
errorMessage = "'endif' 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;}
}
try {
} catch (ParseException e) {
errorMessage = "';' expected after 'endif' keyword";
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;}
}
elseIfs = new ElseIf[elseIfList.size()];
}
errorMessage = "unexpected token '"+e.currentToken.next.image+"', a statement was 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;}
}
break;
} catch (ParseException e) {
errorMessage = "'endwhile' 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;}
}
try {
} catch (ParseException e) {
errorMessage = "';' expected after 'endwhile' keyword";
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;}
}
break;
} catch (ParseException e) {
errorMessage = "'(' expected after 'foreach' keyword";
errorLevel = ERROR;
- errorStart = foreachToken.sourceEnd+1;
- errorEnd = foreachToken.sourceEnd+1;
+ errorStart = e.currentToken.sourceStart;
+ errorEnd = e.currentToken.sourceEnd;
processParseExceptionDebug(e);
{pos = foreachToken.sourceEnd+1;}
}
} catch (ParseException e) {
errorMessage = "variable expected";
errorLevel = ERROR;
- errorStart = pos;
- errorEnd = pos;
+ errorStart = e.currentToken.sourceStart;
+ errorEnd = e.currentToken.sourceEnd;
processParseExceptionDebug(e);
}
try {
} catch (ParseException e) {
errorMessage = "'as' expected";
errorLevel = ERROR;
- errorStart = pos;
- errorEnd = pos;
+ errorStart = e.currentToken.sourceStart;
+ errorEnd = e.currentToken.sourceEnd;
processParseExceptionDebug(e);
}
try {
if (errorMessage != null) {if (true) throw e;}
errorMessage = "variable expected";
errorLevel = ERROR;
- errorStart = pos;
- errorEnd = pos;
+ errorStart = e.currentToken.sourceStart;
+ errorEnd = e.currentToken.sourceEnd;
processParseExceptionDebug(e);
}
try {
} catch (ParseException e) {
errorMessage = "')' expected after 'foreach' keyword";
errorLevel = ERROR;
- errorStart = pos;
- errorEnd = pos;
+ errorStart = e.currentToken.sourceStart;
+ errorEnd = e.currentToken.sourceEnd;
processParseExceptionDebug(e);
}
try {
if (errorMessage != null) {if (true) throw e;}
errorMessage = "statement expected";
errorLevel = ERROR;
- errorStart = pos;
- errorEnd = pos;
+ errorStart = e.currentToken.sourceStart;
+ errorEnd = e.currentToken.sourceEnd;
processParseExceptionDebug(e);
}
{if (true) return new ForeachStatement(expression,
return retval;
}
- static final private boolean jj_3R_115() {
- if (jj_scan_token(XOR)) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- if (jj_3R_114()) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
static final private boolean jj_3R_210() {
if (jj_3R_116()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
+ static final private boolean jj_3R_106() {
+ if (jj_scan_token(DOT)) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ if (jj_3R_103()) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
static final private boolean jj_3R_131() {
if (jj_scan_token(LBRACE)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3R_106() {
- if (jj_scan_token(DOT)) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ static final private boolean jj_3R_97() {
if (jj_3R_103()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_106()) { jj_scanpos = xsp; break; }
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ }
+ return false;
+ }
+
+ static final private boolean jj_3R_204() {
+ if (jj_3R_207()) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
return false;
}
- static final private boolean jj_3R_97() {
- if (jj_3R_103()) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_106()) { jj_scanpos = xsp; break; }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- }
- return false;
- }
-
- static final private boolean jj_3R_204() {
- if (jj_3R_207()) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
static final private boolean jj_3R_108() {
if (jj_scan_token(_ANDL)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3R_68() {
- if (jj_scan_token(DOLLAR)) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- if (jj_3R_122()) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
static final private boolean jj_3R_100() {
Token xsp;
xsp = jj_scanpos;
return false;
}
+ static final private boolean jj_3R_68() {
+ if (jj_scan_token(DOLLAR)) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ if (jj_3R_122()) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
static final private boolean jj_3R_202() {
if (jj_3R_207()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3_1() {
- if (jj_3R_40()) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
static final private boolean jj_3R_201() {
if (jj_3R_207()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
+ static final private boolean jj_3_1() {
+ if (jj_3R_40()) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
+ static final private boolean jj_3R_51() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ if (jj_3R_49()) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
static final private boolean jj_3R_200() {
if (jj_scan_token(STATICCLASSACCESS)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3R_116() {
- if (jj_3R_68()) return true;
+ static final private boolean jj_3R_45() {
+ if (jj_3R_49()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
Token xsp;
while (true) {
xsp = jj_scanpos;
- if (jj_3_1()) { jj_scanpos = xsp; break; }
+ if (jj_3R_51()) { jj_scanpos = xsp; break; }
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
}
return false;
}
- static final private boolean jj_3R_51() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- if (jj_3R_49()) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
- static final private boolean jj_3R_45() {
- if (jj_3R_49()) return true;
+ static final private boolean jj_3R_116() {
+ if (jj_3R_68()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
Token xsp;
while (true) {
xsp = jj_scanpos;
- if (jj_3R_51()) { jj_scanpos = xsp; break; }
+ if (jj_3_1()) { jj_scanpos = xsp; break; }
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
}
return false;
return false;
}
- static final private boolean jj_3R_94() {
- if (jj_scan_token(ORASSIGN)) return true;
+ static final private boolean jj_3_5() {
+ if (jj_3R_45()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3R_93() {
- if (jj_scan_token(XORASSIGN)) return true;
+ static final private boolean jj_3R_94() {
+ if (jj_scan_token(ORASSIGN)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3_5() {
- if (jj_3R_45()) return true;
+ static final private boolean jj_3R_93() {
+ if (jj_scan_token(XORASSIGN)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
return false;
}
- static final private boolean jj_3R_168() {
- if (jj_scan_token(MINUS_MINUS)) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
static final private boolean jj_3R_44() {
if (jj_3R_49()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
+ static final private boolean jj_3R_168() {
+ if (jj_scan_token(MINUS_MINUS)) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
static final private boolean jj_3R_167() {
if (jj_scan_token(PLUS_PLUS)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
+ static final private boolean jj_3R_117() {
+ if (jj_3R_116()) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
static final private boolean jj_3R_179() {
if (jj_scan_token(INTEGER_LITERAL)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3R_117() {
- if (jj_3R_116()) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
static final private boolean jj_3R_138() {
if (jj_scan_token(GE)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3R_135() {
- if (jj_scan_token(LT)) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
static final private boolean jj_3R_112() {
if (jj_scan_token(COMMA)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
+ static final private boolean jj_3R_135() {
+ if (jj_scan_token(LT)) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
static final private boolean jj_3R_124() {
Token xsp;
xsp = jj_scanpos;
return false;
}
- static final private boolean jj_3R_72() {
- if (jj_3R_50()) return true;
+ static final private boolean jj_3R_111() {
+ if (jj_3R_116()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3R_111() {
- if (jj_3R_116()) return true;
+ static final private boolean jj_3R_72() {
+ if (jj_3R_50()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
return false;
}
- static final private boolean jj_3R_206() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
static final private boolean jj_3R_104() {
if (jj_scan_token(LIST)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3_2() {
+ static final private boolean jj_3R_206() {
if (jj_scan_token(COMMA)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- if (jj_3R_41()) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
return false;
}
+ static final private boolean jj_3_2() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ if (jj_3R_41()) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
static final private boolean jj_3R_55() {
Token xsp;
xsp = jj_scanpos;
return false;
}
+ static final private boolean jj_3R_126() {
+ if (jj_scan_token(DIF)) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
+ static final private boolean jj_3R_105() {
+ if (jj_scan_token(PRINT)) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ if (jj_3R_49()) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
static final private boolean jj_3R_198() {
if (jj_scan_token(LPAREN)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3R_126() {
- if (jj_scan_token(DIF)) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
static final private boolean jj_3R_125() {
if (jj_scan_token(EQUAL_EQUAL)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3R_105() {
- if (jj_scan_token(PRINT)) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- if (jj_3R_49()) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
static final private boolean jj_3R_121() {
Token xsp;
xsp = jj_scanpos;
return false;
}
- static final private boolean jj_3R_41() {
- if (jj_3R_49()) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_214()) jj_scanpos = xsp;
- else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- return false;
- }
-
static final private boolean jj_3R_52() {
if (jj_scan_token(LBRACE)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
+ static final private boolean jj_3R_41() {
+ if (jj_3R_49()) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_214()) jj_scanpos = xsp;
+ else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
static final private boolean jj_3R_119() {
if (jj_scan_token(BIT_AND)) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
+ static final private boolean jj_3R_115() {
+ if (jj_scan_token(XOR)) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ if (jj_3R_114()) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
+ return false;
+ }
+
static private boolean jj_initialized_once = false;
static public PHPParserTokenManager token_source;
static SimpleCharStream jj_input_stream;