public abstract class Transition
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
static int |
ACTION |
static int |
ATOM |
static int |
EPSILON |
static int |
NOT_SET |
static int |
PRECEDENCE |
static int |
PREDICATE |
static int |
RANGE |
static int |
RULE |
static java.util.List<java.lang.String> |
serializationNames |
static java.util.Map<java.lang.Class<? extends Transition>,java.lang.Integer> |
serializationTypes |
static int |
SET |
ATNState |
target
The target of this transition.
|
static int |
WILDCARD |
Modifier | Constructor and Description |
---|---|
protected |
Transition(ATNState target) |
Modifier and Type | Method and Description |
---|---|
abstract int |
getSerializationType() |
boolean |
isEpsilon()
Determines if the transition is an "epsilon" transition.
|
IntervalSet |
label() |
abstract boolean |
matches(int symbol,
int minVocabSymbol,
int maxVocabSymbol) |
public static final int EPSILON
public static final int RANGE
public static final int RULE
public static final int PREDICATE
public static final int ATOM
public static final int ACTION
public static final int SET
public static final int NOT_SET
public static final int WILDCARD
public static final int PRECEDENCE
public static final java.util.List<java.lang.String> serializationNames
public static final java.util.Map<java.lang.Class<? extends Transition>,java.lang.Integer> serializationTypes
public ATNState target
protected Transition(ATNState target)
public abstract int getSerializationType()
public boolean isEpsilon()
The default implementation returns false
.
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.public IntervalSet label()
public abstract boolean matches(int symbol, int minVocabSymbol, int maxVocabSymbol)