public final class NFA
extends java.lang.Object
Constructor and Description |
---|
NFA(int numInput,
int estSize) |
NFA(int numInput,
LexScan scanner,
RegExps regExps,
Macros macros,
CharClasses classes)
Construct new NFA.
|
Modifier and Type | Method and Description |
---|---|
void |
addEpsilonTransition(int start,
int dest) |
void |
addRegExp(int regExpNum)
Add a regexp to this NFA.
|
void |
addStandaloneRule()
Add a standalone rule that has minimum priority, fires a transition
on all single input characters and has a "print yytext" action.
|
void |
addTransition(int start,
int input,
int dest) |
java.lang.String |
dotFormat() |
void |
dumpTable() |
DFA |
getDFA()
Returns an DFA that accepts the same language as this NFA.
|
JFlex.IntPair |
insertNFA(RegExp regExp)
Constructs an NFA for regExp such that the NFA has
exactly one start state,
exactly one end state,
no transitions leading out of the end state
no transitions leading into the start state
|
int |
numEntryStates() |
java.lang.String |
toString() |
void |
writeDot(java.io.File file) |
public NFA(int numInput, int estSize)
public NFA(int numInput, LexScan scanner, RegExps regExps, Macros macros, CharClasses classes)
RegExps.checkLookAheads()
public int numEntryStates()
public void addStandaloneRule()
public void addRegExp(int regExpNum)
regExpNum
- the number of the regexp to add.public void addTransition(int start, int input, int dest)
public void addEpsilonTransition(int start, int dest)
public DFA getDFA()
public void dumpTable()
public java.lang.String toString()
toString
in class java.lang.Object
public void writeDot(java.io.File file)
public java.lang.String dotFormat()
public JFlex.IntPair insertNFA(RegExp regExp)
regExp
- the regular expression to construct the
NFA for