try {
statement = statement();
blockStatements.add(statement);
+ if (token == TokenNameEOF) {
+ return null;
+ }
if (branchStatement && statement != null) {
// reportSyntaxError("Unreachable code", statement.sourceStart,
// statement.sourceEnd);
if (Scanner.TRACE) {
System.out.println("TRACE: dynamic_class_name_reference()");
}
- base_variable();
+ base_variable(true);
if (token == TokenNameMINUS_GREATER) {
getNextToken();
object_property();
}
}
}
- // TODO is this ok ?
- return ref;
- // throwSyntaxError("'(' expected in function call.");
- }
- getNextToken();
- if (token == TokenNameRPAREN) {
+ } else {
getNextToken();
- return ref;
- }
- non_empty_function_call_parameter_list();
- if (token != TokenNameRPAREN) {
- String functionName;
- if (ident == null) {
- functionName = new String(" ");
- } else {
- functionName = new String(ident);
+ if (token == TokenNameRPAREN) {
+ getNextToken();
+ return ref;
+ }
+ non_empty_function_call_parameter_list();
+ if (token != TokenNameRPAREN) {
+ String functionName;
+ if (ident == null) {
+ functionName = new String(" ");
+ } else {
+ functionName = new String(ident);
+ }
+ throwSyntaxError("')' expected in function call (" + functionName + ").");
}
- throwSyntaxError("')' expected in function call (" + functionName + ").");
+ getNextToken();
}
- getNextToken();
return ref;
}
return function_call(lefthandside, ignoreVar);
}
- private Expression base_variable() {
+ private Expression base_variable(boolean lefthandside) {
// base_variable:
// reference_variable
// | simple_indirect_reference reference_variable
while (token == TokenNameDOLLAR) {
getNextToken();
}
- reference_variable(false, false);
+ reference_variable(lefthandside, false);
}
return ref;
}
}
}
// TODO is this ok ?
- return ref;
+ // return ref;
// throwSyntaxError("'(' expected in function call.");
- }
- getNextToken();
- if (token == TokenNameRPAREN) {
+ } else {
getNextToken();
- return ref;
- }
- non_empty_function_call_parameter_list();
- if (token != TokenNameRPAREN) {
- String functionName;
- if (ident == null) {
- functionName = new String(" ");
+
+ if (token == TokenNameRPAREN) {
+ getNextToken();
+ ref = null;
} else {
- functionName = new String(ident);
+ non_empty_function_call_parameter_list();
+ if (token != TokenNameRPAREN) {
+ String functionName;
+ if (ident == null) {
+ functionName = new String(" ");
+ } else {
+ functionName = new String(ident);
+ }
+ throwSyntaxError("')' expected in function call (" + functionName + ").");
+ }
+ getNextToken();
}
- throwSyntaxError("')' expected in function call (" + functionName + ").");
}
- getNextToken();
-
if (token == TokenNameMINUS_GREATER) {
ref = null;
getNextToken();