tip.cfg
Class CFGAnswerAdapter<A>

java.lang.Object
  extended by tip.cfg.CFGAnswerAdapter<A>
Type Parameters:
A - the type of the answers
All Implemented Interfaces:
CFGAnswer<A>
Direct Known Subclasses:
SubExpressions

public class CFGAnswerAdapter<A>
extends Object
implements CFGAnswer<A>

CFGAnswerAdapter implements the default behaviour of the CFGAnswer interface. All calls return null by default.

Author:
Johnni Winther, jw@brics.dk

Constructor Summary
CFGAnswerAdapter()
           
 
Method Summary
 A caseCAssignPtrStmPoint(AAssignPtrStm node, CAssignPtrStmPoint point)
          Default implementation.
 A caseCAssignVarStmPoint(AAssignVarStm node, CAssignVarStmPoint point)
          Default implementation.
 A caseCBinopExpPoint(ABinopExp node, CBinopExpPoint point)
          Default implementation.
 A caseCBlockPoint(ABlock node, CBlockPoint point)
          Default implementation.
 A caseCDeclStmPoint(ADeclStm node, CDeclStmPoint point)
          Default implementation.
 A caseCDerefExpPoint(ADerefExp node, CDerefExpPoint point)
          Default implementation.
 A caseCFunctionCallExpPoint(AFunctionCallExp node, CFunctionCallExpPoint point)
          Default implementation.
 A caseCFunctionPtrCallExpPoint(AFunctionPtrCallExp node, CFunctionPtrCallExpPoint point)
          Default implementation.
 A caseCIfThenElseStmPoint(AIfThenElseStm node, CIfThenElseStmPoint point)
          Default implementation.
 A caseCIfThenStmPoint(AIfThenStm node, CIfThenStmPoint point)
          Default implementation.
 A caseCInputExpPoint(AInputExp node, CInputExpPoint point)
          Default implementation.
 A caseCIntConstExpPoint(AIntConstExp node, CIntConstExpPoint point)
          Default implementation.
 A caseCMallocExpPoint(AMallocExp node, CMallocExpPoint point)
          Default implementation.
 A caseCNullExpPoint(ANullExp node, CNullExpPoint point)
          Default implementation.
 A caseCOutputStmPoint(AOutputStm node, COutputStmPoint point)
          Default implementation.
 A caseCPointerExpPoint(APointerExp node, CPointerExpPoint point)
          Default implementation.
 A caseCReturnStmPoint(AReturnStm node, CReturnStmPoint point)
          Default implementation.
 A caseCVarExpPoint(AVarExp node, CVarExpPoint point)
          Default implementation.
 A caseCWhileStmPoint(AWhileStm node, CWhileStmPoint point)
          Default implementation.
 A caseEntryPoint(Node node, EntryPoint point)
          Default implementation.
 A caseExitPoint(Node node, ExitPoint point)
          Default implementation.
 A defaultNode(Node node, IProgramPoint point)
          Base implementation for all case-methods.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CFGAnswerAdapter

public CFGAnswerAdapter()
Method Detail

defaultNode

public A defaultNode(Node node,
                     IProgramPoint point)
Base implementation for all case-methods. Returns null.

Parameters:
node - the Node associated with point
point - the IProgramPoint calling the method
Returns:
the default answer for a Node and IProgramPoint

caseEntryPoint

