|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpolyglot.visit.FlowGraph
public class FlowGraph
Nested Class Summary | |
---|---|
static class |
FlowGraph.Edge
This class represents an edge in the flow graph. |
static class |
FlowGraph.EdgeKey
This class provides an identifying label for edges in the flow graph. |
static class |
FlowGraph.ExceptionEdgeKey
This class extends EdgeKey and is the key for edges that are taken when an exception of type t is thrown. |
static class |
FlowGraph.Peer
A Peer is an occurrence of an AST node in a flow graph. |
protected static class |
FlowGraph.PeerKey
Class to be used for inserting Lists in hashtables using collection equality (as defined in CollectionUtil ). |
Field Summary | |
---|---|
static FlowGraph.EdgeKey |
EDGE_KEY_FALSE
This EdgeKey is the EdgeKey for edges where the expression evaluates to false. |
static FlowGraph.EdgeKey |
EDGE_KEY_OTHER
This EdgeKey is the EdgeKey for edges where the flow is not suitable for EDGE_KEY_TRUE, EDGE_KEY_FALSE or an ExceptionEdgeKey, such as the edges from a switch statement to its cases and the flow from a sink node in the control flow graph. |
static FlowGraph.EdgeKey |
EDGE_KEY_TRUE
This EdgeKey is the EdgeKey for edges where the expression evaluates to true. |
protected boolean |
forward
Is the flow in this flow graph forward or backward? |
protected java.util.Map |
peerMap
Maps from AST nodes to path maps and hence to Peer s that
represent occurrences of the AST node in the flow graph. |
protected Term |
root
The root of the AST that this is a flow graph for. |
Method Summary | |
---|---|
java.util.Collection |
entryPeers()
|
java.util.Collection |
exitPeers()
|
java.util.Collection |
finishPeers()
|
boolean |
forward()
|
java.util.Map |
pathMap(Node n)
|
java.util.Collection |
pathMaps()
|
FlowGraph.Peer |
peer(Term n,
int entry)
Retrieve the entry or exit Peer for the
Term n , where n does not appear in a
finally block. |
FlowGraph.Peer |
peer(Term n,
java.util.List path_to_finally,
int entry)
Retrieve the Peer for the Term n that is
associated with the given path to the finally block. |
java.util.Collection |
peers()
Return a collection of all Peer s in this flow graph. |
java.util.Collection |
peers(Term n,
int entry)
Return a collection of all of the entry or exit Peer s for
the given Term n . |
Term |
root()
|
java.util.Collection |
startPeers()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Map peerMap
Peer
s that
represent occurrences of the AST node in the flow graph. In particular,
peerMap
maps IdentityKey(Node)
s to path
maps. A path map is a map from paths (ListKey(List of Terms)
)
to Peer
s. In particular, if n
is an AST
node in a finally block, then there will be a Peer
of
n
for each possible path to the finally block, and the
path map records which Peer
corresponds to which path. If
n
does not occur in a finally block, then the path map
should have only a single entry, from an empty list to the unique
Peer
for n
.
WARNING: the AST must be a tree, not a DAG. Otherwise the same peer may be used for a node that appears at multiple points in the AST. These points may have different data flows.
protected Term root
protected boolean forward
public static final FlowGraph.EdgeKey EDGE_KEY_TRUE
public static final FlowGraph.EdgeKey EDGE_KEY_FALSE
public static final FlowGraph.EdgeKey EDGE_KEY_OTHER
Method Detail |
---|
public Term root()
public boolean forward()
public java.util.Collection entryPeers()
public java.util.Collection exitPeers()
public java.util.Collection startPeers()
public java.util.Collection finishPeers()
public java.util.Collection pathMaps()
public java.util.Map pathMap(Node n)
public java.util.Collection peers()
Peer
s in this flow graph.
public FlowGraph.Peer peer(Term n, int entry)
Peer
for the
Term n
, where n
does not appear in a
finally block. If no such Peer exists, then one will be created.
entry
can be Term.ENTRY or Term.EXIT.
public java.util.Collection peers(Term n, int entry)
Peer
s for
the given Term n
.
entry
can be Term.ENTRY or Term.EXIT.
public FlowGraph.Peer peer(Term n, java.util.List path_to_finally, int entry)
Peer
for the Term n
that is
associated with the given path to the finally block. (A term that occurs
in a finally block has one Peer for each possible path to that finally
block.) If no such Peer exists, then one will be created.
entry
can be Term.ENTRY or Term.EXIT.
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |