| Package | Description |
|---|---|
| org.antlr.v4.runtime | |
| org.antlr.v4.runtime.atn | |
| org.antlr.v4.runtime.tree |
| Modifier and Type | Class and Description |
|---|---|
class |
InterpreterRuleContext
This class extends
ParserRuleContext by allowing the value of
InterpreterRuleContext.getRuleIndex() to be explicitly set for the context. |
class |
RuleContextWithAltNum
A handy class for use with
options {contextSuperClass=org.antlr.v4.runtime.RuleContextWithAltNum;}
that provides a backing field / impl for the outer alternative number
matched for an internal parse tree node.
|
| Modifier and Type | Field and Description |
|---|---|
protected ParserRuleContext |
Parser._ctx
The
ParserRuleContext object for the currently executing rule. |
protected ParserRuleContext |
DefaultErrorStrategy.nextTokensContext
This field is used to propagate information about the lookahead following
the previous match.
|
| Modifier and Type | Field and Description |
|---|---|
protected Deque<Tuple2<ParserRuleContext,Integer>> |
ParserInterpreter._parentContextStack
This stack corresponds to the _parentctx, _parentState pair of locals
that would exist on call stack frames with a recursive descent parser;
in the generated function for a left-recursive rule you'd see:
private EContext e(int _p) throws RecognitionException {
ParserRuleContext _parentctx = _ctx; // Pair.a
int _parentState = getState(); // Pair.b
...
|
| Modifier and Type | Method and Description |
|---|---|
<T extends ParserRuleContext> |
ParserRuleContext.getRuleContext(Class<? extends T> ctxType,
int i) |
<T extends ParserRuleContext> |
ParserRuleContext.getRuleContexts(Class<? extends T> ctxType) |
| Modifier and Type | Method and Description |
|---|---|
static ParserRuleContext |
ParserRuleContext.emptyContext() |
ParserRuleContext |
Parser.getContext() |
ParserRuleContext |
Parser.getInvokingContext(int ruleIndex) |
ParserRuleContext |
ParserRuleContext.getParent() |
ParserRuleContext |
Parser.getRuleContext() |
ParserRuleContext |
ParserInterpreter.parse(int startRuleIndex)
Begin parsing at startRuleIndex
|
| Modifier and Type | Method and Description |
|---|---|
void |
ParserRuleContext.copyFrom(ParserRuleContext ctx)
COPY a ctx (I'm deliberately not using copy constructor) to avoid
confusion with creating node with parent.
|
ErrorNode |
Parser.createErrorNode(ParserRuleContext parent,
Token t)
How to create an error node, given a token, associated with a parent.
|
protected InterpreterRuleContext |
ParserInterpreter.createInterpreterRuleContext(ParserRuleContext parent,
int invokingStateNumber,
int ruleIndex)
Provide simple "factory" for InterpreterRuleContext's.
|
TerminalNode |
Parser.createTerminalNode(ParserRuleContext parent,
Token t)
How to create a token leaf node associated with a parent.
|
void |
Parser.TraceListener.enterEveryRule(ParserRuleContext ctx) |
void |
Parser.TrimToSizeListener.enterEveryRule(ParserRuleContext ctx) |
void |
Parser.enterLeftFactoredRule(ParserRuleContext localctx,
int state,
int ruleIndex) |
void |
Parser.enterOuterAlt(ParserRuleContext localctx,
int altNum) |
void |
Parser.enterRecursionRule(ParserRuleContext localctx,
int ruleIndex)
Deprecated.
|
void |
ParserInterpreter.enterRecursionRule(ParserRuleContext localctx,
int state,
int ruleIndex,
int precedence) |
void |
Parser.enterRecursionRule(ParserRuleContext localctx,
int state,
int ruleIndex,
int precedence) |
void |
Parser.enterRule(ParserRuleContext localctx,
int state,
int ruleIndex)
Always called by generated parsers upon entry to a rule.
|
void |
Parser.TraceListener.exitEveryRule(ParserRuleContext ctx) |
void |
Parser.TrimToSizeListener.exitEveryRule(ParserRuleContext ctx) |
void |
Parser.pushNewRecursionContext(ParserRuleContext localctx,
int state,
int ruleIndex)
Like
Parser.enterRule(org.antlr.v4.runtime.ParserRuleContext, int, int) but for recursive rules. |
void |
Parser.setContext(ParserRuleContext ctx) |
void |
Parser.unrollRecursionContexts(ParserRuleContext _parentctx) |
| Constructor and Description |
|---|
InputMismatchException(Parser recognizer,
int state,
ParserRuleContext ctx) |
InterpreterRuleContext(ParserRuleContext parent,
int invokingStateNumber,
int ruleIndex)
Constructs a new
InterpreterRuleContext with the specified
parent, invoking state, and rule index. |
NoViableAltException(Recognizer<Token,?> recognizer,
TokenStream input,
Token startToken,
Token offendingToken,
ATNConfigSet deadEndConfigs,
ParserRuleContext ctx) |
ParserRuleContext(ParserRuleContext parent,
int invokingStateNumber) |
RecognitionException(Recognizer<Token,?> recognizer,
IntStream input,
ParserRuleContext ctx) |
RecognitionException(String message,
Recognizer<Token,?> recognizer,
IntStream input,
ParserRuleContext ctx) |
RuleContextWithAltNum(ParserRuleContext parent,
int invokingStateNumber) |
| Modifier and Type | Field and Description |
|---|---|
ParserRuleContext |
SimulatorState.outerContext |
ParserRuleContext |
SimulatorState.remainingOuterContext |
| Modifier and Type | Method and Description |
|---|---|
protected ParserRuleContext |
ParserATNSimulator.skipTailCalls(ParserRuleContext context) |
| Modifier and Type | Method and Description |
|---|---|
protected Tuple2<DFAState,ParserRuleContext> |
ProfilingATNSimulator.computeTargetState(DFA dfa,
DFAState s,
ParserRuleContext remainingGlobalContext,
int t,
boolean useContext,
PredictionContextCache contextCache) |
protected Tuple2<DFAState,ParserRuleContext> |
ParserATNSimulator.computeTargetState(DFA dfa,
DFAState s,
ParserRuleContext remainingGlobalContext,
int t,
boolean useContext,
PredictionContextCache contextCache)
Compute a target state for an edge in the DFA, and attempt to add the
computed state and corresponding edge to the DFA.
|
| Modifier and Type | Method and Description |
|---|---|
int |
ProfilingATNSimulator.adaptivePredict(TokenStream input,
int decision,
ParserRuleContext outerContext) |
int |
ParserATNSimulator.adaptivePredict(TokenStream input,
int decision,
ParserRuleContext outerContext) |
int |
ParserATNSimulator.adaptivePredict(TokenStream input,
int decision,
ParserRuleContext outerContext,
boolean useContext) |
protected ATNConfigSet |
ParserATNSimulator.applyPrecedenceFilter(ATNConfigSet configs,
ParserRuleContext globalContext,
PredictionContextCache contextCache)
This method transforms the start state computed by
ParserATNSimulator.computeStartState(org.antlr.v4.runtime.dfa.DFA, org.antlr.v4.runtime.ParserRuleContext, boolean) to the special start state used by a
precedence DFA for a particular precedence value. |
protected SimulatorState |
ProfilingATNSimulator.computeStartState(DFA dfa,
ParserRuleContext globalContext,
boolean useContext) |
protected SimulatorState |
ParserATNSimulator.computeStartState(DFA dfa,
ParserRuleContext globalContext,
boolean useContext) |
protected Tuple2<DFAState,ParserRuleContext> |
ProfilingATNSimulator.computeTargetState(DFA dfa,
DFAState s,
ParserRuleContext remainingGlobalContext,
int t,
boolean useContext,
PredictionContextCache contextCache) |
protected Tuple2<DFAState,ParserRuleContext> |
ParserATNSimulator.computeTargetState(DFA dfa,
DFAState s,
ParserRuleContext remainingGlobalContext,
int t,
boolean useContext,
PredictionContextCache contextCache)
Compute a target state for an edge in the DFA, and attempt to add the
computed state and corresponding edge to the DFA.
|
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 |
ProfilingATNSimulator.evalSemanticContext(SemanticContext pred,
ParserRuleContext parserCallStack,
int alt) |
protected boolean |
ParserATNSimulator.evalSemanticContext(SemanticContext pred,
ParserRuleContext parserCallStack,
int alt)
Evaluate a semantic context within a specific parser context.
|
protected SimulatorState |
ProfilingATNSimulator.getStartState(DFA dfa,
TokenStream input,
ParserRuleContext outerContext,
boolean useContext) |
protected SimulatorState |
ParserATNSimulator.getStartState(DFA dfa,
TokenStream input,
ParserRuleContext outerContext,
boolean useContext) |
protected NoViableAltException |
ParserATNSimulator.noViableAlt(TokenStream input,
ParserRuleContext outerContext,
ATNConfigSet configs,
int startIndex) |
protected ParserRuleContext |
ParserATNSimulator.skipTailCalls(ParserRuleContext context) |
| Constructor and Description |
|---|
SimulatorState(ParserRuleContext outerContext,
DFAState s0,
boolean useContext,
ParserRuleContext remainingOuterContext) |
| Modifier and Type | Method and Description |
|---|---|
static ParserRuleContext |
Trees.getRootOfSubtreeEnclosingRegion(ParseTree t,
int startTokenIndex,
int stopTokenIndex)
Find smallest subtree of t enclosing range startTokenIndex..stopTokenIndex
inclusively using postorder traversal.
|
| Modifier and Type | Method and Description |
|---|---|
void |
ParseTreeListener.enterEveryRule(ParserRuleContext ctx) |
void |
ParseTreeListener.exitEveryRule(ParserRuleContext ctx) |
static void |
Trees.stripChildrenOutOfRange(ParserRuleContext t,
ParserRuleContext root,
int startIndex,
int stopIndex)
Replace any subtree siblings of root that are completely to left
or right of lookahead range with a CommonToken(Token.INVALID_TYPE,"...")
node.
|
Copyright © 1992–2024 Daniel Sun. All rights reserved.