def METHOD_NAME(self, precedence, startState):
    if not self.precedenceDfa:
        raise IllegalStateException("Only precedence DFAs may contain a precedence start state.")
    if precedence < 0:
        return
    # synchronization on s0 here is ok. when the DFA is turned into a
    # precedence DFA, s0 will be initialized once and not updated again
    # s0.edges is never null for a precedence DFA
    if precedence >= len(self.s0.edges):
        ext = [None] * (precedence + 1 - len(self.s0.edges))
        self.s0.edges.extend(ext)
    self.s0.edges[precedence] = startState