tip.cfg.dfa
Class ConstantPropagationAnalysis

java.lang.Object
  extended by tip.cfg.CFGAnalysisAdapter
      extended by tip.cfg.FlowAnalysis<EqualityMap<ALocalDecl,ConstantPropagationAnalysis.Const>>
          extended by tip.cfg.dfa.ConstantPropagationAnalysis
All Implemented Interfaces:
FixedPointAnalysis<EqualityMap<ALocalDecl,ConstantPropagationAnalysis.Const>>, ICFGAnalysis

public class ConstantPropagationAnalysis
extends FlowAnalysis<EqualityMap<ALocalDecl,ConstantPropagationAnalysis.Const>>


Nested Class Summary
static class ConstantPropagationAnalysis.Const
           
static class ConstantPropagationAnalysis.ConstLattice
           
static class ConstantPropagationAnalysis.Evaluator
           
static class ConstantPropagationAnalysis.Type
           
 
Constructor Summary
ConstantPropagationAnalysis()
           
 
Method Summary
 boolean caseCAssignVarStmPoint(AAssignVarStm node, CAssignVarStmPoint point)
          Default implementation.
 boolean caseCDeclStmPoint(ADeclStm node, CDeclStmPoint point)
          Default implementation.
 boolean caseEntryPoint(Node node, EntryPoint point)
          Default implementation.
 String getVariableString(EqualityMap<ALocalDecl,ConstantPropagationAnalysis.Const> variable)
          Returns a textual representation of the variable variable.
 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.
 
Methods inherited from class tip.cfg.FlowAnalysis
defaultNode, end, getDependencySet, getLattice, getName, getVariable, getVariableStringForPoint, setVariable, start
 
Methods inherited from class tip.cfg.CFGAnalysisAdapter
caseCAssignPtrStmPoint, caseCBinopExpPoint, caseCBlockPoint, caseCDerefExpPoint, caseCFunctionCallExpPoint, caseCFunctionPtrCallExpPoint, caseCIfThenElseStmPoint, caseCIfThenStmPoint, caseCInputExpPoint, caseCIntConstExpPoint, caseCMallocExpPoint, caseCNullExpPoint, caseCOutputStmPoint, caseCPointerExpPoint, caseCReturnStmPoint, caseCVarExpPoint, caseCWhileStmPoint, caseExitPoint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface tip.cfg.ICFGAnalysis
caseCAssignPtrStmPoint, caseCBinopExpPoint, caseCBlockPoint, caseCDerefExpPoint, caseCFunctionCallExpPoint, caseCFunctionPtrCallExpPoint, caseCIfThenElseStmPoint, caseCIfThenStmPoint, caseCInputExpPoint, caseCIntConstExpPoint, caseCMallocExpPoint, caseCNullExpPoint, caseCOutputStmPoint, caseCPointerExpPoint, caseCReturnStmPoint, caseCVarExpPoint, caseCWhileStmPoint, caseExitPoint
 

Constructor Detail

ConstantPropagationAnalysis

public ConstantPropagationAnalysis()
Method Detail

caseCAssignVarStmPoint

public boolean caseCAssignVarStmPoint(AAssignVarStm node,
                                      CAssignVarStmPoint point)
Description copied from class: CFGAnalysisAdapter
Default implementation. Calls CFGAnalysisAdapter.defaultNode(Node,IProgramPoint).

Specified by:
caseCAssignVarStmPoint in interface ICFGAnalysis
Overrides:
caseCAssignVarStmPoint in class CFGAnalysisAdapter
Parameters:
node - the AAssignVarStm associated with point
point - the CAssignVarStmPoint calling the method
Returns:
true if the result of the analysis is changed.

caseCDeclStmPoint

public boolean caseCDeclStmPoint(ADeclStm node,
                                 CDeclStmPoint point)
Description copied from class: CFGAnalysisAdapter
Default implementation. Calls CFGAnalysisAdapter.defaultNode(Node,IProgramPoint).

Specified by:
caseCDeclStmPoint in interface ICFGAnalysis
Overrides:
caseCDeclStmPoint in class CFGAnalysisAdapter
Parameters:
node - the ADeclStm associated with point
point - the CDeclStmPoint calling the method
Returns:
true if the result of the analysis is changed.

caseEntryPoint

public boolean caseEntryPoint(Node node,
                              EntryPoint point)
Description copied from class: CFGAnalysisAdapter
Default implementation. Calls CFGAnalysisAdapter.defaultNode(Node,IProgramPoint).

Specified by:
caseEntryPoint in interface ICFGAnalysis
Overrides:
caseEntryPoint in class CFGAnalysisAdapter
Parameters:
node - the Node associated with point
point - the EntryPoint calling the method
Returns:
true if the result of the analysis is changed.

getVariableString

public String getVariableString(EqualityMap<ALocalDecl,ConstantPropagationAnalysis.Const> variable)
Description copied from interface: FixedPointAnalysis
Returns a textual representation of the variable variable.

Parameters:
variable - the variable for which a text representation is returned
Returns:
a textual representation of the variable variable

getVariableStringForPoint

public String getVariableStringForPoint(IProgramPoint point,
                                        int distance)
Description copied from class: FlowAnalysis
Returns a textual representation of the variable for point only included information relevant for points in the distance vicinity of point.

Specified by:
getVariableStringForPoint in interface FixedPointAnalysis<EqualityMap<ALocalDecl,ConstantPropagationAnalysis.Const>>
Overrides:
getVariableStringForPoint in class FlowAnalysis<EqualityMap<ALocalDecl,ConstantPropagationAnalysis.Const>>
Parameters:
point - the point for which the variable string is returned
distance - the vicinity distance taken into account
Returns:
a textual representation of the varaible for point
See Also:
IProgramPoint.getVicinity(int)