public class ATNConfig extends Object
Modifier and Type | Field and Description |
---|---|
int |
alt
What alt (or lexer rule) is predicted by this configuration
|
PredictionContext |
context
The stack of invoking states leading to the rule/states associated
with this config.
|
int |
reachesIntoOuterContext
We cannot execute predicates dependent upon local context unless
we know for sure we are in the correct context.
|
SemanticContext |
semanticContext |
ATNState |
state
The ATN state associated with this configuration
|
Constructor and Description |
---|
ATNConfig(ATNConfig old) |
ATNConfig(ATNConfig c,
ATNState state) |
ATNConfig(ATNConfig c,
ATNState state,
PredictionContext context) |
ATNConfig(ATNConfig c,
ATNState state,
PredictionContext context,
SemanticContext semanticContext) |
ATNConfig(ATNConfig c,
ATNState state,
SemanticContext semanticContext) |
ATNConfig(ATNConfig c,
SemanticContext semanticContext) |
ATNConfig(ATNState state,
int alt,
PredictionContext context) |
ATNConfig(ATNState state,
int alt,
PredictionContext context,
SemanticContext semanticContext) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(ATNConfig other) |
boolean |
equals(Object o)
An ATN configuration is equal to another if both have
the same state, they predict the same alternative, and
syntactic/semantic contexts are the same.
|
int |
getOuterContextDepth()
This method gets the value of the
reachesIntoOuterContext field
as it existed prior to the introduction of the
isPrecedenceFilterSuppressed() method. |
int |
hashCode() |
boolean |
isPrecedenceFilterSuppressed() |
void |
setPrecedenceFilterSuppressed(boolean value) |
String |
toString() |
String |
toString(Recognizer<?,?> recog,
boolean showAlt) |
public final ATNState state
public final int alt
public PredictionContext context
public int reachesIntoOuterContext
closure() tracks the depth of how far we dip into the outer context: depth > 0. Note that it may not be totally accurate depth since I don't ever decrement. TODO: make it a boolean then
For memory efficiency, the isPrecedenceFilterSuppressed()
method
is also backed by this field. Since the field is publicly accessible, the
highest bit which would not cause the value to become negative is used to
store this field. This choice minimizes the risk that code which only
compares this value to 0 would be affected by the new purpose of the
flag. It also ensures the performance of the existing ATNConfig
constructors as well as certain operations like
ATNConfigSet.add(ATNConfig, DoubleKeyMap)
method are
completely unaffected by the change.
public final SemanticContext semanticContext
public ATNConfig(ATNConfig old)
public ATNConfig(ATNState state, int alt, PredictionContext context)
public ATNConfig(ATNState state, int alt, PredictionContext context, SemanticContext semanticContext)
public ATNConfig(ATNConfig c, ATNState state, SemanticContext semanticContext)
public ATNConfig(ATNConfig c, SemanticContext semanticContext)
public ATNConfig(ATNConfig c, ATNState state, PredictionContext context)
public ATNConfig(ATNConfig c, ATNState state, PredictionContext context, SemanticContext semanticContext)
public final int getOuterContextDepth()
reachesIntoOuterContext
field
as it existed prior to the introduction of the
isPrecedenceFilterSuppressed()
method.public final boolean isPrecedenceFilterSuppressed()
public final void setPrecedenceFilterSuppressed(boolean value)
public boolean equals(Object o)
public boolean equals(ATNConfig other)
public String toString(Recognizer<?,?> recog, boolean showAlt)
Copyright © 1992-2015 ANTLR. All Rights Reserved.