} 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);
}
} 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;
Statement statement;
final ArrayList stmts = new ArrayList();
final Token token = PHPParser.token;
+ final int start = PHPParser.token.next.sourceStart;
expr = SwitchLabel();
label_31:
while (true) {
final Statement[] stmtsArray = new Statement[listSize];
stmts.toArray(stmtsArray);
if (expr == null) {//it's a default
- {if (true) return new DefaultCase(stmtsArray,token.sourceStart,stmtsArray[listSize-1].sourceEnd);}
+ final int end = PHPParser.token.next.sourceStart;
+ {if (true) return new DefaultCase(stmtsArray,start,end);}
}
if (listSize != 0) {
{if (true) return new Case(expr,stmtsArray,expr.sourceStart,stmtsArray[listSize-1].sourceEnd);}
} 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;
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_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_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_186() {
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_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_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_2() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
- if (jj_3R_41()) return true;
+ static final private boolean jj_3R_70() {
+ if (jj_3R_50()) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
return false;
}
- static final private boolean jj_3R_70() {
- if (jj_3R_50()) return true;
+ 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;
}
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_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_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_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;