dk.brics.xact.analysis.dataflow
Interface AnalysisInterface<ElementType>

All Known Implementing Classes:
ReachingDefinitionsAnalysis, VariableAnalysis

public interface AnalysisInterface<ElementType>

Lattice and transfer functions for a dataflow analysis.


Method Summary
 Collection<Statement> getInitial(FlowGraph g)
          Returns the set of statements to start the analysis at.
 boolean isForward()
          Returns true if this is a forwards analysis, and false if it is a backwards analysis.
 boolean merge(ElementType source, VariableFilter filter, ElementType dest)
          Computes the least upper bound of two lattice elements.
 ElementType newBottomElement()
          Constructs a new lattice bottom element.
 boolean transfer(ElementType in, Statement s, ElementType out)
          Computes the lattice element resulting from flowing through the given statement.
 

Method Detail

getInitial

Collection<Statement> getInitial(FlowGraph g)
Returns the set of statements to start the analysis at. For forwards analyses, the graph's entry points are usually the correct return value.

Parameters:
g - the flow graph about to be analyzed
Returns:
an unmodifiable set of statements.

isForward

boolean isForward()
Returns true if this is a forwards analysis, and false if it is a backwards analysis.


merge

boolean merge(ElementType source,
              VariableFilter filter,
              ElementType dest)
Computes the least upper bound of two lattice elements.

Parameters:
source - the first element
filter - the filter to merge through
dest - the second element and destination for the result
Returns:
true if the new value of dest is changed

newBottomElement

ElementType newBottomElement()
Constructs a new lattice bottom element.


transfer

boolean transfer(ElementType in,
                 Statement s,
                 ElementType out)
Computes the lattice element resulting from flowing through the given statement.

Parameters:
in - the flow before the statement
out - destination for the result
Returns:
true if the new value of out is changed


Copyright © 2005-2011 Aarhus University.