public ParserRuleContext parse(int startRuleIndex) {RuleStartState startRuleStartState = atn.ruleToStartState[startRuleIndex];rootContext = createInterpreterRuleContext(null, ATNState.INVALID_STATE_NUMBER, startRuleIndex);if (startRuleStartState.isLeftRecursiveRule) {enterRecursionRule(rootContext, startRuleStartState.stateNumber, startRuleIndex, 0);}else {enterRule(rootContext, startRuleStartState.stateNumber, startRuleIndex);}while ( true ) {ATNState p = getATNState();switch ( p.getStateType() ) {case ATNState.RULE_STOP :if ( _ctx.isEmpty() ) {if (startRuleStartState.isLeftRecursiveRule) {ParserRuleContext result = _ctx;Pair<ParserRuleContext, Integer> parentContext = _parentContextStack.pop();unrollRecursionContexts(parentContext.a);return result;}else {exitRule();return rootContext;}}visitRuleStopState(p);break;default :try {visitState(p);}catch (RecognitionException e) {setState(atn.ruleToStopState[p.ruleIndex].stateNumber);getContext().exception = e;getErrorHandler().reportError(this, e);recover(e);}break;}}}

public virtual ParserRuleContext Parse(int startRuleIndex){RuleStartState startRuleStartState = _atn.ruleToStartState[startRuleIndex];InterpreterRuleContext rootContext = new InterpreterRuleContext(null, ATNState.InvalidStateNumber, startRuleIndex);if (startRuleStartState.isPrecedenceRule){EnterRecursionRule(rootContext, startRuleStartState.stateNumber, startRuleIndex, 0);}else{EnterRule(rootContext, startRuleStartState.stateNumber, startRuleIndex);}while (true){ATNState p = AtnState;switch (p.StateType){case StateType.RuleStop:{if (RuleContext.IsEmpty){if (startRuleStartState.isPrecedenceRule){ParserRuleContext result = RuleContext;Tuple<ParserRuleContext, int> parentContext = _parentContextStack.Pop();UnrollRecursionContexts(parentContext.Item1);return result;}else{ExitRule();return rootContext;}}VisitRuleStopState(p);break;}default:{try{VisitState(p);}catch (RecognitionException e){State = _atn.ruleToStopState[p.ruleIndex].stateNumber;Context.exception = e;ErrorHandler.ReportError(this, e);ErrorHandler.Recover(this, e);}break;}}}}
