|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xrel.analyzer.PatAutomata
Contains the methods to build and show the automata associated to the patterns of the program.
To build the automata do the followings:
N.B.:
Fields inherited from interface xrel.parser.SymElementKind |
EXPRESSION, LABEL, PATTERN, S_EXPRESSIONS, S_LABELS, S_PATTERNS, S_TYPES, S_VARIABLES, TYPE, UNDEFINED, VARIABLE |
Constructor Summary | |
PatAutomata()
|
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 the automata associated to the patterns of the program. |
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 espilon (or null) transitions in all the automata associated to the patterns of the symbol table. |
static void |
rem_unreachable_Automata(SymTable st)
Removes the unreachable states from all the automata associated to the patterns of the symbol table. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PatAutomata()
Method Detail |
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. For each automaton it writes out the set of the states, the subsets of initial and final states and the transitions, both the normal and the espilon transitions. Additionally it shows a few statistics on it (number of states and number of transitions).
It simply calls the method dump on the tree automata associated to each pattern.
st
- the symbol tableout
- the place where to print outTA.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.TANormal.build()
,
TA.compute_closures()
public static void eps_elim_Automata(SymTable st)
Removes the espilon (or 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.
st
- the symbol tableTA.epsilon_elimination()
public static void rem_unreachable_Automata(SymTable st)
Removes the unreachable states from all the automata associated to the patterns of the symbol table. Unreachable states are states that are not reachable from the initial states.
It simply calls the method remove_unreachable_states() on each single automaton.
st
- the symbol tableTA.remove_unreachable_states()
public static void completeAutomata(SymTable st)
Final phase to build the automata associated to the patterns of the program. It makes coherent the data structures one each other, specifically for each state of an automaton it updates the set of transitions that exit from the state.
It simply calls the method completeAutomaton on each automaton.
st
- the symbol tableTA.completeAutomaton()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |