<DOLLAR> VariableName()
}
-void VariableName():
+String VariableName():
{}
{
<LBRACE> Expression() <RBRACE>
<INTEGER>
}
-/*
- * Expression syntax follows.
- */
-
void Expression() :
-/*
- * This expansion has been written this way instead of:
- * Assignment() | ConditionalExpression()
- * for performance reasons.
- * However, it is a weakening of the grammar for it allows the LHS of
- * assignments to be any conditional expression whereas it can only be
- * a primary expression. Consider adding a semantic predicate to work
- * around this.
- */
{}
{
PrintExpression()
{
<IDENTIFIER>
|
- <NEW> ClassIdentifier()
+ [<BIT_AND>] <NEW> ClassIdentifier()
|
VariableDeclaratorId()
}
|
<FLOATING_POINT_LITERAL>
|
- <STRING_LITERAL>
+ try {
+ <STRING_LITERAL>
+ } catch (TokenMgrError e) {
+ errorMessage = "unterminated string";
+ errorLevel = ERROR;
+ throw generateParseException();
+ }
|
BooleanLiteral()
|
*/
{}
{
- <IF> Condition("if") Statement() [ LOOKAHEAD(1) ElseIfStatement() ] [ LOOKAHEAD(1) <ELSE> Statement() ]
+ <IF> Condition("if") Statement() ( LOOKAHEAD(1) ElseIfStatement() )* [ LOOKAHEAD(1) <ELSE> Statement() ]
}
void Condition(String keyword) :