public A caseEntryPoint(Node node,
                        EntryPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseEntryPoint in interface CFGAnswer<A>
Parameters:
node - the Node associated with point
point - the EntryPoint calling the method
Returns:
the answer for a Node and EntryPoint

caseExitPoint

public A caseExitPoint(Node node,
                       ExitPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseExitPoint in interface CFGAnswer<A>
Parameters:
node - the Node associated with point
point - the ExitPoint calling the method
Returns:
the answer for a Node and ExitPoint

caseCReturnStmPoint

public A caseCReturnStmPoint(AReturnStm node,
                             CReturnStmPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCReturnStmPoint in interface CFGAnswer<A>
Parameters:
node - the AReturnStm associated with point
point - the CReturnStmPoint calling the method
Returns:
the answer for a AReturnStm and CReturnStmPoint

caseCAssignPtrStmPoint

public A caseCAssignPtrStmPoint(AAssignPtrStm node,
                                CAssignPtrStmPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCAssignPtrStmPoint in interface CFGAnswer<A>
Parameters:
node - the AAssignPtrStm associated with point
point - the CAssignPtrStmPoint calling the method
Returns:
the answer for a AAssignPtrStm and CAssignPtrStmPoint

caseCBlockPoint

public A caseCBlockPoint(ABlock node,
                         CBlockPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCBlockPoint in interface CFGAnswer<A>
Parameters:
node - the ABlock associated with point
point - the CBlockPoint calling the method
Returns:
the answer for a ABlock and CBlockPoint

caseCVarExpPoint

public A caseCVarExpPoint(AVarExp node,
                          CVarExpPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCVarExpPoint in interface CFGAnswer<A>
Parameters:
node - the AVarExp associated with point
point - the CVarExpPoint calling the method
Returns:
the answer for a AVarExp and CVarExpPoint

caseCFunctionCallExpPoint

public A caseCFunctionCallExpPoint(AFunctionCallExp node,
                                   CFunctionCallExpPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCFunctionCallExpPoint in interface CFGAnswer<A>
Parameters:
node - the AFunctionCallExp associated with point
point - the CFunctionCallExpPoint calling the method
Returns:
the answer for a AFunctionCallExp and CFunctionCallExpPoint

caseCDerefExpPoint

public A caseCDerefExpPoint(ADerefExp node,
                            CDerefExpPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCDerefExpPoint in interface CFGAnswer<A>
Parameters:
node - the ADerefExp associated with point
point - the CDerefExpPoint calling the method
Returns:
the answer for a ADerefExp and CDerefExpPoint

caseCDeclStmPoint

public A caseCDeclStmPoint(ADeclStm node,
                           CDeclStmPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCDeclStmPoint in interface CFGAnswer<A>
Parameters:
node - the ADeclStm associated with point
point - the CDeclStmPoint calling the method
Returns:
the answer for a ADeclStm and CDeclStmPoint

caseCInputExpPoint

public A caseCInputExpPoint(AInputExp node,
                            CInputExpPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCInputExpPoint in interface CFGAnswer<A>
Parameters:
node - the AInputExp associated with point
point - the CInputExpPoint calling the method
Returns:
the answer for a AInputExp and CInputExpPoint

caseCMallocExpPoint

public A caseCMallocExpPoint(AMallocExp node,
                             CMallocExpPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCMallocExpPoint in interface CFGAnswer<A>
Parameters:
node - the AMallocExp associated with point
point - the CMallocExpPoint calling the method
Returns:
the answer for a AMallocExp and CMallocExpPoint

caseCIfThenStmPoint

public A caseCIfThenStmPoint(AIfThenStm node,
                             CIfThenStmPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCIfThenStmPoint in interface CFGAnswer<A>
Parameters:
node - the AIfThenStm associated with point
point - the CIfThenStmPoint calling the method
Returns:
the answer for a AIfThenStm and CIfThenStmPoint

caseCIntConstExpPoint

public A caseCIntConstExpPoint(AIntConstExp node,
                               CIntConstExpPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCIntConstExpPoint in interface CFGAnswer<A>
Parameters:
node - the AIntConstExp associated with point
point - the CIntConstExpPoint calling the method
Returns:
the answer for a AIntConstExp and CIntConstExpPoint

caseCFunctionPtrCallExpPoint

public A caseCFunctionPtrCallExpPoint(AFunctionPtrCallExp node,
                                      CFunctionPtrCallExpPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCFunctionPtrCallExpPoint in interface CFGAnswer<A>
Parameters:
node - the AFunctionPtrCallExp associated with point
point - the CFunctionPtrCallExpPoint calling the method
Returns:
the answer for a AFunctionPtrCallExp and CFunctionPtrCallExpPoint

caseCWhileStmPoint

public A caseCWhileStmPoint(AWhileStm node,
                            CWhileStmPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCWhileStmPoint in interface CFGAnswer<A>
Parameters:
node - the AWhileStm associated with point
point - the CWhileStmPoint calling the method
Returns:
the answer for a AWhileStm and CWhileStmPoint

caseCBinopExpPoint

public A caseCBinopExpPoint(ABinopExp node,
                            CBinopExpPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCBinopExpPoint in interface CFGAnswer<A>
Parameters:
node - the ABinopExp associated with point
point - the CBinopExpPoint calling the method
Returns:
the answer for a ABinopExp and CBinopExpPoint

caseCAssignVarStmPoint

public A caseCAssignVarStmPoint(AAssignVarStm node,
                                CAssignVarStmPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCAssignVarStmPoint in interface CFGAnswer<A>
Parameters:
node - the AAssignVarStm associated with point
point - the CAssignVarStmPoint calling the method
Returns:
the answer for a AAssignVarStm and CAssignVarStmPoint

caseCIfThenElseStmPoint

public A caseCIfThenElseStmPoint(AIfThenElseStm node,
                                 CIfThenElseStmPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCIfThenElseStmPoint in interface CFGAnswer<A>
Parameters:
node - the AIfThenElseStm associated with point
point - the CIfThenElseStmPoint calling the method
Returns:
the answer for a AIfThenElseStm and CIfThenElseStmPoint

caseCOutputStmPoint

public A caseCOutputStmPoint(AOutputStm node,
                             COutputStmPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCOutputStmPoint in interface CFGAnswer<A>
Parameters:
node - the AOutputStm associated with point
point - the COutputStmPoint calling the method
Returns:
the answer for a AOutputStm and COutputStmPoint

caseCPointerExpPoint

public A caseCPointerExpPoint(APointerExp node,
                              CPointerExpPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCPointerExpPoint in interface CFGAnswer<A>
Parameters:
node - the APointerExp associated with point
point - the CPointerExpPoint calling the method
Returns:
the answer for a APointerExp and CPointerExpPoint

caseCNullExpPoint

public A caseCNullExpPoint(ANullExp node,
                           CNullExpPoint point)
Default implementation. Calls defaultNode(Node,IProgramPoint).

Specified by:
caseCNullExpPoint in interface CFGAnswer<A>
Parameters:
node - the ANullExp associated with point
point - the CNullExpPoint calling the method
Returns:
the answer for a ANullExp and CNullExpPoint