tip.cfg
Class AProgramPoint

java.lang.Object
  extended by tip.cfg.AProgramPoint
All Implemented Interfaces:
IProgramPoint
Direct Known Subclasses:
CAssignPtrStmPoint, CAssignVarStmPoint, CBinopExpPoint, CBlockPoint, CDeclStmPoint, CDerefExpPoint, CFunctionCallExpPoint, CFunctionPtrCallExpPoint, CIfThenElseStmPoint, CIfThenStmPoint, CInputExpPoint, CIntConstExpPoint, CMallocExpPoint, CNullExpPoint, COutputStmPoint, CPointerExpPoint, CReturnStmPoint, CVarExpPoint, CWhileStmPoint, EntryPoint, ExitPoint

public abstract class AProgramPoint
extends Object
implements IProgramPoint

AProgramPoint implements the basic functionality of the generated program points.

Author:
Johnni Winther, jw@brics.dk

Constructor Summary
AProgramPoint(Node _node_)
          Creates a new program point associated with _node_.
 
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.
abstract  AProgramPoint 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.
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface tip.cfg.IProgramPoint
apply, apply, apply, getNodeText
 

Constructor Detail

AProgramPoint

public AProgramPoint(Node _node_)
Creates a new program point associated with _node_.

Parameters:
_node_ - the Node associated with this program point
Method Detail

addPredecessor

public 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.

Specified by:
addPredecessor in interface IProgramPoint
Parameters:
predecessor - the program point added to the predecessor set

removePredecessor

public 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.

Specified by:
removePredecessor in interface IProgramPoint
Parameters:
predecessor - the program point removed from the predecessor set

addSuccessor

public 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.

Specified by:
addSuccessor in interface IProgramPoint
Parameters:
successor - the program point added to the successor set

removeSuccessor

public 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.

Specified by:
removeSuccessor in interface IProgramPoint
Parameters:
successor - the program point removed from the successor set

getPredecessors

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

Specified by:
getPredecessors in interface IProgramPoint
Returns:
the set of predecessors to this program point

getSuccessors

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

Specified by:
getSuccessors in interface IProgramPoint
Returns:
the set of successors to this program point

getVicinity

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

Specified by:
getVicinity in interface IProgramPoint
Parameters:
distance - the maximum distance of points returned
Returns:
the set of program points in the distance-vicinity of this point

getNode

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

Specified by:
getNode in interface IProgramPoint
Returns:
the Node in the AST associated with this program point

clone

public abstract AProgramPoint clone()
Returns a clone of the program point with no predecessors or successors.

Specified by:
clone in interface IProgramPoint
Overrides:
clone in class Object
Returns:
a clone of the program point with no predecessors or successors