public static final class DFA.State extends Object
NFA States of the form NFA.Event.onChars(int)
are accounted for in others
, and are indexed
by the corresponding character set index. Besides,
there can be at most one state of the form
NFA.Event.toAction(int)
, i.e. a final state, in
which case the DFA state is final itself. If there were
more than one final state, there would be ambiguity
as to what action should be performed when accepting
the input.
Modifier and Type | Field and Description |
---|---|
static DFA.State |
EMPTY
The empty state
|
int |
finalAction
Describes the semantic action associated
to this state, if final, or
DFA.NO_ACTION
if the state is not final |
@Nullable DFA.MemMap |
finisher
The memory map associated to the final action
or
null if the state isn't final |
Map<Integer,DFA.MemMap> |
others
Maps character sets indices to memory maps.
|
Modifier and Type | Method and Description |
---|---|
Map<TRegular.TagInfo,Integer> |
getFinalLocs() |
Map<TRegular.TagInfo,Integer> |
getLocsFor(NFA.Event event) |
boolean |
isEmpty()
Whether the DFA state is empty
|
boolean |
isFinal()
Whether the DFA state is final
|
String |
toString() |
DFA.State |
withLocs(int n,
DFA.MemMap newMmap) |
public final int finalAction
DFA.NO_ACTION
if the state is not finalpublic final @Nullable DFA.MemMap finisher
null
if the state isn't finalpublic final Map<Integer,DFA.MemMap> others
public static final DFA.State EMPTY
public boolean isEmpty()
public boolean isFinal()
public Map<TRegular.TagInfo,Integer> getFinalLocs()
public Map<TRegular.TagInfo,Integer> getLocsFor(NFA.Event event)
event
- IllegalArgumentException
- if the given state is not
part of this DFA state (in particular, if it is a different
final action that the one specified in the DFA state)public DFA.State withLocs(int n, DFA.MemMap newMmap)
n
- newMmap
- n
is mapped to newMap