public NCalcParser.bitwiseOrExpression_return bitwiseOrExpression()
{
NCalcParser.bitwiseOrExpression_return retval = new NCalcParser.bitwiseOrExpression_return();
retval.Start = input.LT(1);
CommonTree root_0 = null;
IToken char_literal7 = null;
NCalcParser.bitwiseXOrExpression_return left = null;
NCalcParser.bitwiseOrExpression_return right = null;
CommonTree char_literal7_tree=null;
BinaryExpressionType type = BinaryExpressionType.Unknown;
try
{
// C:\\Users\\s.ros\\Documents\\Développement\\NCalc\\Grammar\\NCalc.g:109:2: (left= bitwiseXOrExpression ( '|' right= bitwiseOrExpression )* )
// C:\\Users\\s.ros\\Documents\\Développement\\NCalc\\Grammar\\NCalc.g:109:4: left= bitwiseXOrExpression ( '|' right= bitwiseOrExpression )*
{
root_0 = (CommonTree)adaptor.GetNilNode();
PushFollow(FOLLOW_bitwiseXOrExpression_in_bitwiseOrExpression237);
left = bitwiseXOrExpression();
state.followingStackPointer--;
adaptor.AddChild(root_0, left.Tree);
retval.value = ((left != null) ? left.value : null);
// C:\\Users\\s.ros\\Documents\\Développement\\NCalc\\Grammar\\NCalc.g:109:56: ( '|' right= bitwiseOrExpression )*
do
{
int alt4 = 2;
int LA4_0 = input.LA(1);
if ( (LA4_0 == 25) )
{
alt4 = 1;
}
switch (alt4)
{
case 1 :
// C:\\Users\\s.ros\\Documents\\Développement\\NCalc\\Grammar\\NCalc.g:110:4: '|' right= bitwiseOrExpression
{
char_literal7=(IToken)Match(input,25,FOLLOW_25_in_bitwiseOrExpression246);
char_literal7_tree = (CommonTree)adaptor.Create(char_literal7);
adaptor.AddChild(root_0, char_literal7_tree);
type = BinaryExpressionType.BitwiseOr;
PushFollow(FOLLOW_bitwiseOrExpression_in_bitwiseOrExpression256);
right = bitwiseOrExpression();
state.followingStackPointer--;
adaptor.AddChild(root_0, right.Tree);
retval.value = new BinaryExpression(type, retval.value, ((right != null) ? right.value : null));
}
break;
default:
goto loop4;
}
} while (true);
loop4:
; // Stops C# compiler whining that label 'loop4' has no statements
}
retval.Stop = input.LT(-1);
retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0);
adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
}
catch (RecognitionException re)
{
ReportError(re);
Recover(input,re);
// Conversion of the second argument necessary, but harmless
retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);
}
finally
{
}
return retval;
}