protected StatementModifier stmt_modifier()
{
StatementModifier m;
IToken i = null;
IToken u = null;
IToken w = null;
m = null;
Expression e = null;
IToken t = null;
StatementModifierType type = StatementModifierType.None;
try { // for error handling
{
switch ( LA(1) )
{
case IF:
{
i = LT(1);
match(IF);
if (0==inputState.guessing)
{
t = i; type = StatementModifierType.If;
}
break;
}
case UNLESS:
{
u = LT(1);
match(UNLESS);
if (0==inputState.guessing)
{
t = u; type = StatementModifierType.Unless;
}
break;
}
case WHILE:
{
w = LT(1);
match(WHILE);
if (0==inputState.guessing)
{
t = w; type = StatementModifierType.While;
}
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
e=boolean_expression();
if (0==inputState.guessing)
{
m = new StatementModifier(ToLexicalInfo(t));
m.Type = type;
m.Condition = e;
}
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex, "stmt_modifier");
recover(ex,tokenSet_14_);
}
else
{
throw ex;
}
}
return m;
}