Class DFA<T>

java.lang.Object
org.openzen.zenscript.lexer.DFA<T>
Type Parameters:
T - final type

public class DFA<T> extends Object
Implements a DFA. Used as intermediate form when compiling an NFA to a CompiledDFA for usage in a TokenStream.
  • Field Details

  • Constructor Details

    • DFA

      public DFA(Class<T> tokenClass, DFA.DFAState<T> initial)
      Constructs a new DFA with the specified initial state.
      Parameters:
      initial - initial state
      tokenClass - token class
  • Method Details

    • compile

      public CompiledDFA<T> compile()
      Compiles this DFA into a more efficient structure.
      Returns:
      the compiled DFA
    • optimize

      public DFA<T> optimize()
      Generates the minimal version of this DFA.
      Returns:
      the minimal DFA
    • toString

      public String toString()
      Overrides:
      toString in class Object