T - final typepublic class CompiledDFA<T>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
T[] |
finals |
static int |
NOFINAL |
gnu.trove.map.hash.TIntIntHashMap[] |
transitions |
| Constructor and Description |
|---|
CompiledDFA(gnu.trove.map.hash.TIntIntHashMap[] transitions,
T[] finals)
Constructs a compiled DFA from the specified transition graph and finals
arrays.
|
| Modifier and Type | Method and Description |
|---|---|
static <T extends TokenType & java.lang.Comparable<T>> |
createLexerDFA(T[] tokenTypes) |
T |
eval(java.lang.String value)
Determines the token type for the given token.
|
boolean |
matches(java.lang.String value)
Checks if this value evaluates to a valid token.
|
java.lang.String |
toString() |
public static final int NOFINAL
public gnu.trove.map.hash.TIntIntHashMap[] transitions
public T[] finals
public CompiledDFA(gnu.trove.map.hash.TIntIntHashMap[] transitions,
T[] finals)
transitions - transitions graphfinals - finalspublic static <T extends TokenType & java.lang.Comparable<T>> CompiledDFA<T> createLexerDFA(T[] tokenTypes)
public T eval(java.lang.String value)
value - token valuepublic boolean matches(java.lang.String value)
value - value to checkpublic java.lang.String toString()
toString in class java.lang.Object