|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object spiglet.translate.graph.Graph spiglet.translate.graph.FlowGraph<SpigletTemp> spiglet.translate.graph.SpigletFlowGraph
public final class SpigletFlowGraph
This class represents the (finally) concrete control flow graph of a Spiglet thread of execution. Nodes are mapped to objects that encode a Spiglet statement and its metadata. Each node is mapped to a single statement. There is no basic block implementation for this class. Or, each block only contains a single statement.
SpigletStatement
,
Node
Field Summary |
---|
Fields inherited from class spiglet.translate.graph.Graph |
---|
nodes |
Constructor Summary | |
---|---|
SpigletFlowGraph(StmtExp stmtExp)
Constructs a flow graph for a Spiglet thread with a return expression. |
|
SpigletFlowGraph(StmtList stmtList)
Constructs a flow graph for a Spiglet thread. |
Method Summary | |
---|---|
java.util.Set<SpigletTemp> |
def(Node node)
Returns the set of variables that are in the def set of the
given node. |
SpigletStatement |
getStatement(Node node)
Looks up and returns the statement that is associated with the given node. |
java.lang.String |
toString()
Returns a multi-line string representation of the flow graph. |
java.util.Set<SpigletTemp> |
use(Node node)
Returns the set of variables that are in the use set of the
given node. |
Methods inherited from class spiglet.translate.graph.FlowGraph |
---|
getEntryNode, getExitNode |
Methods inherited from class spiglet.translate.graph.Graph |
---|
addEdge, addNode, check, createNode, getNodes, removeEdge |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SpigletFlowGraph(StmtList stmtList)
StmtList
itself), create such a graph.
stmtList
- the list of Spiglet statementspublic SpigletFlowGraph(StmtExp stmtExp)
StmtExp
itself), create
such a graph. A number of formal arguments of the StmtExp
is also
given so that the set of temporaries going live-in to the control flow
graph's entry block can be constructed.
stmtExp
- the list of Spiglet statements epilogued by a return expMethod Detail |
---|
public SpigletStatement getStatement(Node node)
node
- the node to look up
null
if the given node is null
public java.util.Set<SpigletTemp> def(Node node)
FlowGraph
def
set of the
given node.
def
in class FlowGraph<SpigletTemp>
node
- the node to look up
def
set of the given nodepublic java.util.Set<SpigletTemp> use(Node node)
FlowGraph
use
set of the
given node.
use
in class FlowGraph<SpigletTemp>
node
- the node to look up
use
set of the given nodepublic java.lang.String toString()
Graph.toString()
).
The subsequent lines reprints the statements that the node represents,
preluded with the node's key number in the form [#]
. Each line
of statement is also followed by its metadata, as returned by
SpigletStatement.toString()
.
toString
in class Graph
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |