public 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 |
|---|---|
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 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