tip.cfg
Class CFGQuestionAnswerAdapter<Q,A>

java.lang.Object
  extended by tip.cfg.CFGQuestionAnswerAdapter<Q,A>
Type Parameters:
Q - the type of the questions
A - the type of the answers
All Implemented Interfaces:
CFGQuestionAnswer<Q,A>
Direct Known Subclasses:
Interprocedural

public class CFGQuestionAnswerAdapter<Q,A>
extends Object
implements CFGQuestionAnswer<Q,A>

CFGQuestionAnswerAdapter implements the default behaviour of the CFGQuestionAnswer interface. All calls return null by default.

Author:
Johnni Winther, jw@brics.dk

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

Constructor Detail

CFGQuestionAnswerAdapter

public CFGQuestionAnswerAdapter()
Method Detail

defaultNode

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

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

caseEntryPoint

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

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

caseExitPoint

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

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

caseCReturnStmPoint

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

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

caseCAssignPtrStmPoint

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

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

caseCBlockPoint

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

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

caseCVarExpPoint

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

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

caseCFunctionCallExpPoint

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

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

caseCDerefExpPoint

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

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

caseCDeclStmPoint

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

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

caseCInputExpPoint

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

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

caseCMallocExpPoint

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

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

caseCIfThenStmPoint

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

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

caseCIntConstExpPoint

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

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

caseCFunctionPtrCallExpPoint

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

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

caseCWhileStmPoint

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

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

caseCBinopExpPoint

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

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

caseCAssignVarStmPoint

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

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

caseCIfThenElseStmPoint

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

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

caseCOutputStmPoint

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

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

caseCPointerExpPoint

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

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

caseCNullExpPoint

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

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