Package org.antlr.v4.runtime.atn
Class Transition
java.lang.Object
org.antlr.v4.runtime.atn.Transition
- Direct Known Subclasses:
AbstractPredicateTransition
,ActionTransition
,AtomTransition
,EpsilonTransition
,RangeTransition
,RuleTransition
,SetTransition
,WildcardTransition
An ATN transition between any two ATN states. Subclasses define
atom, set, epsilon, action, predicate, rule transitions.
This is a one way link. It emanates from a state (usually via a list of transitions) and has a target state.
Since we never have to change the ATN transitions once we construct it, we can fix these transitions as specific classes. The DFA transitions on the other hand need to update the labels as it adds transitions to the states. We'll use the term Edge for the DFA to distinguish them from ATN transitions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final Map
<Class<? extends Transition>, Integer> static final int
The target of this transition.static final int
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
EPSILON
public static final int EPSILON- See Also:
-
RANGE
public static final int RANGE- See Also:
-
RULE
public static final int RULE- See Also:
-
PREDICATE
public static final int PREDICATE- See Also:
-
ATOM
public static final int ATOM- See Also:
-
ACTION
public static final int ACTION- See Also:
-
SET
public static final int SET- See Also:
-
NOT_SET
public static final int NOT_SET- See Also:
-
WILDCARD
public static final int WILDCARD- See Also:
-
PRECEDENCE
public static final int PRECEDENCE- See Also:
-
serializationNames
-
serializationTypes
-
target
The target of this transition.
-
-
Constructor Details
-
Transition
-
-
Method Details
-
getSerializationType
public abstract int getSerializationType() -
isEpsilon
public boolean isEpsilon()Determines if the transition is an "epsilon" transition.The default implementation returns
false
.- Returns:
true
if traversing this transition in the ATN does not consume an input symbol; otherwise,false
if traversing this transition consumes (matches) an input symbol.
-
label
-
matches
public abstract boolean matches(int symbol, int minVocabSymbol, int maxVocabSymbol)
-