xrel.analyzer
Class TANormal
java.lang.Object
|
+--xrel.analyzer.TA
|
+--xrel.analyzer.TANormal
- All Implemented Interfaces:
- SpecialNames, TABuildPhase
- public class TANormal
- extends TA
- implements SpecialNames
Tree automata built from this class are based upon a pattern of the
program. They're normal opposed to more exotic automata like
difference, product and subset automata.
- Author:
- Fabrizio Bisi
Fields inherited from class xrel.analyzer.TA |
debug, epsilonTransitions, finalStates, initialStates, isBuilt, name, out, states, subAutomata, symtab, transitions |
Fields inherited from interface xrel.parser.SpecialNames |
AnyTagName, AnyTypeName, AutomatonPrefix, EmptyPatternName, ExportTypeName, ExpressionPrefix, PatternPrefix, SpecialPrefix, StringName, StringPatternName, StringTypeName, StrLiteralPrefix, StrLiteralSuffix, StrUnquotedPrefix, StrUnquotedSuffix |
Methods inherited from class xrel.analyzer.TA |
addEpsTransition, addEpsTransitions, addEpsTransitions, addEpsTransitions, addState, addTrans, completeAutomaton, compute_closures, dump, epsilon_elimination, equals, getName, getSubAutomata, hashCode, isNull, merge, remove_unmatched, remove_unreachable_states, union, update |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
TANormal
public TANormal(java.lang.String nm,
SymTable st,
boolean dbg,
java.io.PrintStream psOut,
SymElement el)
updateSubAutomata
protected void updateSubAutomata()
- Overrides:
updateSubAutomata
in class TA
build
public void build()
- Builds the automaton for a pattern.
- Overrides:
build
in class TA
- Parameters:
el
- the symbol element of the pattern.
matchTree
public boolean matchTree(SimpleNode value)
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.
- Overrides:
matchTree
in class TA
- Parameters:
value
- the value to accept- Returns:
- true if the value matches against the automaton
- See Also:
TA.matchTree(xrel.parser.SimpleNode)