|
|||||||||
| 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. |
protected static class |
FlowGraph.ListKey
Class to be used for inserting Lists in hashtables using collection equality (as defined in CollectionUtil). |
static class |
FlowGraph.Peer
A Peer is an occurance of an AST node in a flow graph. |
| 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 Peers
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 | |
|---|---|
Term |
entryNode()
|
Term |
exitNode()
|
Term |
finishNode()
|
boolean |
forward()
|
java.util.Map |
pathMap(Node n)
|
java.util.Collection |
pathMaps()
|
FlowGraph.Peer |
peer(Term n,
DataFlow df)
Retrieve the 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,
DataFlow df)
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 Peers in this flow graph. |
java.util.Collection |
peers(Term n)
Return a collection of all of the Peers for the given
Term n. |
Term |
root()
|
Term |
startNode()
|
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
Peers
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
Peers. 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 startNode()
public Term finishNode()
public Term entryNode()
public Term exitNode()
public Term root()
public boolean forward()
public java.util.Collection pathMaps()
public java.util.Map pathMap(Node n)
public java.util.Collection peers()
Peers in this flow graph.
public FlowGraph.Peer peer(Term n,
DataFlow df)
Peer for the Term n, where
n does not appear in a finally block. If no such Peer
exists, then one will be created.
df - unused; for legacy purposes only?public java.util.Collection peers(Term n)
Peers for the given
Term n.
public FlowGraph.Peer peer(Term n,
java.util.List path_to_finally,
DataFlow df)
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.
df - unused; for legacy purposes only?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 | ||||||||