NoViableAltException class

Indicates that the parser could not decide which of two or more paths to take based upon the remaining input. It tracks the starting token of the offending input and also knows where the parser was in the various paths when the error. Reported by reportNoViableAlternative()

Inheritance

Constructors

NoViableAltException(Parser recognizer, [TokenStream? input, Token? startToken, Token? offendingToken, ATNConfigSet? deadEndConfigs, ParserRuleContext? ctx])

Properties

ctx RuleContext?
Gets the RuleContext at the time this exception was thrown.
finalinherited
deadEndConfigs ATNConfigSet?
Which configurations did we try at input.index() that couldn't match input.LT(1)? */
final
expectedTokens IntervalSet?
Gets the set of input symbols which could potentially follow the previously matched symbol at the time this exception was thrown.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
inputStream IntStream
Gets the input stream which is the symbol source for the recognizer where this exception was thrown.
finalinherited
message String
finalinherited
offendingState int
Get the ATN state number the parser was in at the time the error occurred. For NoViableAltException and LexerNoViableAltException exceptions, this is the DecisionState number. For others, it is the state whose outgoing edge we couldn't match.
getter/setter pairinherited
offendingToken Token
The current Token when an error occurred. Since not all streams support accessing symbols by index, we have to track the Token instance itself.
getter/setter pairinherited
recognizer Recognizer<ATNSimulator>?
Gets the Recognizer where this exception occurred.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace?
The stack trace at the point where this error was first thrown.
no setterinherited
startToken Token
The token object at the start index; the input stream might not be buffering tokens so get a reference to it. (At the time the error occurred, of course the stream needs to keep a buffer all of the tokens but later we might not have access to those.)
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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