tip.cfg
Interface IProgramPoint

All Known Implementing Classes:
AProgramPoint, CAssignPtrStmPoint, CAssignVarStmPoint, CBinopExpPoint, CBlockPoint, CDeclStmPoint, CDerefExpPoint, CFunctionCallExpPoint, CFunctionPtrCallExpPoint, CIfThenElseStmPoint, CIfThenStmPoint, CInputExpPoint, CIntConstExpPoint, CMallocExpPoint, CNullExpPoint, COutputStmPoint, CPointerExpPoint, CReturnStmPoint, CVarExpPoint, CWhileStmPoint, EntryPoint, ExitPoint

public interface IProgramPoint

IProgramPoint defines the interface for a program point in a control flow graph.

Author:
Johnni Winther, jw@brics.dk

Method Summary
 void addPredecessor(IProgramPoint predecessor)
          Adds predecessor to the set of predecessors of this program point.
 void addSuccessor(IProgramPoint successor)
          Adds successor to the set of successors of this program point.
<A> A
apply(CFGAnswer<A> caller)
          Returns an answer by calling the visitor caller with this program point.
<Q,A> A
apply(CFGQuestionAnswer<Q,A> caller, Q question)
          Returns an answer by calling the visitor caller with this program point and the question.
 boolean apply(ICFGAnalysis analysis)
          Calls the appropriate case-method on analysis and returns the result.
 IProgramPoint clone()
          Returns a clone of the program point with no predecessors or successors.
 Node getNode()
          Returns the Node in the AST associated with this program point.
 String getNodeText(Answer<String> nodeText)
          Returns a textual representation of this program point using the Answer nodeText.
 Set<IProgramPoint> getPredecessors()
          Returns the set of predecessors to this program point.
 Set<IProgramPoint> getSuccessors()
          Returns the set of successors to this program point.
 Set<IProgramPoint> getVicinity(int distance)
          Returns the set of program points reachable from this point following at most distance successors or predecessors.
 void removePredecessor(IProgramPoint predecessor)
          Removes predecessor from the set of predecessors of this program point.
 void removeSuccessor(IProgramPoint successor)
          Removes successor to the set of successors of this program point.
 

Method Detail

apply

boolean apply(ICFGAnalysis analysis)
Calls the appropriate case-method on analysis and returns the result.

Returns:
the result of calling the appropriate case-method on analysis

addPredecessor

void addPredecessor(IProgramPoint predecessor)
Adds predecessor to the set of predecessors of this program point. The program point as implicitly added to the successor set of the the predecessor. A program point can only be predecessor of a program point once.

Parameters:
predecessor - the program point added to the predecessor set

removePredecessor

void removePredecessor(IProgramPoint predecessor)
Removes predecessor from the set of predecessors of this program point. The program point as implicitly removed from the successor set of the the predecessor.

Parameters:
predecessor - the program point removed from the predecessor set

addSuccessor

void addSuccessor(IProgramPoint successor)
Adds successor to the set of successors of this program point. The program point as implicitly added to the predecessor set of the the successor. A program point can only be successor of a program point once.

Parameters:
successor - the program point added to the successor set

removeSuccessor

void removeSuccessor(IProgramPoint successor)
Removes successor to the set of successors of this program point. The program point as implicitly removes from the predecessor set of the the successor.

Parameters:
successor - the program point removed from the successor set

getPredecessors

Set<IProgramPoint> getPredecessors()
Returns the set of predecessors to this program point.

Returns:
the set of predecessors to this program point

getSuccessors

Set<IProgramPoint> getSuccessors()
Returns the set of successors to this program point.

Returns:
the set of successors to this program point

getVicinity

Set<IProgramPoint> getVicinity(int distance)
Returns the set of program points reachable from this point following at most distance successors or predecessors.

Parameters:
distance - the maximum distance of points returned
Returns:
the set of program points in the distance-vicinity of this point

getNode

Node getNode()
Returns the Node in the AST associated with this program point.

Returns:
the Node in the AST associated with this program point

getNodeText

String getNodeText(Answer<String> nodeText)
Returns a textual representation of this program point using the Answer nodeText.

Parameters:
nodeText - the Answer used
Returns:
a textual representation of this program point

apply

<A> A apply(CFGAnswer<A> caller)
Returns an answer by calling the visitor caller with this program point.

Parameters:
caller - the Answer used
Returns:
the answer as returned from caller

apply

<Q,A> A apply(CFGQuestionAnswer<Q,A> caller,
              Q question)
Returns an answer by calling the visitor caller with this program point and the question.

Parameters:
caller - the QuestionAnswer used
question - the question used
Returns:
the answer as returned from caller on question

clone

IProgramPoint clone()
Returns a clone of the program point with no predecessors or successors.

Returns:
a clone of the program point with no predecessors or successors