|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttip.cfg.CFGAnalysisAdapter
tip.cfg.FlowAnalysis<VariableType>
VariableType
- the type of the variables associated with the program pointspublic abstract class FlowAnalysis<VariableType>
FlowAnalysis
implements the basic structure for a flow analysis
implementing the FixedPointAnalysis
interface. To implement a flow
analysis, the following must be provided:
DependencyStrategy
must be provided to the constructor,
determining the direction of dependency in the analysis.createLattice(ICFG)
must be implemented to provide the
analysis with a Lattice
for the current control flow graph.FixedPointAnalysis.getVariableString(Object)
must be
implemented to provide a textual representation of the variables.case
-methods of ICFGAnalysis
must be
implemented for the types of IProgramPoint
s for which the variable is
not a simple join (see join(IProgramPoint)
. The
defaultNode(Node,IProgramPoint)
method has been
implemented to provide default for propagation of variables.
Method Summary | |
---|---|
boolean |
defaultNode(Node node,
IProgramPoint point)
Default implementation for program points: The variable for point
is updated to be the join of the points in its dependency set. |
void |
end(ICFG cfg)
end is called after the fixed point analysis of the control flow
graph cfg has ended. |
Set<IProgramPoint> |
getDependencySet(IProgramPoint point)
Returns the set of IProgramPoint s that depend upon point . |
Lattice<VariableType> |
getLattice()
Returns the Lattice used an analysis in progress. |
String |
getName()
Returns the name of the analysis. |
VariableType |
getVariable(IProgramPoint point)
Returns the (current) variable associated the point . |
String |
getVariableStringForPoint(IProgramPoint point)
Returns a textual representation of the variable for point . |
String |
getVariableStringForPoint(IProgramPoint point,
int distance)
Returns a textual representation of the variable for point only
included information relevant for points in the distance vicinity
of point . |
boolean |
setVariable(IProgramPoint point,
VariableType newVariable)
Sets newVariable as the variable for point . |
void |
start(ICFG cfg)
start is called before the fixed point analysis of the control
flow graph cfg is started. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface tip.cfg.FixedPointAnalysis |
---|
getVariableString |
Method Detail |
---|
public String getName()
getName
in interface FixedPointAnalysis<VariableType>
public Lattice<VariableType> getLattice()
Lattice
used an analysis in progress. If no analysis
is in progress null
is returned.
Lattice
used an analysis in progresspublic void start(ICFG cfg)
start
is called before the fixed point analysis of the control
flow graph cfg
is started. createLattice(ICFG)
is called
to initial the lattice for the control flow graph cfg
.
start
in interface FixedPointAnalysis<VariableType>
cfg
- the control flow graph on which the analysis is madepublic void end(ICFG cfg)
end
is called after the fixed point analysis of the control flow
graph cfg
has ended. This resets the lattice information.
end
in interface FixedPointAnalysis<VariableType>
cfg
- the control flow graph on which the analysis has been madepublic VariableType getVariable(IProgramPoint point)
point
.
getVariable
in interface FixedPointAnalysis<VariableType>
point
- the IProgramPoint
for which the variable is returned
point
public boolean setVariable(IProgramPoint point, VariableType newVariable)
newVariable
as the variable for point
. The method
returns true
if the new variable was not equal to the existing
variable, thus the analysis has not reached a fixedpoint.
point
- the program point to which the variable is associatednewVariable
- the new variable for the program point
true
if the variable of the program point was changedpublic Set<IProgramPoint> getDependencySet(IProgramPoint point)
IProgramPoint
s that depend upon point
.
getDependencySet
in interface FixedPointAnalysis<VariableType>
point
- the IProgramPoint
for which the dependency set is
returned
IProgramPoint
s that depend upon point
public boolean defaultNode(Node node, IProgramPoint point)
point
is updated to be the join of the points in its dependency set.
defaultNode
in class CFGAnalysisAdapter
node
- the node associated with point
point
- the handled point
true
is the variable chanedjoin(IProgramPoint)
public String getVariableStringForPoint(IProgramPoint point)
point
.
getVariableStringForPoint
in interface FixedPointAnalysis<VariableType>
point
- the point for which the variable string is returned
point
public String getVariableStringForPoint(IProgramPoint point, int distance)
point
only
included information relevant for points in the distance
vicinity
of point
.
getVariableStringForPoint
in interface FixedPointAnalysis<VariableType>
point
- the point for which the variable string is returneddistance
- the vicinity distance taken into account
point
IProgramPoint.getVicinity(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |