|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xrel.matcher.PatternMatching
Starts the main algorithm for the pattern matching.
N.B.: this is a static class so you will never need to allocate an object for this class.
Field Summary | |
static int |
matchingClause
A return value: it says what clause it matches. |
Fields inherited from interface xrel.parser.SymElementKind |
LABEL, PATTERN, S_LABELS, S_PATTERNS, S_TYPES, S_VALUES, S_VARIABLES, TYPE, UNDEFINED, VALUE, VARIABLE |
Constructor Summary | |
PatternMatching()
|
Method Summary | |
static void |
buildAutomata(SymTable st)
Builds the automaton for every pattern in the symbol table. |
static void |
completeAutomata(SymTable st)
Final phase to build automata. |
static void |
dumpAutomata(SymTable st,
java.io.PrintStream out)
Writes the internal structure of the automata associated to the patterns of the symbol table. |
static void |
eps_elim_Automata(SymTable st)
Removes the null transitions in all the automata associated to the patterns of the symbol table. |
static boolean |
matchWith(SimpleNode value,
boolean debug)
The main method of this class. |
static void |
rem_useless_Automata(SymTable st)
Removes the useless states from all the automata associated to the patterns of the symbol table. |
static void |
setSymbolTable(SymTable st)
Assigns the symbol table. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int matchingClause
Constructor Detail |
public PatternMatching()
Method Detail |
public static boolean matchWith(SimpleNode value, boolean debug)
value
- the value to check. The patterns are passed throughout
the symbol table.public static void dumpAutomata(SymTable st, java.io.PrintStream out)
Writes the internal structure of the automata associated to the patterns of the symbol table.
It simply calls the method dump on the tree automata associated to each pattern.
st
- the symbol tableout
- the place where to print outxrel.matcher.TreeAutomaton#dump(PrintStream out)
public static void buildAutomata(SymTable st)
Builds the automaton for every pattern in the symbol table.
For each pattern it first calls the method build() and then it computes the epsilon closures calling the method compute_closures().
N.B.: to build all the automata do the followings:
st
- the symbol table.xrel.matcher.TreeAutomaton#build(SymElement el)
,
xrel.matcher.TreeAutomaton#compute_closures()
public static void eps_elim_Automata(SymTable st)
Removes the null transitions in all the automata associated to the patterns of the symbol table. It simply calls the method epsilon_elimination() on each single automaton.
N.B.: to build all the automata do the followings:
st
- the symbol tablexrel.matcher.TreeAutomaton#epsilon_elimination()
public static void rem_useless_Automata(SymTable st)
Removes the useless states from all the automata associated to the patterns of the symbol table. It simply calls the method remove_useless_states() on each single automaton.
N.B.: to build all the automata do the followings:
st
- the symbol tablexrel.matcher.TreeAutomaton#remove_useless_states()
public static void completeAutomata(SymTable st)
Final phase to build automata.
It simply calls the method setStateTransitions on each automaton.
st
- the symbol tableout
- the place where to print outxrel.matcher.TreeAutomaton#dump(PrintStream out)
public static void setSymbolTable(SymTable st)
st
- the symbol table pointer.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |