// $ANTLR start "word" // abevformula.g:27:0: word : WORD ; private abevformulaParser.word_return word( ) { abevformulaParser.word_return retval = new abevformulaParser.word_return(); retval.start = input.LT(1); int word_StartIndex = input.Index; CommonTree root_0 = null; IToken WORD11 = null; CommonTree WORD11_tree = null; try { if (state.backtracking > 0 && AlreadyParsedRule(input, 5)) { return(retval); } // abevformula.g:27:9: ( WORD ) // abevformula.g:27:9: WORD { root_0 = (CommonTree)adaptor.Nil(); WORD11 = (IToken)Match(input, WORD, Follow._WORD_in_word163); if (state.failed) { return(retval); } if (state.backtracking == 0) { WORD11_tree = (CommonTree)adaptor.Create(WORD11); adaptor.AddChild(root_0, WORD11_tree); } } retval.stop = input.LT(-1); if (state.backtracking == 0) { retval.tree = (CommonTree)adaptor.RulePostProcessing(root_0); adaptor.SetTokenBoundaries(retval.tree, retval.start, retval.stop); } } catch (RecognitionException re) { ReportError(re); Recover(input, re); retval.tree = (CommonTree)adaptor.ErrorNode(input, retval.start, input.LT(-1), re); } finally { if (state.backtracking > 0) { Memoize(input, 5, word_StartIndex); } } return(retval); }
// $ANTLR start "param" // abevformula.g:29:0: param : ( word | sentence | funcwithparams ); private abevformulaParser.param_return param( ) { abevformulaParser.param_return retval = new abevformulaParser.param_return(); retval.start = input.LT(1); int param_StartIndex = input.Index; CommonTree root_0 = null; abevformulaParser.word_return word13 = default(abevformulaParser.word_return); abevformulaParser.sentence_return sentence14 = default(abevformulaParser.sentence_return); abevformulaParser.funcwithparams_return funcwithparams15 = default(abevformulaParser.funcwithparams_return); try { if (state.backtracking > 0 && AlreadyParsedRule(input, 7)) { return(retval); } // abevformula.g:29:10: ( word | sentence | funcwithparams ) int alt2 = 3; switch (input.LA(1)) { case WORD: { alt2 = 1; } break; case STRING: { alt2 = 2; } break; case 9: { alt2 = 3; } break; default: { if (state.backtracking > 0) { state.failed = true; return(retval); } NoViableAltException nvae = new NoViableAltException("", 2, 0, input); throw nvae; } } switch (alt2) { case 1: // abevformula.g:29:10: word { root_0 = (CommonTree)adaptor.Nil(); PushFollow(Follow._word_in_param180); word13 = word(); state._fsp--; if (state.failed) { return(retval); } if (state.backtracking == 0) { adaptor.AddChild(root_0, word13.Tree); } } break; case 2: // abevformula.g:30:6: sentence { root_0 = (CommonTree)adaptor.Nil(); PushFollow(Follow._sentence_in_param188); sentence14 = sentence(); state._fsp--; if (state.failed) { return(retval); } if (state.backtracking == 0) { adaptor.AddChild(root_0, sentence14.Tree); } } break; case 3: // abevformula.g:31:6: funcwithparams { root_0 = (CommonTree)adaptor.Nil(); PushFollow(Follow._funcwithparams_in_param195); funcwithparams15 = funcwithparams(); state._fsp--; if (state.failed) { return(retval); } if (state.backtracking == 0) { adaptor.AddChild(root_0, funcwithparams15.Tree); } } break; } retval.stop = input.LT(-1); if (state.backtracking == 0) { retval.tree = (CommonTree)adaptor.RulePostProcessing(root_0); adaptor.SetTokenBoundaries(retval.tree, retval.start, retval.stop); } } catch (RecognitionException re) { ReportError(re); Recover(input, re); retval.tree = (CommonTree)adaptor.ErrorNode(input, retval.start, input.LT(-1), re); } finally { if (state.backtracking > 0) { Memoize(input, 7, param_StartIndex); } } return(retval); }