var ATNInvalidAltNumber … type ATN … // NewATN returns a new ATN struct representing the given grammarType and is used // for runtime deserialization of ATNs from the code generated by the ANTLR tool func NewATN(grammarType int, maxTokenType int) *ATN { … } // NextTokensInContext computes and returns the set of valid tokens that can occur starting // in state s. If ctx is nil, the set of tokens will not include what can follow // the rule surrounding s. In other words, the set will be restricted to tokens // reachable staying within the rule of s. func (a *ATN) NextTokensInContext(s ATNState, ctx RuleContext) *IntervalSet { … } // NextTokensNoContext computes and returns the set of valid tokens that can occur starting // in state s and staying in same rule. [antlr.Token.EPSILON] is in set if we reach end of // rule. func (a *ATN) NextTokensNoContext(s ATNState) *IntervalSet { … } // NextTokens computes and returns the set of valid tokens starting in state s, by // calling either [NextTokensNoContext] (ctx == nil) or [NextTokensInContext] (ctx != nil). func (a *ATN) NextTokens(s ATNState, ctx RuleContext) *IntervalSet { … } func (a *ATN) addState(state ATNState) { … } func (a *ATN) removeState(state ATNState) { … } func (a *ATN) defineDecisionState(s DecisionState) int { … } func (a *ATN) getDecisionState(decision int) DecisionState { … } // getExpectedTokens computes the set of input symbols which could follow ATN // state number stateNumber in the specified full parse context ctx and returns // the set of potentially valid input symbols which could follow the specified // state in the specified context. This method considers the complete parser // context, but does not evaluate semantic predicates (i.e. all predicates // encountered during the calculation are assumed true). If a path in the ATN // exists from the starting state to the RuleStopState of the outermost context // without Matching any symbols, Token.EOF is added to the returned set. // // A nil ctx defaults to ParserRuleContext.EMPTY. // // It panics if the ATN does not contain state stateNumber. func (a *ATN) getExpectedTokens(stateNumber int, ctx RuleContext) *IntervalSet { … }