|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.cs.crystal.internal.ControlFlowNode
public class ControlFlowNode
Represents one node in a Control Flow Graph.
Nested Class Summary | |
---|---|
static class |
ControlFlowNode.Direction
|
Constructor Summary | |
---|---|
ControlFlowNode(ControlFlowGraph cfg,
org.eclipse.jdt.core.dom.ASTNode inASTNode)
Contructor. |
Method Summary | |
---|---|
void |
addEdge(ControlFlowNode.Direction direction,
ControlFlowNode node)
Adds an edge from this node to another. |
ControlFlowNode |
breaking(java.lang.String label,
boolean keepRemovingNodes)
A recursive method for correcting the structure of a CFG in the context of a break statement. |
ControlFlowNode |
continuing(java.lang.String label,
boolean keepRemovingNodes)
A recursive method for correcting the structure of a CFG in the context of a continue statement. |
void |
evaluate()
Evaluates this ControlFlowNode for possible subnodes based on this node's ASTNode. |
ControlFlowNode |
findNode(ControlFlowNode.Direction direction,
int astNodeType)
Searches for the first ASTNode type in the CFG. |
org.eclipse.jdt.core.dom.ASTNode |
getASTNode()
Retrieves the ASTNode associated with this ControlFlowNode |
ControlFlowGraph |
getControlFlowGraph()
Retrieves the ControlFlowGraph |
java.util.Iterator<ControlFlowNode> |
getIterator(ControlFlowNode.Direction direction)
Retrieves an iterator for either the forward or backward nodes in the CFG. |
ControlFlowNode |
getNode(ControlFlowNode.Direction direction)
Retrieves the only forward or backward node from this node. |
int |
getNumberOfEdges(ControlFlowNode.Direction direction)
Retrieves the number of edges in a direction. |
void |
insertNode(ControlFlowNode.Direction direction,
ControlFlowNode insertNode)
Inserts a node between this node and all its subsequent nodes depending on the direction. |
boolean |
isDummy()
Used to identify dummy nodes |
void |
moveEdges(ControlFlowNode.Direction direction,
ControlFlowNode node)
Take all edges and move them to another node. |
ControlFlowNode |
newControlFlowNode(org.eclipse.jdt.core.dom.ASTNode node)
Creates a new ControlFlowNode from another ControlFlowNode. |
void |
remove()
Removes this Control Flow Node from the tree, connecting edges appropriately |
ControlFlowNode |
returning()
A recursive method for correcting the structure of a CFG in the context of a return statement. |
void |
setFirstChild(ControlFlowNode child)
Stores the CFN of the first CFN that is a child of this CFN |
void |
setLoopPaths(ControlFlowNode enter,
ControlFlowNode exit)
loop paths are CFN pointers that record the edge that enters the loop and the edge that exits the loop. |
java.lang.String |
toString()
Converts this node into a string representation |
java.lang.String |
toStringGraph(ControlFlowNode.Direction direction)
Populates a string with a multi-line textual representation of the control flow. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ControlFlowNode(ControlFlowGraph cfg, org.eclipse.jdt.core.dom.ASTNode inASTNode)
cfg
- the graph this node belongs toinASTNode
- the ASTNode to associate to this CFNMethod Detail |
---|
public ControlFlowNode newControlFlowNode(org.eclipse.jdt.core.dom.ASTNode node)
node
- the ASTNode to create a CFN for
public void evaluate()
public boolean isDummy()
public org.eclipse.jdt.core.dom.ASTNode getASTNode()
public void setLoopPaths(ControlFlowNode enter, ControlFlowNode exit)
enter
- the node that enters the loopexit
- the node that exits the looppublic void setFirstChild(ControlFlowNode child)
child
- public ControlFlowGraph getControlFlowGraph()
public java.util.Iterator<ControlFlowNode> getIterator(ControlFlowNode.Direction direction)
direction
- the direction to retrieve the iterator for
public ControlFlowNode getNode(ControlFlowNode.Direction direction)
direction
- the direction to retrieve the node from
public int getNumberOfEdges(ControlFlowNode.Direction direction)
direction
- the direction to count
public void addEdge(ControlFlowNode.Direction direction, ControlFlowNode node)
direction
- the direction to add the edge tonode
- the node to addpublic void remove()
public void moveEdges(ControlFlowNode.Direction direction, ControlFlowNode node)
direction
- the direction to move edges fromnode
- the node to move edges topublic void insertNode(ControlFlowNode.Direction direction, ControlFlowNode insertNode)
direction
- the direction to insert intoinsertNode
- the node to insertpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringGraph(ControlFlowNode.Direction direction)
direction
- sets the traversal direction
public ControlFlowNode findNode(ControlFlowNode.Direction direction, int astNodeType)
direction
- the direction to lookastNodeType
- the node type to look for (see ASTNode.getNodeType())
public ControlFlowNode returning()
public ControlFlowNode breaking(java.lang.String label, boolean keepRemovingNodes)
label
- the label of the break, or null if nonekeepRemovingNodes
- if true then remove forward nodes
public ControlFlowNode continuing(java.lang.String label, boolean keepRemovingNodes)
label
- the label of the continue, or null if nonekeepRemovingNodes
- if true then remove forward nodes
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |