public class DecisionInfo extends Object
Parsing performance in ANTLR 4 is heavily influenced by both static factors (e.g. the form of the rules in the grammar) and dynamic factors (e.g. the choice of input and the state of the DFA cache at the time profiling operations are started). For best results, gather and use aggregate statistics from a large sample of inputs representing the inputs expected in production before using the results to make changes in the grammar.
Modifier and Type | Field and Description |
---|---|
List<AmbiguityInfo> |
ambiguities
A collection of
AmbiguityInfo instances describing the
ambiguities encountered during LL prediction for this decision. |
List<ContextSensitivityInfo> |
contextSensitivities
A collection of
ContextSensitivityInfo instances describing the
context sensitivities encountered during LL prediction for this decision. |
int |
decision
The decision number, which is an index into
ATN.decisionToState . |
List<ErrorInfo> |
errors
A collection of
ErrorInfo instances describing the parse errors
identified during calls to ParserATNSimulator.adaptivePredict(org.antlr.v4.runtime.TokenStream, int, org.antlr.v4.runtime.ParserRuleContext) for
this decision. |
long |
invocations
The total number of times
ParserATNSimulator.adaptivePredict(org.antlr.v4.runtime.TokenStream, int, org.antlr.v4.runtime.ParserRuleContext) was
invoked for this decision. |
long |
LL_ATNTransitions
The total number of ATN transitions required during LL prediction for
this decision.
|
long |
LL_DFATransitions
The total number of DFA transitions required during LL prediction for
this decision.
|
long |
LL_Fallback
Gets the total number of times SLL prediction completed in a conflict
state, resulting in fallback to LL prediction.
|
long |
LL_MaxLook
Gets the maximum lookahead required for any single LL prediction to
complete for this decision.
|
LookaheadEventInfo |
LL_MaxLookEvent
Gets the
LookaheadEventInfo associated with the event where the
LL_MaxLook value was set. |
long |
LL_MinLook
Gets the minimum lookahead required for any single LL prediction to
complete for this decision.
|
long |
LL_TotalLook
The sum of the lookahead required for LL prediction for this decision.
|
List<PredicateEvalInfo> |
predicateEvals
A collection of
PredicateEvalInfo instances describing the
results of evaluating individual predicates during prediction for this
decision. |
long |
SLL_ATNTransitions
The total number of ATN transitions required during SLL prediction for
this decision.
|
long |
SLL_DFATransitions
The total number of DFA transitions required during SLL prediction for
this decision.
|
long |
SLL_MaxLook
Gets the maximum lookahead required for any single SLL prediction to
complete for this decision, by reaching a unique prediction, reaching an
SLL conflict state, or encountering a syntax error.
|
LookaheadEventInfo |
SLL_MaxLookEvent
Gets the
LookaheadEventInfo associated with the event where the
SLL_MaxLook value was set. |
long |
SLL_MinLook
Gets the minimum lookahead required for any single SLL prediction to
complete for this decision, by reaching a unique prediction, reaching an
SLL conflict state, or encountering a syntax error.
|
long |
SLL_TotalLook
The sum of the lookahead required for SLL prediction for this decision.
|
long |
timeInPrediction
The total time spent in
ParserATNSimulator.adaptivePredict(org.antlr.v4.runtime.TokenStream, int, org.antlr.v4.runtime.ParserRuleContext) for
this decision, in nanoseconds. |
Constructor and Description |
---|
DecisionInfo(int decision)
Constructs a new instance of the
DecisionInfo class to contain
statistics for a particular decision. |
public final int decision
ATN.decisionToState
.public long invocations
ParserATNSimulator.adaptivePredict(org.antlr.v4.runtime.TokenStream, int, org.antlr.v4.runtime.ParserRuleContext)
was
invoked for this decision.public long timeInPrediction
ParserATNSimulator.adaptivePredict(org.antlr.v4.runtime.TokenStream, int, org.antlr.v4.runtime.ParserRuleContext)
for
this decision, in nanoseconds.
The value of this field contains the sum of differential results obtained
by System.nanoTime()
, and is not adjusted to compensate for JIT
and/or garbage collection overhead. For best accuracy, use a modern JVM
implementation that provides precise results from
System.nanoTime()
, and perform profiling in a separate process
which is warmed up by parsing the input prior to profiling. If desired,
call ATNSimulator.clearDFA()
to reset the DFA cache to its initial
state before starting the profiling measurement pass.
public long SLL_TotalLook
PredictionMode.LL
or
PredictionMode.LL_EXACT_AMBIG_DETECTION
is used.public long SLL_MinLook
public long SLL_MaxLook
public LookaheadEventInfo SLL_MaxLookEvent
LookaheadEventInfo
associated with the event where the
SLL_MaxLook
value was set.public long LL_TotalLook
public long LL_MinLook
PredictionMode.LL
, an ambiguity state (for
PredictionMode.LL_EXACT_AMBIG_DETECTION
, or a syntax error.public long LL_MaxLook
PredictionMode.LL
, an ambiguity state (for
PredictionMode.LL_EXACT_AMBIG_DETECTION
, or a syntax error.public LookaheadEventInfo LL_MaxLookEvent
LookaheadEventInfo
associated with the event where the
LL_MaxLook
value was set.public final List<ContextSensitivityInfo> contextSensitivities
ContextSensitivityInfo
instances describing the
context sensitivities encountered during LL prediction for this decision.ContextSensitivityInfo
public final List<ErrorInfo> errors
ErrorInfo
instances describing the parse errors
identified during calls to ParserATNSimulator.adaptivePredict(org.antlr.v4.runtime.TokenStream, int, org.antlr.v4.runtime.ParserRuleContext)
for
this decision.ErrorInfo
public final List<AmbiguityInfo> ambiguities
AmbiguityInfo
instances describing the
ambiguities encountered during LL prediction for this decision.AmbiguityInfo
public final List<PredicateEvalInfo> predicateEvals
PredicateEvalInfo
instances describing the
results of evaluating individual predicates during prediction for this
decision.PredicateEvalInfo
public long SLL_ATNTransitions
If DFA caching of SLL transitions is employed by the implementation, ATN computation may cache the computed edge for efficient lookup during future parsing of this decision. Otherwise, the SLL parsing algorithm will use ATN transitions exclusively.
public long SLL_DFATransitions
If the ATN simulator implementation does not use DFA caching for SLL transitions, this value will be 0.
public long LL_Fallback
Note that this value is not related to whether or not
PredictionMode.SLL
may be used successfully with a particular
grammar. If the ambiguity resolution algorithm applied to the SLL
conflicts for this decision produce the same result as LL prediction for
this decision, PredictionMode.SLL
would produce the same overall
parsing result as PredictionMode.LL
.
public long LL_ATNTransitions
If DFA caching of LL transitions is employed by the implementation, ATN computation may cache the computed edge for efficient lookup during future parsing of this decision. Otherwise, the LL parsing algorithm will use ATN transitions exclusively.
public long LL_DFATransitions
If the ATN simulator implementation does not use DFA caching for LL transitions, this value will be 0.
public DecisionInfo(int decision)
DecisionInfo
class to contain
statistics for a particular decision.decision
- The decision numberCopyright © 1992-2015 ANTLR. All Rights Reserved.