tip.cfg.dfa
Class NullPointerAnalysis

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

public class NullPointerAnalysis
extends FlowAnalysis<EqualityMap<ALocalDecl,NullPointerAnalysis.Null>>


Nested Class Summary
static class NullPointerAnalysis.Null
           
static class NullPointerAnalysis.NullLattice
           
 
Constructor Summary
NullPointerAnalysis()
           
 
Method Summary
 boolean caseCAssignPtrStmPoint(AAssignPtrStm node, CAssignPtrStmPoint point)
          Default implementation.
 boolean caseCAssignVarStmPoint(AAssignVarStm node, CAssignVarStmPoint point)
          Default implementation.
 boolean caseCDeclStmPoint(ADeclStm node, CDeclStmPoint point)
          Default implementation.
 boolean caseEntryPoint(Node node, EntryPoint point)
          Default implementation.
 MapLattice<ALocalDecl,NullPointerAnalysis.Null> createLattice(ICFG cfg)
          The method must be implemented to provided a Lattice for the analysis of the control flow graph cfg.
 String getVariableString(EqualityMap<ALocalDecl,NullPointerAnalysis.Null> variable)
          Returns a textual representation of the variable variable.
 
Methods inherited from class tip.cfg.FlowAnalysis
defaultNode, end, getDependencySet, getLattice, getName, getVariable, getVariableStringForPoint, getVariableStringForPoint, setVariable, start
 
Methods inherited from class tip.cfg.CFGAnalysisAdapter
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
caseCBinopExpPoint, caseCBlockPoint, caseCDerefExpPoint, caseCFunctionCallExpPoint, caseCFunctionPtrCallExpPoint, caseCIfThenElseStmPoint, caseCIfThenStmPoint, caseCInputExpPoint, caseCIntConstExpPoint, caseCMallocExpPoint, caseCNullExpPoint, caseCOutputStmPoint, caseCPointerExpPoint, caseCReturnStmPoint, caseCVarExpPoint, caseCWhileStmPoint, caseExitPoint
 

Constructor Detail

NullPointerAnalysis

public NullPointerAnalysis()
Method Detail

createLattice

public MapLattice<ALocalDecl,NullPointerAnalysis.Null> createLattice(ICFG cfg)
Description copied from class: FlowAnalysis
The method must be implemented to provided a Lattice for the analysis of the control flow graph cfg.

Parameters:
cfg - the control flow graph on which the lattice is used
Returns:
the lattice to use on the control flow graph

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.

caseCAssignPtrStmPoint

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

Specified by:
caseCAssignPtrStmPoint in interface ICFGAnalysis
Overrides:
caseCAssignPtrStmPoint in class CFGAnalysisAdapter
Parameters:
node - the AAssignPtrStm associated with point
point - the CAssignPtrStmPoint 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,NullPointerAnalysis.Null> 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