Top Description Fields Constructors Methods
org.antlr.v4.runtime

public Class NoViableAltException

extends RecognitionException
Class Inheritance
Imports
org.antlr.v4.runtime.atn.ATNConfigSet

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()

Field Summary

Modifier and TypeField and Description
private final ATNConfigSet
deadEndConfigs

Which configurations did we try at input.index() that couldn't match input.LT(1)?

private final Token
startToken

The token object at the start index; the input stream might not be buffering tokens so get a reference to it.

Constructor Summary

AccessConstructor and Description
public
public
NoViableAltException(Parser recognizer, TokenStream input, Token startToken, Token offendingToken, ATNConfigSet deadEndConfigs, ParserRuleContext ctx)

Method Summary

Modifier and TypeMethod and Description
public ATNConfigSet
public Token
Inherited from org.antlr.v4.runtime.RecognitionException:
getCtxgetExpectedTokensgetInputStreamgetOffendingStategetOffendingTokengetRecognizersetOffendingStatesetOffendingToken

Field Detail

deadEndConfigsback to summary
private final ATNConfigSet deadEndConfigs

Which configurations did we try at input.index() that couldn't match input.LT(1)?

startTokenback to summary
private final Token startToken

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.)

Constructor Detail

NoViableAltExceptionback to summary
public NoViableAltException(Parser recognizer)
NoViableAltExceptionback to summary
public NoViableAltException(Parser recognizer, TokenStream input, Token startToken, Token offendingToken, ATNConfigSet deadEndConfigs, ParserRuleContext ctx)

Method Detail

getDeadEndConfigsback to summary
public ATNConfigSet getDeadEndConfigs()
getStartTokenback to summary
public Token getStartToken()