// $ANTLR start "ifloop" // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:264:1: ifloop returns [List<Element> ret] : ( expr1 | functionreturn )+ ; public spinachParser.ifloop_return ifloop() // throws RecognitionException [1] { spinachParser.ifloop_return retval = new spinachParser.ifloop_return(); retval.Start = input.LT(1); object root_0 = null; spinachParser.expr1_return expr1122 = null; spinachParser.functionreturn_return functionreturn123 = null; retval.ret = new List<Element>(); try { // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:269:1: ( ( expr1 | functionreturn )+ ) // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:269:3: ( expr1 | functionreturn )+ { root_0 = (object)adaptor.GetNilNode(); // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:269:3: ( expr1 | functionreturn )+ int cnt37 = 0; do { int alt37 = 3; int LA37_0 = input.LA(1); if ( (LA37_0 == VARIABLE || LA37_0 == VARTYPE || LA37_0 == STRINGTYPE || LA37_0 == 28 || LA37_0 == 32 || (LA37_0 >= 35 && LA37_0 <= 36) || LA37_0 == 40 || LA37_0 == 42 || LA37_0 == 46 || LA37_0 == 48 || (LA37_0 >= 52 && LA37_0 <= 56)) ) { alt37 = 1; } else if ( (LA37_0 == 47) ) { alt37 = 2; } switch (alt37) { case 1 : // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:269:4: expr1 { PushFollow(FOLLOW_expr1_in_ifloop1596); expr1122 = expr1(); state.followingStackPointer--; adaptor.AddChild(root_0, expr1122.Tree); retval.ret.Add(((expr1122 != null) ? expr1122.ret : null)); } break; case 2 : // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:269:39: functionreturn { PushFollow(FOLLOW_functionreturn_in_ifloop1599); functionreturn123 = functionreturn(); state.followingStackPointer--; adaptor.AddChild(root_0, functionreturn123.Tree); retval.ret.Add(((functionreturn123 != null) ? functionreturn123.ret : null)); } break; default: if ( cnt37 >= 1 ) goto loop37; EarlyExitException eee37 = new EarlyExitException(37, input); throw eee37; } cnt37++; } while (true); loop37: ; // Stops C# compiler whinging that label 'loop37' 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 "ifloop" // spinach.g:261:1: ifloop returns [List<Element> ret] : ( expr1 | functionreturn | comment )+ ; public spinachParser.ifloop_return ifloop() // throws RecognitionException [1] { spinachParser.ifloop_return retval = new spinachParser.ifloop_return(); retval.Start = input.LT(1); object root_0 = null; spinachParser.expr1_return expr1121 = null; spinachParser.functionreturn_return functionreturn122 = null; spinachParser.comment_return comment123 = null; retval.ret = new List<Element>(); try { // spinach.g:266:1: ( ( expr1 | functionreturn | comment )+ ) // spinach.g:266:3: ( expr1 | functionreturn | comment )+ { root_0 = (object)adaptor.GetNilNode(); // spinach.g:266:3: ( expr1 | functionreturn | comment )+ int cnt35 = 0; do { int alt35 = 4; switch ( input.LA(1) ) { case VARIABLE: case VARTYPE: case STRINGTYPE: case 28: case 32: case 35: case 36: case 40: case 42: case 47: case 51: case 52: case 53: case 54: case 55: { alt35 = 1; } break; case 46: { alt35 = 2; } break; case 56: { alt35 = 3; } break; } switch (alt35) { case 1 : // spinach.g:266:4: expr1 { PushFollow(FOLLOW_expr1_in_ifloop1550); expr1121 = expr1(); state.followingStackPointer--; adaptor.AddChild(root_0, expr1121.Tree); retval.ret.Add(((expr1121 != null) ? expr1121.ret : null)); } break; case 2 : // spinach.g:266:39: functionreturn { PushFollow(FOLLOW_functionreturn_in_ifloop1553); functionreturn122 = functionreturn(); state.followingStackPointer--; adaptor.AddChild(root_0, functionreturn122.Tree); retval.ret.Add(((functionreturn122 != null) ? functionreturn122.ret : null)); } break; case 3 : // spinach.g:266:92: comment { PushFollow(FOLLOW_comment_in_ifloop1556); comment123 = comment(); state.followingStackPointer--; adaptor.AddChild(root_0, comment123.Tree); } break; default: if ( cnt35 >= 1 ) goto loop35; EarlyExitException eee35 = new EarlyExitException(35, input); throw eee35; } cnt35++; } while (true); loop35: ; // Stops C# compiler whining that label 'loop35' 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 "ifloop" // spinach.g:237:1: ifloop returns [List<Element> ret] : ( expr | functionreturn )+ ; public spinachParser.ifloop_return ifloop() // throws RecognitionException [1] { spinachParser.ifloop_return retval = new spinachParser.ifloop_return(); retval.Start = input.LT(1); object root_0 = null; spinachParser.expr_return expr102 = null; spinachParser.functionreturn_return functionreturn103 = null; retval.ret = new List<Element>(); try { // spinach.g:242:1: ( ( expr | functionreturn )+ ) // spinach.g:242:3: ( expr | functionreturn )+ { root_0 = (object)adaptor.GetNilNode(); // spinach.g:242:3: ( expr | functionreturn )+ int cnt29 = 0; do { int alt29 = 3; int LA29_0 = input.LA(1); if ( (LA29_0 == VARIABLE || LA29_0 == VARTYPE || LA29_0 == STRINGTYPE || LA29_0 == 28 || LA29_0 == 32 || (LA29_0 >= 34 && LA29_0 <= 37) || LA29_0 == 40 || (LA29_0 >= 42 && LA29_0 <= 43) || LA29_0 == 46 || LA29_0 == 48 || (LA29_0 >= 52 && LA29_0 <= 56)) ) { alt29 = 1; } else if ( (LA29_0 == 47) ) { alt29 = 2; } switch (alt29) { case 1 : // spinach.g:242:4: expr { PushFollow(FOLLOW_expr_in_ifloop1425); expr102 = expr(); state.followingStackPointer--; adaptor.AddChild(root_0, expr102.Tree); retval.ret.Add(((expr102 != null) ? expr102.ret : null)); } break; case 2 : // spinach.g:242:37: functionreturn { PushFollow(FOLLOW_functionreturn_in_ifloop1428); functionreturn103 = functionreturn(); state.followingStackPointer--; adaptor.AddChild(root_0, functionreturn103.Tree); retval.ret.Add(((functionreturn103 != null) ? functionreturn103.ret : null)); } break; default: if ( cnt29 >= 1 ) goto loop29; EarlyExitException eee29 = new EarlyExitException(29, input); throw eee29; } cnt29++; } while (true); loop29: ; // Stops C# compiler whining that label 'loop29' 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 "ifloop" // spinach.g:264:1: ifloop returns [List<Element> ret] : ( expr1 | functionreturn )+ ; public spinachParser.ifloop_return ifloop() // throws RecognitionException [1] { spinachParser.ifloop_return retval = new spinachParser.ifloop_return(); retval.Start = input.LT(1); object root_0 = null; spinachParser.expr1_return expr1122 = null; spinachParser.functionreturn_return functionreturn123 = null; retval.ret = new List<Element>(); try { // spinach.g:269:1: ( ( expr1 | functionreturn )+ ) // spinach.g:269:3: ( expr1 | functionreturn )+ { root_0 = (object)adaptor.GetNilNode(); // spinach.g:269:3: ( expr1 | functionreturn )+ int cnt36 = 0; do { int alt36 = 3; int LA36_0 = input.LA(1); if ( (LA36_0 == VARIABLE || LA36_0 == VARTYPE || LA36_0 == STRINGTYPE || LA36_0 == 27 || LA36_0 == 31 || (LA36_0 >= 34 && LA36_0 <= 35) || LA36_0 == 39 || LA36_0 == 41 || LA36_0 == 46 || (LA36_0 >= 50 && LA36_0 <= 54)) ) { alt36 = 1; } else if ( (LA36_0 == 45) ) { alt36 = 2; } switch (alt36) { case 1 : // spinach.g:269:4: expr1 { PushFollow(FOLLOW_expr1_in_ifloop1563); expr1122 = expr1(); state.followingStackPointer--; adaptor.AddChild(root_0, expr1122.Tree); retval.ret.Add(((expr1122 != null) ? expr1122.ret : null)); } break; case 2 : // spinach.g:269:39: functionreturn { PushFollow(FOLLOW_functionreturn_in_ifloop1566); functionreturn123 = functionreturn(); state.followingStackPointer--; adaptor.AddChild(root_0, functionreturn123.Tree); retval.ret.Add(((functionreturn123 != null) ? functionreturn123.ret : null)); } break; default: if ( cnt36 >= 1 ) goto loop36; EarlyExitException eee36 = new EarlyExitException(36, input); throw eee36; } cnt36++; } while (true); loop36: ; // Stops C# compiler whining that label 'loop36' 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; }