tip.cfg.cfa
Class Andersen

java.lang.Object
  extended by tip.analysis.AnalysisAdapter
      extended by tip.analysis.DepthFirstAdapter
          extended by tip.cfg.cfa.Andersen
All Implemented Interfaces:
Analysis, PointsToMap

public class Andersen
extends DepthFirstAdapter
implements PointsToMap

Andersen is an implemention of Andersen's algorithm for computing points-to maps.

Author:
Johnni Winther, jw@brics.dk

Constructor Summary
Andersen()
           
 
Method Summary
 String getName()
          Returns the name of this points-to map.
 void inAFuncDecl(AFuncDecl node)
          Called by DepthFirstAdapter.caseAFuncDecl(AFuncDecl) before traversing the children of AFuncDecl.
 void inAProgram(AProgram node)
          Called by DepthFirstAdapter.caseAProgram(AProgram) before traversing the children of AProgram.
 void inAAssignPtrStm(AAssignPtrStm node)
          Called by DepthFirstAdapter.caseAAssignPtrStm(AAssignPtrStm) before traversing the children of AAssignPtrStm.
 void inAAssignVarStm(AAssignVarStm node)
          Called by DepthFirstAdapter.caseAAssignVarStm(AAssignVarStm) before traversing the children of AAssignVarStm.
 boolean isFlowSensitive()
           
 void outAProgram(AProgram node)
          Called by DepthFirstAdapter.caseAProgram(AProgram) after traversing the children of AProgram.
 Map<Target,Set<Target>> pt(IProgramPoint point)
           
 Set<Target> pt(IProgramPoint point, ALocalDecl decl)
          Returns the pointer targets for the variable decl at the program point point as computed by Andersen's algorithm.
 
Methods inherited from class tip.analysis.DepthFirstAdapter
caseABinopExp, caseABlock, caseABlockStm, caseABody, caseADeclStm, caseADerefExp, caseADivideBinop, caseAEqBinop, caseAFuncDecl, caseAFunctionCallExp, caseAFunctionPtrCallExp, caseAGtBinop, caseAIfThenElseStm, caseAIfThenStm, caseAInputExp, caseAIntConstExp, caseALocalDecl, caseAMallocExp, caseAMinusBinop, caseANullExp, caseAOutputStm, caseAPlusBinop, caseAPointerExp, caseAProgram, caseAReturnStm, caseATimesBinop, caseAVarExp, caseAWhileStm, caseStart, caseAAssignPtrStm, caseAAssignVarStm, defaultIn, defaultInPBinop, defaultInPBlock, defaultInPBody, defaultInPDecl, defaultInPExp, defaultInPProgram, defaultInPStm, defaultOut, defaultOutPBinop, defaultOutPBlock, defaultOutPBody, defaultOutPDecl, defaultOutPExp, defaultOutPProgram, defaultOutPStm, defaultPBinop, defaultPBlock, defaultPBody, defaultPDecl, defaultPExp, defaultPProgram, defaultPStm, inABinopExp, inABlock, inABlockStm, inABody, inADeclStm, inADerefExp, inADivideBinop, inAEqBinop, inAFunctionCallExp, inAFunctionPtrCallExp, inAGtBinop, inAIfThenElseStm, inAIfThenStm, inAInputExp, inAIntConstExp, inALocalDecl, inAMallocExp, inAMinusBinop, inANullExp, inAOutputStm, inAPlusBinop, inAPointerExp, inAReturnStm, inATimesBinop, inAVarExp, inAWhileStm, inStart, outABinopExp, outABlock, outABlockStm, outABody, outADeclStm, outADerefExp, outADivideBinop, outAEqBinop, outAFuncDecl, outAFunctionCallExp, outAFunctionPtrCallExp, outAGtBinop, outAIfThenElseStm, outAIfThenStm, outAInputExp, outAIntConstExp, outALocalDecl, outAMallocExp, outAMinusBinop, outANullExp, outAOutputStm, outAPlusBinop, outAPointerExp, outAReturnStm, outATimesBinop, outAVarExp, outAWhileStm, outStart, outAAssignPtrStm, outAAssignVarStm
 
Methods inherited from class tip.analysis.AnalysisAdapter
caseEOF, caseTAnd, caseTAssign, caseTComma, caseTCommentBlock, caseTCommentSingle, caseTDiv, caseTElse, caseTEq, caseTGt, caseTIdentifier, caseTIf, caseTInput, caseTIntegerConst, caseTLBrace, caseTLPar, caseTMalloc, caseTMinus, caseTNull, caseTOutput, caseTPlus, caseTRBrace, caseTReturn, caseTRPar, caseTSemicolon, caseTStar, caseTVar, caseTWhile, caseTWhiteSpace, defaultNode, defaultToken, getIn, getOut, setIn, setOut
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Andersen

public Andersen()
Method Detail

inAProgram

public void inAProgram(AProgram node)
Description copied from class: DepthFirstAdapter
Called by DepthFirstAdapter.caseAProgram(AProgram) before traversing the children of AProgram.

Overrides:
inAProgram in class DepthFirstAdapter
Parameters:
node - the visited AProgram node

outAProgram

public void outAProgram(AProgram node)
Description copied from class: DepthFirstAdapter
Called by DepthFirstAdapter.caseAProgram(AProgram) after traversing the children of AProgram.

Overrides:
outAProgram in class DepthFirstAdapter
Parameters:
node - the visited AProgram node

inAAssignVarStm

public void inAAssignVarStm(AAssignVarStm node)
Description copied from class: DepthFirstAdapter
Called by DepthFirstAdapter.caseAAssignVarStm(AAssignVarStm) before traversing the children of AAssignVarStm.

Overrides:
inAAssignVarStm in class DepthFirstAdapter
Parameters:
node - the visited AAssignVarStm node

inAAssignPtrStm

public void inAAssignPtrStm(AAssignPtrStm node)
Description copied from class: DepthFirstAdapter
Called by DepthFirstAdapter.caseAAssignPtrStm(AAssignPtrStm) before traversing the children of AAssignPtrStm.

Overrides:
inAAssignPtrStm in class DepthFirstAdapter
Parameters:
node - the visited AAssignPtrStm node

inAFuncDecl

public void inAFuncDecl(AFuncDecl node)
Description copied from class: DepthFirstAdapter
Called by DepthFirstAdapter.caseAFuncDecl(AFuncDecl) before traversing the children of AFuncDecl.

Overrides:
inAFuncDecl in class DepthFirstAdapter
Parameters:
node - the visited AFuncDecl node

getName

public String getName()
Returns the name of this points-to map.

Specified by:
getName in interface PointsToMap
Returns:
the name of this points-to map

pt

public Set<Target> pt(IProgramPoint point,
                      ALocalDecl decl)
Returns the pointer targets for the variable decl at the program point point as computed by Andersen's algorithm.

Specified by:
pt in interface PointsToMap
Parameters:
point - the program point for which the pointer targets are returned
decl - the variable for which the pointer targets are returned
Returns:
the pointer target for the decl at point

isFlowSensitive

public boolean isFlowSensitive()
Specified by:
isFlowSensitive in interface PointsToMap

pt

public Map<Target,Set<Target>> pt(IProgramPoint point)
Specified by:
pt in interface PointsToMap