|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectThompsonCompiler
Compiles a rational expression into an automaton of the
class NFA
by Thompson's algorithm. Uses a top-down analysis for the grammar
E -> E+T | T ,
T -> TF | F ,
F -> G | G* ,
G -> (E) | char .
| Constructor Summary | |
ThompsonCompiler()
|
|
| Method Summary | |
void |
advance()
Implements the function Advance() of Section 1.6.1.
|
char |
current()
Implements the function Current() of Section 1.6.1.
|
LinkedNFA |
evalExp()
Implements the function EvalExp() of Section 1.6.1.
|
LinkedNFA |
evalFact()
Implements the function EvalFact() of Section 1.6.1. |
LinkedNFA |
evalTerm()
Implements the function EvalTerm() of Section 1.6.1. |
LinkedNFA |
toLinkedNFA()
|
NFA |
toNFA(java.lang.String s)
Compiles the expression into a nondeterministic finite automaton. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ThompsonCompiler()
| Method Detail |
public char current()
Current() of Section 1.6.1.
Returns the current character
of the input expression.
public void advance()
Advance() of Section 1.6.1.
Advances to the next character in the
input expression.
public LinkedNFA evalExp()
EvalExp() of Section 1.6.1.
Returns a LinkedNFA recognizing the
expression.
public LinkedNFA evalTerm()
EvalTerm() of Section 1.6.1.
public LinkedNFA evalFact()
EvalFact() of Section 1.6.1.
public LinkedNFA toLinkedNFA()
public NFA toNFA(java.lang.String s)
LinkedNFA and then converts it
into an NFA.
toNFA in interface ExpressionCompiler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||