xrel.analyzer
Class ElementAutomata

java.lang.Object
  |
  +--xrel.analyzer.ElementAutomata
All Implemented Interfaces:
SymElementKind

public class ElementAutomata
extends java.lang.Object
implements SymElementKind

Contains the methods to build and show the automata associated to the elements of the symbol table (types, patterns, expressions).

To build the automata simply call buildAll(). To show the automata call dumpAutomata().

N.B.:

Author:
Fabrizio Bisi

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
ElementAutomata()
           
 
Method Summary
static void buildAll(SymTable st, boolean debug)
          Builds the automata associated to the elements of the symbol table.
static void dumpAutomata(SymTable st, java.io.PrintStream out)
          Writes the internal structure of the automata associated to the elements of the symbol table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementAutomata

public ElementAutomata()
Method Detail

dumpAutomata

public static void dumpAutomata(SymTable st,
                                java.io.PrintStream out)

Writes the internal structure of the automata associated to the elements 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) and a list of child automata.

It simply calls the method dump on the tree automata associated to each element.

Parameters:
st - the symbol table
out - the place where to print out
See Also:
TA.dump(PrintStream out)

buildAll

public static void buildAll(SymTable st,
                            boolean debug)

Builds the automata associated to the elements of the symbol table.

Note that each automaton has epsilon transition and unreachable states removed.

Parameters:
st - the symbol table.
debug - required debug info