public class ProfilingATNSimulator extends ParserATNSimulator
| Modifier and Type | Field and Description |
|---|---|
protected int |
_llStopIndex |
protected int |
_sllStopIndex |
protected int |
conflictingAltResolvedBySLL
At the point of LL failover, we record how SLL would resolve the conflict so that
we can determine whether or not a decision / input pair is context-sensitive.
|
protected int |
currentDecision |
protected DFAState |
currentState |
protected DecisionInfo[] |
decisions |
protected int |
numDecisions |
_dfa, _input, _outerContext, _startIndex, debug, debug_list_atn_decisions, decisionToDFA, dfa_debug, mergeCache, parser, retry_debugatn, ERROR, SERIALIZED_UUID, SERIALIZED_VERSION, sharedContextCache| Constructor and Description |
|---|
ProfilingATNSimulator(Parser parser) |
| Modifier and Type | Method and Description |
|---|---|
int |
adaptivePredict(TokenStream input,
int decision,
ParserRuleContext outerContext) |
protected ATNConfigSet |
computeReachSet(ATNConfigSet closure,
int t,
boolean fullCtx) |
protected DFAState |
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 boolean |
evalSemanticContext(SemanticContext pred,
ParserRuleContext parserCallStack,
int alt,
boolean fullCtx)
Evaluate a semantic context within a specific parser context.
|
DecisionInfo[] |
getDecisionInfo() |
protected DFAState |
getExistingTargetState(DFAState previousD,
int t)
Get an existing target state for an edge in the DFA.
|
protected void |
reportAmbiguity(DFA dfa,
DFAState D,
int startIndex,
int stopIndex,
boolean exact,
java.util.BitSet ambigAlts,
ATNConfigSet configs)
If context sensitive parsing, we know it's ambiguity not conflict
|
protected void |
reportAttemptingFullContext(DFA dfa,
java.util.BitSet conflictingAlts,
ATNConfigSet configs,
int startIndex,
int stopIndex) |
protected void |
reportContextSensitivity(DFA dfa,
int prediction,
ATNConfigSet configs,
int startIndex,
int stopIndex) |
actionTransition, addDFAEdge, addDFAState, applyPrecedenceFilter, clearDFA, closure_, closure, closureCheckingStopState, computeStartState, dumpDeadEndConfigs, evalSemanticContext, execATN, execATNWithFullContext, getAltThatFinishedDecisionEntryRule, getConflictingAlts, getConflictingAltsOrUniqueAlt, getEpsilonTarget, getLookaheadName, getParser, getPredicatePredictions, getPredictionMode, getPredsForAmbigAlts, getReachableTarget, getRuleName, getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule, getTokenName, getUniqueAlt, noViableAlt, precedenceTransition, predicateDFAState, predTransition, removeAllConfigsNotInRuleStopState, reset, ruleTransition, setPredictionMode, splitAccordingToSemanticValiditycheckCondition, checkCondition, deserialize, edgeFactory, getCachedContext, getSharedContextCache, stateFactory, toInt, toInt32, toLong, toUUIDprotected final DecisionInfo[] decisions
protected int numDecisions
protected int _sllStopIndex
protected int _llStopIndex
protected int currentDecision
protected DFAState currentState
protected int conflictingAltResolvedBySLL
public ProfilingATNSimulator(Parser parser)
public int adaptivePredict(TokenStream input, int decision, ParserRuleContext outerContext)
adaptivePredict in class ParserATNSimulatorprotected DFAState getExistingTargetState(DFAState previousD, int t)
ParserATNSimulatornull.getExistingTargetState in class ParserATNSimulatorpreviousD - The current DFA statet - The next input symbolt, or null if the target state for this edge is not
already cachedprotected DFAState computeTargetState(DFA dfa, DFAState previousD, int t)
ParserATNSimulatorcomputeTargetState in class ParserATNSimulatordfa - The DFApreviousD - The current DFA statet - The next input symbolt. If t does not lead to a valid DFA state, this method
returns ATNSimulator.ERROR.protected ATNConfigSet computeReachSet(ATNConfigSet closure, int t, boolean fullCtx)
computeReachSet in class ParserATNSimulatorprotected boolean evalSemanticContext(SemanticContext pred, ParserRuleContext parserCallStack, int alt, boolean fullCtx)
ParserATNSimulatorThis method might not be called for every semantic context evaluated during the prediction process. In particular, we currently do not evaluate the following but it may change in the future:
SemanticContext.PrecedencePredicate) are not currently evaluated
through this method.SemanticContext.AND and
SemanticContext.OR) are evaluated as a single semantic
context, rather than evaluating the operands individually.
Implementations which require evaluation results from individual
predicates should override this method to explicitly handle evaluation of
the operands within operator predicates.evalSemanticContext in class ParserATNSimulatorpred - The semantic context to evaluateparserCallStack - The parser context in which to evaluate the
semantic contextalt - The alternative which is guarded by predfullCtx - true if the evaluation is occurring during LL
prediction; otherwise, false if the evaluation is occurring
during SLL predictionprotected void reportAttemptingFullContext(DFA dfa, java.util.BitSet conflictingAlts, ATNConfigSet configs, int startIndex, int stopIndex)
reportAttemptingFullContext in class ParserATNSimulatorprotected void reportContextSensitivity(DFA dfa, int prediction, ATNConfigSet configs, int startIndex, int stopIndex)
reportContextSensitivity in class ParserATNSimulatorprotected void reportAmbiguity(DFA dfa, DFAState D, int startIndex, int stopIndex, boolean exact, java.util.BitSet ambigAlts, ATNConfigSet configs)
ParserATNSimulatorreportAmbiguity in class ParserATNSimulatorpublic DecisionInfo[] getDecisionInfo()