protected Expression term()
{
Expression e;
IToken m = null;
IToken d = null;
IToken md = null;
IToken ba = null;
e = null;
Expression r = null;
IToken token = null;
BinaryOperatorType op = BinaryOperatorType.None;
try { // for error handling
e=factor();
{ // ( ... )*
for (;;)
{
if ((tokenSet_118_.member(LA(1))) && (tokenSet_114_.member(LA(2))))
{
{
switch ( LA(1) )
{
case MULTIPLY:
{
m = LT(1);
match(MULTIPLY);
if (0==inputState.guessing)
{
op=BinaryOperatorType.Multiply; token=m;
}
break;
}
case DIVISION:
{
d = LT(1);
match(DIVISION);
if (0==inputState.guessing)
{
op=BinaryOperatorType.Division; token=d;
}
break;
}
case MODULUS:
{
md = LT(1);
match(MODULUS);
if (0==inputState.guessing)
{
op=BinaryOperatorType.Modulus; token=md;
}
break;
}
case BITWISE_AND:
{
ba = LT(1);
match(BITWISE_AND);
if (0==inputState.guessing)
{
op=BinaryOperatorType.BitwiseAnd; token=ba;
}
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
r=factor();
if (0==inputState.guessing)
{
BinaryExpression be = new BinaryExpression(ToLexicalInfo(token));
be.Operator = op;
be.Left = e;
be.Right = r;
e = be;
}
}
else
{
goto _loop531_breakloop;
}
}
_loop531_breakloop: ;
} // ( ... )*
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex, "term");
recover(ex,tokenSet_119_);
}
else
{
throw ex;
}
}
return e;
}