Package | Description |
---|---|
org.antlr.v4.runtime | |
org.antlr.v4.runtime.atn | |
org.antlr.v4.runtime.dfa | |
org.antlr.v4.runtime.misc | |
org.antlr.v4.runtime.tree | |
org.antlr.v4.runtime.tree.gui |
Modifier and Type | Field and Description |
---|---|
protected ANTLRErrorStrategy |
Parser._errHandler
The error handling strategy for the parser.
|
protected TokenSource |
BufferedTokenStream.tokenSource |
Modifier and Type | Method and Description |
---|---|
Symbol |
TokenFactory.create(int type,
String text)
Generically useful
|
Symbol |
TokenFactory.create(Pair<TokenSource,CharStream> source,
int type,
String text,
int channel,
int start,
int stop,
int line,
int charPositionInLine)
This is the method used to create tokens in the lexer and in the
error handling strategy.
|
protected String |
DefaultErrorStrategy.escapeWSAndQuote(String s) |
Token |
TokenStream.get(int index)
Gets the
Token at the specified index in the stream. |
protected BitSet |
DiagnosticErrorListener.getConflictingAlts(BitSet reportedAlts,
ATNConfigSet configs)
Computes the set of conflicting or ambiguous alternatives from a
configuration set, if that information was not already provided by the
parser.
|
ANTLRErrorStrategy |
Parser.getErrorHandler() |
List<? extends ANTLRErrorListener> |
Recognizer.getErrorListeners() |
protected IntervalSet |
DefaultErrorStrategy.getErrorRecoverySet(Parser recognizer) |
IntervalSet |
Parser.getExpectedTokens()
Computes the set of input symbols which could follow the current parser
state and context, as given by
Recognizer.getState() and Parser.getContext() ,
respectively. |
protected IntervalSet |
DefaultErrorStrategy.getExpectedTokens(Parser recognizer) |
IntervalSet |
Parser.getExpectedTokensWithinCurrentRule() |
protected Token |
DefaultErrorStrategy.getMissingSymbol(Parser recognizer)
Conjure up a missing token during error recovery.
|
List<ParseTreeListener> |
Parser.getParseListeners() |
String |
IntStream.getSourceName()
Gets the name of the underlying symbol source.
|
Token |
NoViableAltException.getStartToken() |
String |
UnbufferedTokenStream.getText() |
String |
TokenStream.getText()
Return the text of all tokens in the stream.
|
String |
BufferedTokenStream.getText()
Get the text of all tokens in this buffer.
|
String |
UnbufferedTokenStream.getText(Interval interval) |
String |
TokenStream.getText(Interval interval)
Return the text of all tokens within the specified
interval . |
String |
CharStream.getText(Interval interval)
This method returns the text for a range of characters within this input
stream.
|
String |
BufferedTokenStream.getText(Interval interval) |
String |
UnbufferedTokenStream.getText(RuleContext ctx) |
String |
TokenStream.getText(RuleContext ctx)
Return the text of all tokens in the source interval of the specified
context.
|
String |
BufferedTokenStream.getText(RuleContext ctx) |
String |
UnbufferedTokenStream.getText(Token start,
Token stop) |
String |
TokenStream.getText(Token start,
Token stop)
Return the text of all tokens in this stream between
start and
stop (inclusive). |
String |
BufferedTokenStream.getText(Token start,
Token stop) |
TokenFactory<?> |
TokenSource.getTokenFactory()
Gets the factory used for constructing tokens.
|
abstract TokenFactory<?> |
Recognizer.getTokenFactory() |
TokenSource |
TokenStream.getTokenSource()
Gets the underlying
TokenSource which provides tokens for this
stream. |
Token |
TokenStream.LT(int k)
|
Token |
Parser.match(int ttype)
Match current input symbol against
ttype . |
Token |
Parser.matchWildcard()
Match current input symbol as a wildcard.
|
Token |
ANTLRErrorStrategy.recoverInline(Parser recognizer)
This method is called when an unexpected symbol is encountered during an
inline match operation, such as
Parser.match(int) . |
Modifier and Type | Method and Description |
---|---|
protected void |
UnbufferedTokenStream.add(Token t) |
void |
Recognizer.addErrorListener(ANTLRErrorListener listener) |
void |
Parser.addParseListener(ParseTreeListener listener)
Registers
listener to receive events during the parsing process. |
protected void |
DefaultErrorStrategy.beginErrorCondition(Parser recognizer)
This method is called to enter error recovery mode when a recognition
exception is reported.
|
protected void |
DefaultErrorStrategy.consumeUntil(Parser recognizer,
IntervalSet set)
Consume tokens until one matches the given token set.
|
protected void |
DefaultErrorStrategy.consumeUntil(Parser recognizer,
IntervalSet set)
Consume tokens until one matches the given token set.
|
Symbol |
TokenFactory.create(Pair<TokenSource,CharStream> source,
int type,
String text,
int channel,
int start,
int stop,
int line,
int charPositionInLine)
This is the method used to create tokens in the lexer and in the
error handling strategy.
|
protected void |
DefaultErrorStrategy.endErrorCondition(Parser recognizer)
This method is called to leave error recovery mode after recovering from
a recognition exception.
|
void |
Parser.enterRule(ParserRuleContext localctx,
int state,
int ruleIndex)
Always called by generated parsers upon entry to a rule.
|
protected String |
DefaultErrorStrategy.escapeWSAndQuote(String s) |
protected BitSet |
DiagnosticErrorListener.getConflictingAlts(BitSet reportedAlts,
ATNConfigSet configs)
Computes the set of conflicting or ambiguous alternatives from a
configuration set, if that information was not already provided by the
parser.
|
protected String |
DiagnosticErrorListener.getDecisionDescription(Parser recognizer,
DFA dfa) |
protected String |
DiagnosticErrorListener.getDecisionDescription(Parser recognizer,
DFA dfa) |
protected IntervalSet |
DefaultErrorStrategy.getErrorRecoverySet(Parser recognizer) |
protected IntervalSet |
DefaultErrorStrategy.getExpectedTokens(Parser recognizer) |
protected Token |
DefaultErrorStrategy.getMissingSymbol(Parser recognizer)
Conjure up a missing token during error recovery.
|
protected String |
DefaultErrorStrategy.getSymbolText(Token symbol) |
protected int |
DefaultErrorStrategy.getSymbolType(Token symbol) |
String |
TokenStream.getText(Interval interval)
Return the text of all tokens within the specified
interval . |
String |
CharStream.getText(Interval interval)
This method returns the text for a range of characters within this input
stream.
|
String |
TokenStream.getText(RuleContext ctx)
Return the text of all tokens in the source interval of the specified
context.
|
String |
TokenStream.getText(Token start,
Token stop)
Return the text of all tokens in this stream between
start and
stop (inclusive). |
String |
TokenStream.getText(Token start,
Token stop)
Return the text of all tokens in this stream between
start and
stop (inclusive). |
boolean |
ANTLRErrorStrategy.inErrorRecoveryMode(Parser recognizer)
Tests whether or not
recognizer is in the process of recovering
from an error. |
void |
ANTLRErrorStrategy.recover(Parser recognizer,
RecognitionException e)
This method is called to recover from exception
e . |
void |
ANTLRErrorStrategy.recover(Parser recognizer,
RecognitionException e)
This method is called to recover from exception
e . |
Token |
ANTLRErrorStrategy.recoverInline(Parser recognizer)
This method is called when an unexpected symbol is encountered during an
inline match operation, such as
Parser.match(int) . |
void |
Recognizer.removeErrorListener(ANTLRErrorListener listener) |
void |
DiagnosticErrorListener.reportAmbiguity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs) |
void |
DiagnosticErrorListener.reportAmbiguity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs) |
void |
ANTLRErrorListener.reportAmbiguity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs)
This method is called by the parser when a full-context prediction
results in an ambiguity.
|
void |
ANTLRErrorListener.reportAmbiguity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs)
This method is called by the parser when a full-context prediction
results in an ambiguity.
|
void |
ANTLRErrorListener.reportAmbiguity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs)
This method is called by the parser when a full-context prediction
results in an ambiguity.
|
void |
ANTLRErrorListener.reportAmbiguity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs)
This method is called by the parser when a full-context prediction
results in an ambiguity.
|
void |
DiagnosticErrorListener.reportAttemptingFullContext(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet conflictingAlts,
ATNConfigSet configs) |
void |
DiagnosticErrorListener.reportAttemptingFullContext(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet conflictingAlts,
ATNConfigSet configs) |
void |
DiagnosticErrorListener.reportAttemptingFullContext(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet conflictingAlts,
ATNConfigSet configs) |
void |
ANTLRErrorListener.reportAttemptingFullContext(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet conflictingAlts,
ATNConfigSet configs)
This method is called when an SLL conflict occurs and the parser is about
to use the full context information to make an LL decision.
|
void |
ANTLRErrorListener.reportAttemptingFullContext(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet conflictingAlts,
ATNConfigSet configs)
This method is called when an SLL conflict occurs and the parser is about
to use the full context information to make an LL decision.
|
void |
ANTLRErrorListener.reportAttemptingFullContext(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
BitSet conflictingAlts,
ATNConfigSet configs)
This method is called when an SLL conflict occurs and the parser is about
to use the full context information to make an LL decision.
|
void |
DiagnosticErrorListener.reportContextSensitivity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
int prediction,
ATNConfigSet configs) |
void |
DiagnosticErrorListener.reportContextSensitivity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
int prediction,
ATNConfigSet configs) |
void |
DiagnosticErrorListener.reportContextSensitivity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
int prediction,
ATNConfigSet configs) |
void |
ANTLRErrorListener.reportContextSensitivity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
int prediction,
ATNConfigSet configs)
This method is called by the parser when a full-context prediction has a
unique result.
|
void |
ANTLRErrorListener.reportContextSensitivity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
int prediction,
ATNConfigSet configs)
This method is called by the parser when a full-context prediction has a
unique result.
|
void |
ANTLRErrorListener.reportContextSensitivity(Parser recognizer,
DFA dfa,
int startIndex,
int stopIndex,
int prediction,
ATNConfigSet configs)
This method is called by the parser when a full-context prediction has a
unique result.
|
void |
ANTLRErrorStrategy.reportError(Parser recognizer,
RecognitionException e)
Report any kind of
RecognitionException . |
void |
ANTLRErrorStrategy.reportError(Parser recognizer,
RecognitionException e)
Report any kind of
RecognitionException . |
protected void |
DefaultErrorStrategy.reportFailedPredicate(Parser recognizer,
FailedPredicateException e)
This is called by
DefaultErrorStrategy.reportError(org.antlr.v4.runtime.Parser, org.antlr.v4.runtime.RecognitionException) when the exception is a
FailedPredicateException . |
protected void |
DefaultErrorStrategy.reportFailedPredicate(Parser recognizer,
FailedPredicateException e)
This is called by
DefaultErrorStrategy.reportError(org.antlr.v4.runtime.Parser, org.antlr.v4.runtime.RecognitionException) when the exception is a
FailedPredicateException . |
protected void |
DefaultErrorStrategy.reportInputMismatch(Parser recognizer,
InputMismatchException e)
This is called by
DefaultErrorStrategy.reportError(org.antlr.v4.runtime.Parser, org.antlr.v4.runtime.RecognitionException) when the exception is an
InputMismatchException . |
protected void |
DefaultErrorStrategy.reportInputMismatch(Parser recognizer,
InputMismatchException e)
This is called by
DefaultErrorStrategy.reportError(org.antlr.v4.runtime.Parser, org.antlr.v4.runtime.RecognitionException) when the exception is an
InputMismatchException . |
void |
ANTLRErrorStrategy.reportMatch(Parser recognizer)
This method is called by when the parser successfully matches an input
symbol.
|
protected void |
DefaultErrorStrategy.reportMissingToken(Parser recognizer)
This method is called to report a syntax error which requires the
insertion of a missing token into the input stream.
|
protected void |
DefaultErrorStrategy.reportNoViableAlternative(Parser recognizer,
NoViableAltException e)
This is called by
DefaultErrorStrategy.reportError(org.antlr.v4.runtime.Parser, org.antlr.v4.runtime.RecognitionException) when the exception is a
NoViableAltException . |
protected void |
DefaultErrorStrategy.reportNoViableAlternative(Parser recognizer,
NoViableAltException e)
This is called by
DefaultErrorStrategy.reportError(org.antlr.v4.runtime.Parser, org.antlr.v4.runtime.RecognitionException) when the exception is a
NoViableAltException . |
protected void |
DefaultErrorStrategy.reportUnwantedToken(Parser recognizer)
This method is called to report a syntax error which requires the removal
of a token from the input stream.
|
void |
ANTLRErrorStrategy.reset(Parser recognizer)
Reset the error handler state for the specified
recognizer . |
void |
Parser.setErrorHandler(ANTLRErrorStrategy handler) |
void |
TokenSource.setTokenFactory(TokenFactory<?> factory)
Optional method that lets users set factory in lexer or other source
|
abstract void |
Recognizer.setTokenFactory(TokenFactory<?> input) |
protected Token |
DefaultErrorStrategy.singleTokenDeletion(Parser recognizer)
This method implements the single-token deletion inline error recovery
strategy.
|
protected boolean |
DefaultErrorStrategy.singleTokenInsertion(Parser recognizer)
This method implements the single-token insertion inline error recovery
strategy.
|
void |
ANTLRErrorStrategy.sync(Parser recognizer)
This method provides the error handler with an opportunity to handle
syntactic or semantic errors in the input stream before they result in a
RecognitionException . |
Constructor and Description |
---|
CommonToken(Pair<TokenSource,CharStream> source,
int type,
int channel,
int start,
int stop) |
FailedPredicateException(Parser recognizer) |
FailedPredicateException(Parser recognizer,
String predicate) |
FailedPredicateException(Parser recognizer,
String predicate,
String message) |
InputMismatchException(Parser recognizer) |
LexerNoViableAltException(Lexer lexer,
CharStream input,
int startIndex,
ATNConfigSet deadEndConfigs) |
NoViableAltException(Parser recognizer) |
NoViableAltException(Parser recognizer,
TokenStream input,
Token startToken,
Token offendingToken,
ATNConfigSet deadEndConfigs,
ParserRuleContext ctx) |
NoViableAltException(Parser recognizer,
TokenStream input,
Token startToken,
Token offendingToken,
ATNConfigSet deadEndConfigs,
ParserRuleContext ctx) |
NoViableAltException(Parser recognizer,
TokenStream input,
Token startToken,
Token offendingToken,
ATNConfigSet deadEndConfigs,
ParserRuleContext ctx) |
NoViableAltException(Parser recognizer,
TokenStream input,
Token startToken,
Token offendingToken,
ATNConfigSet deadEndConfigs,
ParserRuleContext ctx) |
NoViableAltException(Parser recognizer,
TokenStream input,
Token startToken,
Token offendingToken,
ATNConfigSet deadEndConfigs,
ParserRuleContext ctx) |
Modifier and Type | Field and Description |
---|---|
ATN |
LL1Analyzer.atn |
ATN |
ATNSimulator.atn |
DFA[] |
ParserATNSimulator.decisionToDFA |
DFA[] |
LexerATNSimulator.decisionToDFA |
List<DecisionState> |
ATN.decisionToState
Each subrule/rule is a decision point and we must track them so we
can go back later and build DFA predictors for them.
|
static DFAState |
ATNSimulator.ERROR
Must distinguish between missing edge and edge we know leads nowhere
|
ATNState |
RuleTransition.followState
What node to begin computations following ref to rule
|
Map<String,TokensStartState> |
ATN.modeNameToStartState |
List<TokensStartState> |
ATN.modeToStartState |
SemanticContext[] |
SemanticContext.AND.opnds |
SemanticContext[] |
SemanticContext.OR.opnds |
protected LexerATNSimulator.SimState |
LexerATNSimulator.prevAccept
Used during DFA/ATN exec to record the most recent accept configuration info
|
SemanticContext |
ATNConfig.semanticContext |
IntervalSet |
SetTransition.set |
ATNState |
ATNConfig.state
The ATN state associated with this configuration
|
List<ATNState> |
ATN.states |
ATNState |
Transition.target
The target of this transition.
|
Modifier and Type | Method and Description |
---|---|
protected ATNConfig |
ParserATNSimulator.actionTransition(ATNConfig config,
ActionTransition t) |
protected DFAState |
LexerATNSimulator.addDFAEdge(DFAState from,
int t,
ATNConfigSet q) |
protected DFAState |
LexerATNSimulator.addDFAState(ATNConfigSet configs)
Add a new DFA state if there isn't one with this set of
configurations already.
|
protected DFAState |
ParserATNSimulator.addDFAState(DFA dfa,
DFAState D)
Add state
D to the DFA if it is not already present, and return
the actual instance stored in the DFA. |
protected ATNConfigSet |
ParserATNSimulator.computeStartState(ATNState p,
RuleContext ctx,
boolean fullCtx) |
protected ATNConfigSet |
LexerATNSimulator.computeStartState(CharStream input,
ATNState p) |
protected DFAState |
LexerATNSimulator.computeTargetState(CharStream input,
DFAState s,
int t)
Compute a target state for an edge in the DFA, and attempt to add the
computed state and corresponding edge to the DFA.
|
protected DFAState |
ParserATNSimulator.computeTargetState(DFA dfa,
DFAState previousD,
int t)
Compute a target state for an edge in the DFA, and attempt to add the
computed state and corresponding edge to the DFA.
|
static Transition |
ATNSimulator.edgeFactory(ATN atn,
int type,
int src,
int trg,
int arg1,
int arg2,
int arg3,
List<IntervalSet> sets) |
static Collection<BitSet> |
PredictionMode.getConflictingAltSubsets(ATNConfigSet configs)
This function gets the conflicting alt subsets from a configuration set.
|
DFA |
LexerATNSimulator.getDFA(int mode) |
IntervalSet |
ATN.getExpectedTokens(int stateNumber,
RuleContext context)
Computes the set of input symbols which could follow ATN state number
stateNumber in the specified full context . |
PredictionMode |
ParserATNSimulator.getPredictionMode() |
String |
ParserATNSimulator.getRuleName(int index) |
static Map<ATNState,BitSet> |
PredictionMode.getStateToAltMap(ATNConfigSet configs)
Get a map from state to alt subset from a configuration set.
|
String |
LexerATNSimulator.getText(CharStream input)
Get the text matched so far for the current token.
|
String |
ParserATNSimulator.getTokenName(int t) |
String |
LexerATNSimulator.getTokenName(int t) |
IntervalSet |
SetTransition.label() |
IntervalSet |
RangeTransition.label() |
IntervalSet |
AtomTransition.label() |
IntervalSet |
LL1Analyzer.LOOK(ATNState s,
ATNState stopState,
RuleContext ctx)
Compute set of tokens that can follow
s in the ATN in the
specified ctx . |
IntervalSet |
LL1Analyzer.LOOK(ATNState s,
RuleContext ctx)
Compute set of tokens that can follow
s in the ATN in the
specified ctx . |
IntervalSet |
ATN.nextTokens(ATNState s)
Compute the set of valid tokens that can occur starting in
s and
staying in same rule. |
IntervalSet |
ATN.nextTokens(ATNState s,
RuleContext ctx)
Compute the set of valid tokens that can occur starting in state
s . |
protected NoViableAltException |
ParserATNSimulator.noViableAlt(TokenStream input,
ParserRuleContext outerContext,
ATNConfigSet configs,
int startIndex) |
protected ATNConfigSet |
ParserATNSimulator.removeAllConfigsNotInRuleStopState(ATNConfigSet configs,
boolean lookToEndOfRule)
Return a configuration set containing only the configurations from
configs which are in a RuleStopState . |
protected ATNConfig |
ParserATNSimulator.ruleTransition(ATNConfig config,
RuleTransition t) |
String |
WildcardTransition.toString() |
String |
SetTransition.toString() |
String |
RangeTransition.toString() |
String |
PredicateTransition.toString() |
String |
EpsilonTransition.toString() |
String |
AtomTransition.toString() |
Modifier and Type | Method and Description |
---|---|
protected void |
LL1Analyzer._LOOK(ATNState s,
ATNState stopState,
PredictionContext ctx,
IntervalSet look,
Set<ATNConfig> lookBusy,
BitSet calledRuleStack,
boolean seeThruPreds,
boolean addEOF)
Compute set of tokens that can follow
s in the ATN in the
specified ctx . |
protected void |
LL1Analyzer._LOOK(ATNState s,
ATNState stopState,
PredictionContext ctx,
IntervalSet look,
Set<ATNConfig> lookBusy,
BitSet calledRuleStack,
boolean seeThruPreds,
boolean addEOF)
Compute set of tokens that can follow
s in the ATN in the
specified ctx . |
protected void |
LL1Analyzer._LOOK(ATNState s,
ATNState stopState,
PredictionContext ctx,
IntervalSet look,
Set<ATNConfig> lookBusy,
BitSet calledRuleStack,
boolean seeThruPreds,
boolean addEOF)
Compute set of tokens that can follow
s in the ATN in the
specified ctx . |
protected void |
LL1Analyzer._LOOK(ATNState s,
ATNState stopState,
PredictionContext ctx,
IntervalSet look,
Set<ATNConfig> lookBusy,
BitSet calledRuleStack,
boolean seeThruPreds,
boolean addEOF)
Compute set of tokens that can follow
s in the ATN in the
specified ctx . |
protected void |
LexerATNSimulator.accept(CharStream input,
int ruleIndex,
int actionIndex,
int index,
int line,
int charPos) |
protected ATNConfig |
ParserATNSimulator.actionTransition(ATNConfig config,
ActionTransition t) |
protected ATNConfig |
ParserATNSimulator.actionTransition(ATNConfig config,
ActionTransition t) |
int |
ParserATNSimulator.adaptivePredict(TokenStream input,
int decision,
ParserRuleContext outerContext) |
boolean |
ATNConfigSet.add(ATNConfig config) |
boolean |
ATNConfigSet.add(ATNConfig config,
DoubleKeyMap<PredictionContext,PredictionContext,PredictionContext> mergeCache)
Adding a new config means merging contexts with existing configs for
(s, i, pi, _) , where s is the
ATNConfig.state , i is the ATNConfig.alt , and
pi is the ATNConfig.semanticContext . |
protected DFAState |
ParserATNSimulator.addDFAEdge(DFA dfa,
DFAState from,
int t,
DFAState to)
Add an edge to the DFA, if possible.
|
protected DFAState |
LexerATNSimulator.addDFAEdge(DFAState from,
int t,
ATNConfigSet q) |
protected DFAState |
LexerATNSimulator.addDFAEdge(DFAState from,
int t,
ATNConfigSet q) |
protected void |
LexerATNSimulator.addDFAEdge(DFAState p,
int t,
DFAState q) |
protected void |
LexerATNSimulator.addDFAEdge(DFAState p,
int t,
DFAState q) |
protected DFAState |
LexerATNSimulator.addDFAState(ATNConfigSet configs)
Add a new DFA state if there isn't one with this set of
configurations already.
|
protected DFAState |
ParserATNSimulator.addDFAState(DFA dfa,
DFAState D)
Add state
D to the DFA if it is not already present, and return
the actual instance stored in the DFA. |
protected DFAState |
ParserATNSimulator.addDFAState(DFA dfa,
DFAState D)
Add state
D to the DFA if it is not already present, and return
the actual instance stored in the DFA. |
static boolean |
PredictionMode.allConfigsInRuleStopStates(ATNConfigSet configs)
Checks if all configurations in
configs are in a
RuleStopState . |
static boolean |
PredictionMode.allSubsetsConflict(Collection<BitSet> altsets)
Determines if every alternative subset in
altsets contains more
than one alternative. |
static boolean |
PredictionMode.allSubsetsEqual(Collection<BitSet> altsets)
Determines if every alternative subset in
altsets is equivalent. |
protected void |
LexerATNSimulator.captureSimState(LexerATNSimulator.SimState settings,
CharStream input,
DFAState dfaState) |
protected void |
LexerATNSimulator.captureSimState(LexerATNSimulator.SimState settings,
CharStream input,
DFAState dfaState) |
protected void |
LexerATNSimulator.captureSimState(LexerATNSimulator.SimState settings,
CharStream input,
DFAState dfaState) |
protected void |
ParserATNSimulator.closure_(ATNConfig config,
ATNConfigSet configs,
Set<ATNConfig> closureBusy,
boolean collectPredicates,
boolean fullCtx,
int depth)
Do the actual work of walking epsilon edges
|
protected void |
ParserATNSimulator.closure_(ATNConfig config,
ATNConfigSet configs,
Set<ATNConfig> closureBusy,
boolean collectPredicates,
boolean fullCtx,
int depth)
Do the actual work of walking epsilon edges
|
protected void |
ParserATNSimulator.closure_(ATNConfig config,
ATNConfigSet configs,
Set<ATNConfig> closureBusy,
boolean collectPredicates,
boolean fullCtx,
int depth)
Do the actual work of walking epsilon edges
|
protected void |
ParserATNSimulator.closure(ATNConfig config,
ATNConfigSet configs,
Set<ATNConfig> closureBusy,
boolean collectPredicates,
boolean fullCtx) |
protected void |
ParserATNSimulator.closure(ATNConfig config,
ATNConfigSet configs,
Set<ATNConfig> closureBusy,
boolean collectPredicates,
boolean fullCtx) |
protected void |
ParserATNSimulator.closure(ATNConfig config,
ATNConfigSet configs,
Set<ATNConfig> closureBusy,
boolean collectPredicates,
boolean fullCtx) |
protected boolean |
LexerATNSimulator.closure(CharStream input,
LexerATNConfig config,
ATNConfigSet configs,
boolean currentAltReachedAcceptState,
boolean speculative)
Since the alternatives within any lexer decision are ordered by
preference, this method stops pursuing the closure as soon as an accept
state is reached.
|
protected boolean |
LexerATNSimulator.closure(CharStream input,
LexerATNConfig config,
ATNConfigSet configs,
boolean currentAltReachedAcceptState,
boolean speculative)
Since the alternatives within any lexer decision are ordered by
preference, this method stops pursuing the closure as soon as an accept
state is reached.
|
protected boolean |
LexerATNSimulator.closure(CharStream input,
LexerATNConfig config,
ATNConfigSet configs,
boolean currentAltReachedAcceptState,
boolean speculative)
Since the alternatives within any lexer decision are ordered by
preference, this method stops pursuing the closure as soon as an accept
state is reached.
|
protected void |
ParserATNSimulator.closureCheckingStopState(ATNConfig config,
ATNConfigSet configs,
Set<ATNConfig> closureBusy,
boolean collectPredicates,
boolean fullCtx,
int depth) |
protected void |
ParserATNSimulator.closureCheckingStopState(ATNConfig config,
ATNConfigSet configs,
Set<ATNConfig> closureBusy,
boolean collectPredicates,
boolean fullCtx,
int depth) |
protected void |
ParserATNSimulator.closureCheckingStopState(ATNConfig config,
ATNConfigSet configs,
Set<ATNConfig> closureBusy,
boolean collectPredicates,
boolean fullCtx,
int depth) |
protected ATNConfigSet |
ParserATNSimulator.computeStartState(ATNState p,
RuleContext ctx,
boolean fullCtx) |
protected ATNConfigSet |
LexerATNSimulator.computeStartState(CharStream input,
ATNState p) |
protected ATNConfigSet |
LexerATNSimulator.computeStartState(CharStream input,
ATNState p) |
protected DFAState |
LexerATNSimulator.computeTargetState(CharStream input,
DFAState s,
int t)
Compute a target state for an edge in the DFA, and attempt to add the
computed state and corresponding edge to the DFA.
|
protected DFAState |
LexerATNSimulator.computeTargetState(CharStream input,
DFAState s,
int t)
Compute a target state for an edge in the DFA, and attempt to add the
computed state and corresponding edge to the DFA.
|
protected DFAState |
ParserATNSimulator.computeTargetState(DFA dfa,
DFAState previousD,
int t)
Compute a target state for an edge in the DFA, and attempt to add the
computed state and corresponding edge to the DFA.
|
protected DFAState |
ParserATNSimulator.computeTargetState(DFA dfa,
DFAState previousD,
int t)
Compute a target state for an edge in the DFA, and attempt to add the
computed state and corresponding edge to the DFA.
|
void |
LexerATNSimulator.consume(CharStream input) |
void |
LexerATNSimulator.copyState(LexerATNSimulator simulator) |
int |
ATN.defineDecisionState(DecisionState s) |
static ATN |
ATNSimulator.deserialize(char[] data) |
void |
ParserATNSimulator.dumpDeadEndConfigs(NoViableAltException nvae)
Used for debugging in adaptivePredict around execATN but I cut
it out for clarity now that alg.
|
static Transition |
ATNSimulator.edgeFactory(ATN atn,
int type,
int src,
int trg,
int arg1,
int arg2,
int arg3,
List<IntervalSet> sets) |
protected BitSet |
ParserATNSimulator.evalSemanticContext(DFAState.PredPrediction[] predPredictions,
ParserRuleContext outerContext,
boolean complete)
Look through a list of predicate/alt pairs, returning alts for the
pairs that win.
|
protected boolean |
LexerATNSimulator.evaluatePredicate(CharStream input,
int ruleIndex,
int predIndex,
boolean speculative)
Evaluate a predicate specified in the lexer.
|
protected int |
LexerATNSimulator.execATN(CharStream input,
DFAState ds0) |
protected int |
LexerATNSimulator.execATN(CharStream input,
DFAState ds0) |
protected int |
ParserATNSimulator.execATN(DFA dfa,
DFAState s0,
TokenStream input,
int startIndex,
ParserRuleContext outerContext)
Performs ATN simulation to compute a predicted alternative based
upon the remaining input, but also updates the DFA cache to avoid
having to traverse the ATN again for the same input sequence.
|
protected int |
ParserATNSimulator.execATN(DFA dfa,
DFAState s0,
TokenStream input,
int startIndex,
ParserRuleContext outerContext)
Performs ATN simulation to compute a predicted alternative based
upon the remaining input, but also updates the DFA cache to avoid
having to traverse the ATN again for the same input sequence.
|
protected int |
ParserATNSimulator.execATN(DFA dfa,
DFAState s0,
TokenStream input,
int startIndex,
ParserRuleContext outerContext)
Performs ATN simulation to compute a predicted alternative based
upon the remaining input, but also updates the DFA cache to avoid
having to traverse the ATN again for the same input sequence.
|
protected int |
ParserATNSimulator.execATNWithFullContext(DFA dfa,
DFAState D,
ATNConfigSet s0,
TokenStream input,
int startIndex,
ParserRuleContext outerContext) |
protected int |
ParserATNSimulator.execATNWithFullContext(DFA dfa,
DFAState D,
ATNConfigSet s0,
TokenStream input,
int startIndex,
ParserRuleContext outerContext) |
static PredictionContext |
PredictionContext.fromRuleContext(ATN atn,
RuleContext outerContext)
Convert a
RuleContext tree to a PredictionContext graph. |
static BitSet |
PredictionMode.getAlts(Collection<BitSet> altsets)
Gets the complete set of represented alternatives for a collection of
alternative subsets.
|
static PredictionContext |
PredictionContext.getCachedContext(PredictionContext context,
PredictionContextCache contextCache,
IdentityHashMap<PredictionContext,PredictionContext> visited) |
static PredictionContext |
PredictionContext.getCachedContext(PredictionContext context,
PredictionContextCache contextCache,
IdentityHashMap<PredictionContext,PredictionContext> visited) |
static PredictionContext |
PredictionContext.getCachedContext(PredictionContext context,
PredictionContextCache contextCache,
IdentityHashMap<PredictionContext,PredictionContext> visited) |
protected ATNConfig |
ParserATNSimulator.getEpsilonTarget(ATNConfig config,
Transition t,
boolean collectPredicates,
boolean inContext,
boolean fullCtx) |
protected ATNConfig |
ParserATNSimulator.getEpsilonTarget(ATNConfig config,
Transition t,
boolean collectPredicates,
boolean inContext,
boolean fullCtx) |
protected LexerATNConfig |
LexerATNSimulator.getEpsilonTarget(CharStream input,
LexerATNConfig config,
Transition t,
ATNConfigSet configs,
boolean speculative) |
protected LexerATNConfig |
LexerATNSimulator.getEpsilonTarget(CharStream input,
LexerATNConfig config,
Transition t,
ATNConfigSet configs,
boolean speculative) |
protected LexerATNConfig |
LexerATNSimulator.getEpsilonTarget(CharStream input,
LexerATNConfig config,
Transition t,
ATNConfigSet configs,
boolean speculative) |
protected LexerATNConfig |
LexerATNSimulator.getEpsilonTarget(CharStream input,
LexerATNConfig config,
Transition t,
ATNConfigSet configs,
boolean speculative) |
protected DFAState |
ParserATNSimulator.getExistingTargetState(DFAState previousD,
int t)
Get an existing target state for an edge in the DFA.
|
protected DFAState |
LexerATNSimulator.getExistingTargetState(DFAState s,
int t)
Get an existing target state for an edge in the DFA.
|
protected SemanticContext[] |
ParserATNSimulator.getPredsForAmbigAlts(BitSet ambigAlts,
ATNConfigSet configs,
int nalts) |
protected SemanticContext[] |
ParserATNSimulator.getPredsForAmbigAlts(BitSet ambigAlts,
ATNConfigSet configs,
int nalts) |
protected void |
LexerATNSimulator.getReachableConfigSet(CharStream input,
ATNConfigSet closure,
ATNConfigSet reach,
int t)
Given a starting configuration set, figure out all ATN configurations
we can reach upon input
t . |
protected void |
LexerATNSimulator.getReachableConfigSet(CharStream input,
ATNConfigSet closure,
ATNConfigSet reach,
int t)
Given a starting configuration set, figure out all ATN configurations
we can reach upon input
t . |
protected void |
LexerATNSimulator.getReachableConfigSet(CharStream input,
ATNConfigSet closure,
ATNConfigSet reach,
int t)
Given a starting configuration set, figure out all ATN configurations
we can reach upon input
t . |
protected ATNState |
ParserATNSimulator.getReachableTarget(Transition trans,
int ttype) |
static int |
PredictionMode.getSingleViableAlt(Collection<BitSet> altsets) |
static Map<ATNState,BitSet> |
PredictionMode.getStateToAltMap(ATNConfigSet configs)
Get a map from state to alt subset from a configuration set.
|
String |
LexerATNSimulator.getText(CharStream input)
Get the text matched so far for the current token.
|
protected static int |
ParserATNSimulator.getUniqueAlt(ATNConfigSet configs) |
static int |
PredictionMode.getUniqueAlt(Collection<BitSet> altsets)
Returns the unique alternative predicted by all alternative subsets in
altsets . |
static boolean |
PredictionMode.hasConflictingAltSet(Collection<BitSet> altsets)
Determines if any single alternative subset in
altsets contains
more than one alternative. |
static boolean |
PredictionMode.hasNonConflictingAltSet(Collection<BitSet> altsets)
Determines if any single alternative subset in
altsets contains
exactly one alternative. |
static boolean |
PredictionMode.hasSLLConflictTerminatingPrediction(PredictionMode mode,
ATNConfigSet configs)
Computes the SLL prediction termination condition.
|
static boolean |
PredictionMode.hasStateAssociatedWithOneAlt(ATNConfigSet configs) |
IntervalSet |
LL1Analyzer.LOOK(ATNState s,
ATNState stopState,
RuleContext ctx)
Compute set of tokens that can follow
s in the ATN in the
specified ctx . |
IntervalSet |
LL1Analyzer.LOOK(ATNState s,
RuleContext ctx)
Compute set of tokens that can follow
s in the ATN in the
specified ctx . |
int |
LexerATNSimulator.match(CharStream input,
int mode) |
protected int |
LexerATNSimulator.matchATN(CharStream input) |
IntervalSet |
ATN.nextTokens(ATNState s)
Compute the set of valid tokens that can occur starting in
s and
staying in same rule. |
protected NoViableAltException |
ParserATNSimulator.noViableAlt(TokenStream input,
ParserRuleContext outerContext,
ATNConfigSet configs,
int startIndex) |
protected NoViableAltException |
ParserATNSimulator.noViableAlt(TokenStream input,
ParserRuleContext outerContext,
ATNConfigSet configs,
int startIndex) |
protected NoViableAltException |
ParserATNSimulator.noViableAlt(TokenStream input,
ParserRuleContext outerContext,
ATNConfigSet configs,
int startIndex) |
protected ATNConfig |
ParserATNSimulator.predTransition(ATNConfig config,
PredicateTransition pt,
boolean collectPredicates,
boolean inContext,
boolean fullCtx) |
protected ATNConfig |
ParserATNSimulator.predTransition(ATNConfig config,
PredicateTransition pt,
boolean collectPredicates,
boolean inContext,
boolean fullCtx) |
protected ATNConfigSet |
ParserATNSimulator.removeAllConfigsNotInRuleStopState(ATNConfigSet configs,
boolean lookToEndOfRule)
Return a configuration set containing only the configurations from
configs which are in a RuleStopState . |
void |
ATN.removeState(ATNState state) |
protected void |
ParserATNSimulator.reportAmbiguity(DFA dfa,
DFAState D,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs)
If context sensitive parsing, we know it's ambiguity not conflict
|
protected void |
ParserATNSimulator.reportAmbiguity(DFA dfa,
DFAState D,
int startIndex,
int stopIndex,
boolean exact,
BitSet ambigAlts,
ATNConfigSet configs)
If context sensitive parsing, we know it's ambiguity not conflict
|
protected void |
ParserATNSimulator.reportAttemptingFullContext(DFA dfa,
BitSet conflictingAlts,
ATNConfigSet configs,
int startIndex,
int stopIndex) |
protected void |
ParserATNSimulator.reportContextSensitivity(DFA dfa,
int prediction,
ATNConfigSet configs,
int startIndex,
int stopIndex) |
static int |
PredictionMode.resolvesToJustOneViableAlt(Collection<BitSet> altsets)
Full LL prediction termination.
|
protected ATNConfig |
ParserATNSimulator.ruleTransition(ATNConfig config,
RuleTransition t) |
protected ATNConfig |
ParserATNSimulator.ruleTransition(ATNConfig config,
RuleTransition t) |
void |
ParserATNSimulator.setPredictionMode(PredictionMode mode) |
Modifier and Type | Field and Description |
---|---|
DecisionState |
DFA.atnStartState
From which ATN state did we create this DFA?
|
ATNConfigSet |
DFAState.configs |
SemanticContext |
DFAState.PredPrediction.pred |
Map<DFAState,DFAState> |
DFA.states
A set of all DFA states.
|
Modifier and Type | Method and Description |
---|---|
protected String |
LexerDFASerializer.getEdgeLabel(int i) |
List<DFAState> |
DFA.getStates()
Return a list of all states in this DFA, ordered by state number.
|
protected String |
DFASerializer.getStateString(DFAState s) |
Modifier and Type | Method and Description |
---|---|
protected String |
DFASerializer.getStateString(DFAState s) |
Constructor and Description |
---|
DFA(DecisionState atnStartState) |
DFA(DecisionState atnStartState,
int decision) |
DFASerializer(DFA dfa,
String[] tokenNames) |
DFAState(ATNConfigSet configs) |
LexerDFASerializer(DFA dfa) |
Modifier and Type | Field and Description |
---|---|
protected AbstractEqualityComparator<? super K> |
FlexibleHashMap.comparator |
protected AbstractEqualityComparator<? super T> |
Array2DHashSet.comparator |
Modifier and Type | Method and Description |
---|---|
static IntervalSet |
IntervalSet.of(int a)
Create a set with a single element, el.
|
Constructor and Description |
---|
IntegerList(Collection<Integer> list) |
IntegerList(IntegerList list) |
IntegerStack(IntegerStack list) |
Modifier and Type | Method and Description |
---|---|
static List<? extends Tree> |
Trees.getAncestors(Tree t)
Return a list of all ancestors of this node.
|
Interval |
SyntaxTree.getSourceInterval()
Return an
Interval indicating the index in the
TokenStream of the first and last token associated with this
subtree. |
Modifier and Type | Method and Description |
---|---|
void |
ParseTreeListener.enterEveryRule(ParserRuleContext ctx) |
void |
ParseTreeListener.exitEveryRule(ParserRuleContext ctx) |
static List<? extends Tree> |
Trees.getAncestors(Tree t)
Return a list of all ancestors of this node.
|
static String |
Trees.getNodeText(Tree t,
List<String> ruleNames) |
static String |
Trees.getNodeText(Tree t,
Parser recog) |
protected boolean |
AbstractParseTreeVisitor.shouldVisitNextChild(RuleNode node,
T currentResult)
This method is called after visiting each child in
AbstractParseTreeVisitor.visitChildren(org.antlr.v4.runtime.tree.RuleNode) . |
static String |
Trees.toStringTree(Tree t)
Print out a whole tree in LISP form.
|
static String |
Trees.toStringTree(Tree t,
List<String> ruleNames)
Print out a whole tree in LISP form.
|
static String |
Trees.toStringTree(Tree t,
Parser recog)
Print out a whole tree in LISP form.
|
T |
ParseTreeVisitor.visit(ParseTree tree)
Visit a parse tree, and return a user-defined result of the operation.
|
T |
AbstractParseTreeVisitor.visit(ParseTree tree)
Visit a parse tree, and return a user-defined result of the operation.
|
T |
ParseTreeVisitor.visitChildren(RuleNode node)
Visit the children of a node, and return a user-defined result of the
operation.
|
T |
AbstractParseTreeVisitor.visitChildren(RuleNode node)
Visit the children of a node, and return a user-defined result of the
operation.
|
T |
ParseTreeVisitor.visitErrorNode(ErrorNode node)
Visit an error node, and return a user-defined result of the operation.
|
void |
ParseTreeListener.visitErrorNode(ErrorNode node) |
T |
AbstractParseTreeVisitor.visitErrorNode(ErrorNode node)
Visit an error node, and return a user-defined result of the operation.
|
T |
ParseTreeVisitor.visitTerminal(TerminalNode node)
Visit a terminal node, and return a user-defined result of the operation.
|
void |
ParseTreeListener.visitTerminal(TerminalNode node) |
T |
AbstractParseTreeVisitor.visitTerminal(TerminalNode node)
Visit a terminal node, and return a user-defined result of the operation.
|
Modifier and Type | Method and Description |
---|---|
Future<JDialog> |
TreeViewer.open() |
protected static JDialog |
TreeViewer.showInDialog(TreeViewer viewer) |
Copyright © 1992-2013 ANTLR. All Rights Reserved.