|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object LinkedNFA
Implementation of Thomson's algorithm to perform the operations of union, product and star on automata. The automata have the properties that there are at most two edges going out of a state, there is only one initial state, only one terminal state, no edge comes into the initial state, no edge goes out of the terminal state.
Constructor Summary | |
LinkedNFA()
Creates a one-state NFA recognizing epsilon. |
|
LinkedNFA(char a)
Implements BuildAutomaton(a). |
|
LinkedNFA(State i,
State t)
Implements NewAutomaton(i,t). |
Method Summary | |
static LinkedNFA |
automataProduct(LinkedNFA a,
LinkedNFA b)
Implements the function AutomataProduct(). |
static LinkedNFA |
automataUnion(LinkedNFA a,
LinkedNFA b)
Implements the function AutomataUnion(). |
static LinkedNFA |
automatonStar(LinkedNFA a)
Implements the function NFAStar(). |
static void |
main(java.lang.String[] args)
|
NFA |
toNFA(Alphabet alph)
Converts a LinkedNFA into an NFA. |
void |
toNFA(NFA a,
State p)
The recursive call to run toNFA . |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LinkedNFA()
public LinkedNFA(char a)
a
a
- a characterpublic LinkedNFA(State i, State t)
i
as initial state and t
as terminal state.
i
- initial statet
- terminal stateMethod Detail |
public static LinkedNFA automataUnion(LinkedNFA a, LinkedNFA b)
a
- a NFAb
- another NFA
a
and b
.public static LinkedNFA automataProduct(LinkedNFA a, LinkedNFA b)
a
- a NFAb
- another NFA
a
and b
.public static LinkedNFA automatonStar(LinkedNFA a)
a
- a NFA
a
.public java.lang.String toString()
public NFA toNFA(Alphabet alph)
alph
- the input alphabet
alpha
public void toNFA(NFA a, State p)
toNFA
.
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |