protected Expression factor()
{
Expression e;
IToken shl = null;
IToken shr = null;
e = null;
Expression r = null;
IToken token = null;
BinaryOperatorType op = BinaryOperatorType.None;
try { // for error handling
e=exponentiation();
{ // ( ... )*
for (;;)
{
if ((LA(1)==SHIFT_LEFT||LA(1)==SHIFT_RIGHT))
{
{
switch ( LA(1) )
{
case SHIFT_LEFT:
{
shl = LT(1);
match(SHIFT_LEFT);
if (0==inputState.guessing)
{
op=BinaryOperatorType.ShiftLeft; token = shl;
}
break;
}
case SHIFT_RIGHT:
{
shr = LT(1);
match(SHIFT_RIGHT);
if (0==inputState.guessing)
{
op=BinaryOperatorType.ShiftRight; token = shr;
}
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
r=exponentiation();
if (0==inputState.guessing)
{
BinaryExpression be = new BinaryExpression(ToLexicalInfo(token));
be.Operator = op;
be.Left = e;
be.Right = r;
e = be;
}
}
else
{
goto _loop535_breakloop;
}
}
_loop535_breakloop: ;
} // ( ... )*
}
catch (RecognitionException ex)
{
if (0 == inputState.guessing)
{
reportError(ex, "factor");
recover(ex,tokenSet_120_);
}
else
{
throw ex;
}
}
return e;
}