dk.brics.xact.analysis.xmlgraph
Class BackwardsXGAnalyzer<T>

java.lang.Object
  extended by dk.brics.xact.analysis.xmlgraph.BackwardsXGAnalyzer<T>
Type Parameters:
T - lattice type. Requires a working Object.equals(Object).
Direct Known Subclasses:
Emptiness

public abstract class BackwardsXGAnalyzer<T>
extends Object

Base class for performing backwards dataflow analysis on XML graphs. Subclasses should call doAnalysis() when the analysis should be performed, which by convention should be at the end of its constructor.

Only reachable nodes are analyzed – requesting the lattice point for an unreachable node will always return null.


Constructor Summary
BackwardsXGAnalyzer(XMLGraph xg)
           
 
Method Summary
protected abstract  T bottom()
          Returns BOTTOM element.
protected  void doAnalysis()
           
 T get(int index)
          Returns the lattice data associated with the given node; or null if the node is unreachable.
 T get(Node node)
          Returns the lattice data associated with the given node; or null if the node is unreachable.
protected abstract  T initial(Node node)
          Returns initial value for the specified node.
protected abstract  T transfer(Node node, T currentValue)
          Transfer function for the specified node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackwardsXGAnalyzer

public BackwardsXGAnalyzer(XMLGraph xg)
Method Detail

bottom

protected abstract T bottom()
Returns BOTTOM element.


doAnalysis

protected void doAnalysis()

get

public T get(int index)
Returns the lattice data associated with the given node; or null if the node is unreachable.

Parameters:
index - index of a node
Returns:
a lattice point

get

public T get(Node node)
Returns the lattice data associated with the given node; or null if the node is unreachable.

Parameters:
node - a node
Returns:
a lattice point

initial

protected abstract T initial(Node node)
Returns initial value for the specified node. If node has BOTTOM as initial value, return null instead.


transfer

protected abstract T transfer(Node node,
                              T currentValue)
Transfer function for the specified node. The node should only read lattice data from its children and itself.

Parameters:
node - in the XML graph to analyze
currentValue - current lattice point for the node. Should not be modified.
Returns:
a new instance of a lattice element


Copyright © 2005-2011 Aarhus University.