|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jtool.jxplatform.graph.Graph
org.jtool.jxplatform.graph.cfg.CFG
An object storing information about a control flow graph (CFG).
| Field Summary | |
protected CFGExit |
end
An end node of this CFG. |
protected CFGMethodEntry |
start
A start node of this CFG. |
| Fields inherited from class org.jtool.jxplatform.graph.Graph |
edges, nodes |
| Constructor Summary | |
protected |
CFG()
Creates a new, empty object. |
|
CFG(org.w3c.dom.Element elem)
Creates the CFG of a method. |
|
CFG(org.w3c.dom.Element elem,
boolean bool)
Creates the CFG of a method. |
| Method Summary | |
GraphElementSet |
getBackwardReachableNodes(CFGNode fromNode,
CFGNode toNode)
Calculates and returns the nodes passed backward between two CFG nodes. |
GraphElementSet |
getBackwardReachableNodesWithoutLoopback(CFGNode fromNode,
CFGNode toNode)
Calculates and returns the nodes passed backward between two CFG nodes not traversing loopback edges. |
GraphElementSet |
getDstNodes(CFGNode src)
Returns destination nodes of the edges the source of which is a given node. |
CFGExit |
getEndNode()
Returns the end node of this CFG. |
ControlFlow |
getFalseFlowFrom(CFGNode src)
Returns a false control flow outgoing from a given node. |
CFGNode |
getFalseSuccessor(CFGNode node)
Returns a successor node of a given node with respect to the false control flow. |
ControlFlow |
getFlow(CFGNode src,
CFGNode dst)
Returns an edge specified by a given source node destination node. |
GraphElementSet |
getForwardReachableNodes(CFGNode fromNode,
CFGNode toNode)
Calculates and returns the nodes passed forward between two nodes CFG. |
GraphElementSet |
getForwardReachableNodesWithoutLoopback(CFGNode fromNode,
CFGNode toNode)
Calculates and returns the nodes passed forward between two CFG nodes not traversing loopback edges. |
CFGNode |
getNode(org.w3c.dom.Element elem)
Returns a CFG node which corresponds to a DOM element. |
CFGNode |
getNode(int id)
Returns a CFG node with a given identifier. |
GraphElementSet |
getSrcNodes(CFGNode dst)
Returns source nodes of the edges the destination of which is a given node. |
CFGMethodEntry |
getStartNode()
Returns the start node of this CFG. |
ControlFlow |
getTrueFlowFrom(CFGNode src)
Returns a true control flow outgoing from a given node. |
CFGNode |
getTrueSuccessor(CFGNode node)
Returns a successor node of a given node with respect to the true control flow. |
void |
print()
Displays information about this CFG. |
protected void |
setEndNode(CFGExit node)
Sets the end node of this CFG. |
protected void |
setStartNode(CFGMethodEntry node)
Sets the start node of this CFG. |
java.lang.String |
write()
Writes information about this CFG. |
void |
writeEdges(java.lang.StringBuffer buf)
Collects information about edges of this CFG for writing an XML document. |
void |
writeNodes(java.lang.StringBuffer buf)
Collects information about nodes of this CFG for writing an XML document. |
| Methods inherited from class org.jtool.jxplatform.graph.Graph |
add, add, clear, contains, contains, equals, getEdges, getNodes, printEdges, printNodes, remove, remove, setEdges, setNodes, setSrcDstNodes |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected CFGMethodEntry start
protected CFGExit end
| Constructor Detail |
protected CFG()
public CFG(org.w3c.dom.Element elem)
throws GraphException
elem - A DOM element corresponding to a target method.
GraphException - if the creation of a CFG fails.
public CFG(org.w3c.dom.Element elem,
boolean bool)
throws GraphException
elem - A DOM element corresponding to a target method.bool - true if the creation of actual-in and -out nodes is wanted.
GraphException - if the creation of a CFG fails.| Method Detail |
protected void setStartNode(CFGMethodEntry node)
node - A start node of this CFG.public CFGMethodEntry getStartNode()
protected void setEndNode(CFGExit node)
node - An end node of this CFG.public CFGExit getEndNode()
public GraphElementSet getForwardReachableNodes(CFGNode fromNode,
CFGNode toNode)
fromNode - A start node of reachable path to be calculated.toNode - An end node of reachable path to be calculated.
public GraphElementSet getForwardReachableNodesWithoutLoopback(CFGNode fromNode,
CFGNode toNode)
fromNode - A start node of reachable path to be calculated.toNode - An end node of reachable path to be calculated.
public GraphElementSet getBackwardReachableNodes(CFGNode fromNode,
CFGNode toNode)
fromNode - A start node of reachable path to be calculated.toNode - An end node of reachable path to be calculated.
public GraphElementSet getBackwardReachableNodesWithoutLoopback(CFGNode fromNode,
CFGNode toNode)
fromNode - A start node of reachable path to be calculated.toNode - An end node of reachable path to be calculated.
public ControlFlow getFlow(CFGNode src,
CFGNode dst)
src - A source CFG node for an edge to be retrieved.dst - A destination CFG node for an edge to be retrieved.
null if there is no edge found.public GraphElementSet getSrcNodes(CFGNode dst)
dst - A CFG node.
public GraphElementSet getDstNodes(CFGNode src)
src - A CFG.
public CFGNode getNode(org.w3c.dom.Element elem)
elem - A DOM element.
null if there is no corresponding node found.public CFGNode getNode(int id)
id - The identifier of a node.
null if there is no corresponding node found.public ControlFlow getTrueFlowFrom(CFGNode src)
src - A CFG node.
null if there is no corresponding flow found.public ControlFlow getFalseFlowFrom(CFGNode src)
src - A CFG node.
null if there is no corresponding flow found.public CFGNode getTrueSuccessor(CFGNode node)
node - A CFG node.
null if there is no corresponding node found.public CFGNode getFalseSuccessor(CFGNode node)
node - A CFG node.
null if there is no corresponding node found.public void print()
print in class Graph
public java.lang.String write()
throws GraphException
GraphException - the write of this CFG fails.public void writeNodes(java.lang.StringBuffer buf)
writeNodes in class Graphbuf - The information about the node.public void writeEdges(java.lang.StringBuffer buf)
writeEdges in class Graphbuf - The information about the node.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||