Package org.openzen.zenscript.lexer
Class DFA.DFAState<T>
java.lang.Object
org.openzen.zenscript.lexer.DFA.DFAState<T>
Represents a state in a DFA.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTransition(int label, DFA.DFAState<T> next) Adds a transition.getFinal()Gets the final class of this state.voidSets the final class of this state.
-
Constructor Details
-
DFAState
public DFAState()Creates a new DFA state.
-
-
Method Details
-
addTransition
Adds a transition.- Parameters:
label- transition edge labelnext- next state
-
getFinal
Gets the final class of this state. Equals NOFINAL if this state is not a final.- Returns:
- final index
-
setFinal
Sets the final class of this state. Finals can be divided in multiple class, in which case each class gets its own index. Class NOFINAL is used to indicate nonfinals.- Parameters:
finalCode- final index
-