String expr = null;
}
{
- <CLASSACCESS> expr = VariableName()
+ <CLASSACCESS>
+ try {
+ expr = VariableName()
+ } catch (ParseException e) {
+ errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', function call or field access expected";
+ errorLevel = ERROR;
+ throw e;
+ }
{return "->" + expr;}
|
<LBRACKET> [ expr = Expression() ]
try {
<RPAREN>
} catch (ParseException e) {
- errorMessage = "')' expected to close the argument list";
+ errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ')' expected to close the argument list";
errorLevel = ERROR;
throw e;
}
{return buff.toString();}
}
-/*
- * Statement syntax follows.
+/**
+ * A Statement without break
*/
-
void StatementNoBreak() :
{}
{
GlobalStatement()
}
+/**
+ * A Normal statement
+ */
void Statement() :
{}
{
String expr;
}
{
- <LIST> <LPAREN>
+ <LIST>
+ try {
+ <LPAREN>
+ } catch (ParseException e) {
+ errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', '(' expected";
+ errorLevel = ERROR;
+ throw e;
+ }
[
expr = VariableDeclaratorId()
{buff.append(expr);}
]
- <COMMA>
- {buff.append(",");}
[
+ try {
+ <COMMA>
+ } catch (ParseException e) {
+ errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ',' expected";
+ errorLevel = ERROR;
+ throw e;
+ }
expr = VariableDeclaratorId()
- {buff.append(expr);}
+ {buff.append(",").append(expr);}
]
{buff.append(")");}
- <RPAREN>
+ try {
+ <RPAREN>
+ } catch (ParseException e) {
+ errorMessage = "unexpected token : '"+ e.currentToken.next.image +"', ')' expected";
+ errorLevel = ERROR;
+ throw e;
+ }
[ <ASSIGN> expr = Expression() {buff.append("(").append(expr);}]
{return buff.toString();}
}
try {
<RBRACE>
} catch (ParseException e) {
- errorMessage = "unexpected token : "+ e.currentToken.image +", '}' expected";
+ errorMessage = "unexpected token : '"+ e.currentToken.image +"', '}' expected";
errorLevel = ERROR;
throw e;
}
MethodDeclaration()
}
+/**
+ * A Block statement that will not contain any 'break'
+ */
void BlockStatementNoBreak() :
{}
{