xrel.analyzer
Class TASimple

java.lang.Object
  |
  +--xrel.analyzer.TA
        |
        +--xrel.analyzer.TASimple
All Implemented Interfaces:
java.lang.Cloneable, SpecialNames, TABuildPhase

public class TASimple
extends TA
implements SpecialNames

Tree automata built from this class are either based upon an element of the symbol table of the program (that can be a pattern, a type, a variable or an expression) or the union of a set of these elements. The name distingush them from more exotic automata like product and difference automata.

Author:
Fabrizio Bisi

Fields inherited from class xrel.analyzer.TA
debug, epsilonTransitions, finalStates, initialStates, isBuilt, name, out, states, symtab, transitions
 
Fields inherited from interface xrel.parser.SpecialNames
AnyTagName, AnyTypeName, AutomatonPrefix, EmptyPatternName, ExportTypeName, ExpressionPrefix, PatternPrefix, SpecialPrefix, StringName, StringPatternName, StringTypeName, StrLiteralPrefix, StrLiteralSuffix, StrUnquotedPrefix, StrUnquotedSuffix
 
Fields inherited from interface xrel.analyzer.TABuildPhase
ALL_IN_ONE, DO_NOTHING, FULL_BUILD, SIMPLE_BUILD, STEP_BUILD, STEP_COMPLETE_AUT, STEP_NO_EPS_TRANS, STEP_NO_UNMATCHED_STATES, STEP_NO_UNREACH_STATES
 
Constructor Summary
TASimple(java.lang.String nm, SymTable st, boolean dbg, java.io.PrintStream psOut, SymElement el)
           
 
Method Summary
 void build()
          Builds the automaton for a symbol table element.
 boolean matchTree(SimpleNode value, boolean runtimeDebug)
          This function checks if the automaton accepts a given value.
 
Methods inherited from class xrel.analyzer.TA
addEpsTransition, addEpsTransitions, addEpsTransitions, addEpsTransitions, addState, addTrans, clone, completeAutomaton, compute_closures, dump, epsilon_elimination, equals, force, getChildAutomata, getDescendantAutomata, getName, hashCode, isNull, merge, remove_unmatched, remove_unreachable_states, setDebug, simplify, toString, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TASimple

public TASimple(java.lang.String nm,
                SymTable st,
                boolean dbg,
                java.io.PrintStream psOut,
                SymElement el)
Method Detail

build

public void build()
Builds the automaton for a symbol table element.
Overrides:
build in class TA
Parameters:
el - the symbol element of the pattern.

matchTree

public boolean matchTree(SimpleNode value,
                         boolean runtimeDebug)

This function checks if the automaton accepts a given value.

Algorithm:

matchTree fa solo il livello alto: confronta ogni stato iniziale dell'automa col primo tag del valore, chiamando la matchSequence. La matchSequence chiama se stessa ricorsivamente per andare avanti.

Parameters:
value - the value to accept
the - debug status for the automaton
Returns:
true if the value matches against the automaton