func (d *DFA) getPrecedenceStartState(precedence int) *DFAState {
	if !d.precedenceDfa {
		panic("only precedence DFAs may contain a precedence start state")
	}
	d.s0Mu.RLock()
	defer d.s0Mu.RUnlock()
	if precedence < 0 || precedence >= len(d.s0.edges) {
		return nil
	}
	return d.s0.edges[precedence]
}
getPrecedenceStartState gets the start state for the current precedence and
returns the start state corresponding to the specified precedence if a start
state exists for the specified precedence and nil otherwise. d must be a
precedence DFA. See also isPrecedenceDfa.
package antlr
import (
	"sort"
	"sync"
)
type DFA struct {
	atnStartState DecisionState
	decision int
	states map[int]*DFAState
	statesMu sync.RWMutex
	s0 *DFAState
	s0Mu sync.RWMutex
	precedenceDfa bool
}
func NewDFA(atnStartState DecisionState, decision int) *DFA {
	return &DFA{
		atnStartState: atnStartState,
		decision:      decision,
		states:        make(map[int]*DFAState),
	}
}