Package org.jtool.pdg
Class PDGStatement
java.lang.Object
org.jtool.graph.GraphElement
org.jtool.graph.GraphNode
org.jtool.pdg.PDGNode
org.jtool.pdg.PDGStatement
A statement node of a PDG, which stores defined and used variables.
-
Field Summary
Fields inherited from class org.jtool.graph.GraphNode
id, incomingEdges, outgoingEdges
-
Constructor Summary
ConstructorsConstructorDescriptionPDGStatement
(CFGStatement node) Creates a new object that represents a statement. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests if this node defines a given variable.Returns the CFG node for a statement corresponding to this node.Returns the first one from the collection of variables defined in this node.Returns variables defined in this node.Returns the first one from the collection of variables used in this node.Returns variables used in this node.toString()
Obtains information on this statement node.boolean
Tests if this node uses a given variable.Methods inherited from class org.jtool.pdg.PDGNode
equals, getCFGNode, hashCode, isBranch, isEntry, isLoop, isParameter, isStatement, print, sortNodes
Methods inherited from class org.jtool.graph.GraphNode
addIncomingEdge, addIncomingEdges, addOutgoingEdge, addOutgoingEdges, clear, equals, equals, getDstNodes, getId, getIncomingEdges, getOutgoingEdges, getSrcNodes, removeIncomingEdge, removeOutgoingEdge, setId, sortGraphNode
Methods inherited from class org.jtool.graph.GraphElement
difference, equals, equals, getIdString, intersection, subset, subsetEqual, union
-
Constructor Details
-
PDGStatement
Creates a new object that represents a statement. This method is not intended to be invoked by clients.- Parameters:
node
- the CFG node corresponding to this node
-
-
Method Details
-
getCFGStatement
Returns the CFG node for a statement corresponding to this node.- Returns:
- the CFG node for the statement
-
getDefVariables
Returns variables defined in this node.- Returns:
- the collection of the defined variables
-
getUseVariables
Returns variables used in this node.- Returns:
- the collection of the used variables
-
getDefFirst
Returns the first one from the collection of variables defined in this node.- Returns:
- the defined variable at the first position, or
null
if this node never defines any variable
-
getUseFirst
Returns the first one from the collection of variables used in this node.- Returns:
- the used variable at the first position, or
null
if this node never uses any variable
-
definesVariable
Tests if this node defines a given variable.- Parameters:
jv
- the variable to be checked- Returns:
true
if the variable is defined in this node, otherwisefalse
-
usesVariable
Tests if this node uses a given variable.- Parameters:
jv
- the variable to be checked- Returns:
true
if the variable is used in this node, otherwisefalse
-
toString
Obtains information on this statement node.
-