// $ANTLR start "equalityExpression" // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGL.g:329:1: equalityExpression : relationalExpression ( ( '==' | '!=' ) relationalExpression )* ; public SGLParser.equalityExpression_return equalityExpression() // throws RecognitionException [1] { SGLParser.equalityExpression_return retval = new SGLParser.equalityExpression_return(); retval.Start = input.LT(1); object root_0 = null; IToken string_literal103 = null; IToken string_literal104 = null; SGLParser.relationalExpression_return relationalExpression102 = default(SGLParser.relationalExpression_return); SGLParser.relationalExpression_return relationalExpression105 = default(SGLParser.relationalExpression_return); object string_literal103_tree=null; object string_literal104_tree=null; try { // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGL.g:330:5: ( relationalExpression ( ( '==' | '!=' ) relationalExpression )* ) // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGL.g:330:9: relationalExpression ( ( '==' | '!=' ) relationalExpression )* { root_0 = (object)adaptor.GetNilNode(); PushFollow(FOLLOW_relationalExpression_in_equalityExpression1238); relationalExpression102 = relationalExpression(); state.followingStackPointer--; adaptor.AddChild(root_0, relationalExpression102.Tree); // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGL.g:330:30: ( ( '==' | '!=' ) relationalExpression )* do { int alt24 = 2; int LA24_0 = input.LA(1); if ( ((LA24_0 >= 71 && LA24_0 <= 72)) ) { alt24 = 1; } switch (alt24) { case 1 : // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGL.g:330:32: ( '==' | '!=' ) relationalExpression { // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGL.g:330:32: ( '==' | '!=' ) int alt23 = 2; int LA23_0 = input.LA(1); if ( (LA23_0 == 71) ) { alt23 = 1; } else if ( (LA23_0 == 72) ) { alt23 = 2; } else { NoViableAltException nvae_d23s0 = new NoViableAltException("", 23, 0, input); throw nvae_d23s0; } switch (alt23) { case 1 : // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGL.g:330:33: '==' { string_literal103=(IToken)Match(input,71,FOLLOW_71_in_equalityExpression1243); string_literal103_tree = (object)adaptor.Create(string_literal103); root_0 = (object)adaptor.BecomeRoot(string_literal103_tree, root_0); } break; case 2 : // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGL.g:330:41: '!=' { string_literal104=(IToken)Match(input,72,FOLLOW_72_in_equalityExpression1248); string_literal104_tree = (object)adaptor.Create(string_literal104); root_0 = (object)adaptor.BecomeRoot(string_literal104_tree, root_0); } break; } PushFollow(FOLLOW_relationalExpression_in_equalityExpression1252); relationalExpression105 = relationalExpression(); state.followingStackPointer--; adaptor.AddChild(root_0, relationalExpression105.Tree); } break; default: goto loop24; } } while (true); loop24: ; // Stops C# compiler whining that label 'loop24' has no statements } retval.Stop = input.LT(-1); retval.Tree = (object)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 = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re); } finally { } return retval; }
// $ANTLR start "equalityExpression" // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGL.g:302:1: equalityExpression : relationalExpression ( ( '==' | '!=' ) relationalExpression )* ; public SGLParser.equalityExpression_return equalityExpression() // throws RecognitionException [1] { SGLParser.equalityExpression_return retval = new SGLParser.equalityExpression_return(); retval.Start = input.LT(1); int equalityExpression_StartIndex = input.Index(); object root_0 = null; IToken string_literal80 = null; IToken string_literal81 = null; SGLParser.relationalExpression_return relationalExpression79 = default(SGLParser.relationalExpression_return); SGLParser.relationalExpression_return relationalExpression82 = default(SGLParser.relationalExpression_return); object string_literal80_tree=null; object string_literal81_tree=null; try { if ( (state.backtracking > 0) && AlreadyParsedRule(input, 23) ) { return retval; } // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGL.g:303:5: ( relationalExpression ( ( '==' | '!=' ) relationalExpression )* ) // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGL.g:303:9: relationalExpression ( ( '==' | '!=' ) relationalExpression )* { root_0 = (object)adaptor.GetNilNode(); PushFollow(FOLLOW_relationalExpression_in_equalityExpression1013); relationalExpression79 = relationalExpression(); state.followingStackPointer--; if (state.failed) return retval; if ( state.backtracking == 0 ) adaptor.AddChild(root_0, relationalExpression79.Tree); // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGL.g:303:30: ( ( '==' | '!=' ) relationalExpression )* do { int alt24 = 2; int LA24_0 = input.LA(1); if ( ((LA24_0 >= 66 && LA24_0 <= 67)) ) { alt24 = 1; } switch (alt24) { case 1 : // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGL.g:303:32: ( '==' | '!=' ) relationalExpression { // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGL.g:303:32: ( '==' | '!=' ) int alt23 = 2; int LA23_0 = input.LA(1); if ( (LA23_0 == 66) ) { alt23 = 1; } else if ( (LA23_0 == 67) ) { alt23 = 2; } else { if ( state.backtracking > 0 ) {state.failed = true; return retval;} NoViableAltException nvae_d23s0 = new NoViableAltException("", 23, 0, input); throw nvae_d23s0; } switch (alt23) { case 1 : // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGL.g:303:33: '==' { string_literal80=(IToken)Match(input,66,FOLLOW_66_in_equalityExpression1018); if (state.failed) return retval; if ( state.backtracking == 0 ) {string_literal80_tree = (object)adaptor.Create(string_literal80); root_0 = (object)adaptor.BecomeRoot(string_literal80_tree, root_0); } } break; case 2 : // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGL.g:303:41: '!=' { string_literal81=(IToken)Match(input,67,FOLLOW_67_in_equalityExpression1023); if (state.failed) return retval; if ( state.backtracking == 0 ) {string_literal81_tree = (object)adaptor.Create(string_literal81); root_0 = (object)adaptor.BecomeRoot(string_literal81_tree, root_0); } } break; } PushFollow(FOLLOW_relationalExpression_in_equalityExpression1027); relationalExpression82 = relationalExpression(); state.followingStackPointer--; if (state.failed) return retval; if ( state.backtracking == 0 ) adaptor.AddChild(root_0, relationalExpression82.Tree); } break; default: goto loop24; } } while (true); loop24: ; // Stops C# compiler whining that label 'loop24' has no statements } retval.Stop = input.LT(-1); if ( (state.backtracking==0) ) { retval.Tree = (object)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 = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re); } finally { if ( state.backtracking > 0 ) { Memoize(input, 23, equalityExpression_StartIndex); } } return retval; }