ATN class

Constructors

ATN(ATNType grammarType, int maxTokenType)
Used for runtime deserialization of ATNs from strings */

Properties

decisionToState List<DecisionState>
Each subrule/rule is a decision point and we must track them so we can go back later and build DFA predictors for them. This includes all the rules, subrules, optional blocks, ()+, ()* etc...
getter/setter pair
grammarType → ATNType
The type of the ATN.
final
hashCode int
The hash code for this object.
no setterinherited
lexerActions List<LexerAction>?
For lexer ATNs, this is an array of LexerAction objects which may be referenced by action transitions in the ATN.
getter/setter pair
maxTokenType int
The maximum value for any symbol recognized by a transition in the ATN.
final
modeNameToStartState Map<String, TokensStartState>
getter/setter pair
modeToStartState List<TokensStartState>
getter/setter pair
numberOfDecisions int
no setter
ruleToStartState List<RuleStartState>
Maps from rule index to starting state number.
getter/setter pair
ruleToStopState List<RuleStopState>
Maps from rule index to stop state number.
getter/setter pair
ruleToTokenType List<int>
For lexer ATNs, this maps the rule index to the resulting token type. For parser ATNs, this maps the rule index to the generated bypass token type if the {@link ATNDeserializationOptions#isGenerateRuleBypassTransitions} deserialization option was specified; otherwise, this is null.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
states List<ATNState?>
getter/setter pair

Methods

addState(ATNState? state) → void
defineDecisionState(DecisionState s) int
getDecisionState(int? decision) DecisionState?
getExpectedTokens(int stateNumber, RuleContext? context) IntervalSet
Computes the set of input symbols which could follow ATN state number stateNumber in the specified full 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, {@link Token#EOF} is added to the returned set.
nextTokens(ATNState s, [RuleContext? ctx]) IntervalSet
TODO merge doc comment Compute the set of valid tokens that can occur starting in state s. If ctx is null, 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 s's rule.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeState(ATNState state) → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

INVALID_ALT_NUMBER int
final