def METHOD_NAME(self, p:ATNState):
    ruleStartState = self.atn.ruleToStartState[p.ruleIndex]
    if ruleStartState.isPrecedenceRule:
        parentContext = self._parentContextStack.pop()
        self.unrollRecursionContexts(parentContext.a)
        self.state = parentContext[1]
    else:
        self.exitRule()
    ruleTransition = self.atn.states[self.state].transitions[0]
    self.state = ruleTransition.followState.stateNumber