public abstract class DataFlow<FlowItem extends DataFlow.Item> extends ErrorHandlingVisitor
Modifier and Type | Class and Description |
---|---|
protected static class |
DataFlow.BoolItem<FlowItem extends DataFlow.Item>
Deprecated.
Use flowBooleanConditions
|
protected static class |
DataFlow.ConditionNavigator<FlowItem extends DataFlow.Item>
Deprecated.
|
protected static class |
DataFlow.FlowGraphSource<FlowItem extends DataFlow.Item> |
protected static class |
DataFlow.Frame<FlowItem extends DataFlow.Item>
A "stack frame" for recursive DFS
|
static class |
DataFlow.Item
An
Item contains the data which flows during dataflow
analysis. |
Modifier and Type | Field and Description |
---|---|
protected boolean |
dataflowOnEntry
Indicates whether the dataflow should be performed on entering a
CodeNode , or on leaving a CodeNode . |
protected boolean |
detectBackEdges
Indicates whether the dataflow should detect back edges.
|
protected static int |
flowCounter |
protected java.util.LinkedList<DataFlow.FlowGraphSource<FlowItem>> |
flowgraphStack
A stack of
FlowGraphSource . |
protected boolean |
forward
Indicates whether this dataflow is a forward analysis.
|
protected java.util.Map<FlowGraph.Peer<FlowItem>,java.lang.Integer> |
postordering
Map from
Peer s to Integer s that contains a post-ordering
of Peer s if this.detectBackEdges is true. |
error, job, nf, ts
bypass, bypassParent
Constructor and Description |
---|
DataFlow(Job job,
TypeSystem ts,
NodeFactory nf,
boolean forward)
Constructor.
|
DataFlow(Job job,
TypeSystem ts,
NodeFactory nf,
boolean forward,
boolean dataflowOnEntry)
Constructor.
|
DataFlow(Job job,
TypeSystem ts,
NodeFactory nf,
boolean forward,
boolean dataflowOnEntry,
boolean detectBackEdges)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
check(FlowGraph<FlowItem> graph,
FlowGraph.Peer<FlowItem> p)
Check that the term n satisfies whatever properties this
dataflow is checking for.
|
protected abstract void |
check(FlowGraph<FlowItem> graph,
Term n,
boolean entry,
FlowItem inItem,
java.util.Map<FlowGraph.EdgeKey,FlowItem> outItems)
Check that the term n satisfies whatever properties this
dataflow is checking for.
|
protected abstract FlowItem |
confluence(java.util.List<FlowItem> items,
FlowGraph.Peer<FlowItem> peer,
FlowGraph<FlowItem> graph)
The confluence operator for many flows.
|
protected FlowItem |
confluence(java.util.List<FlowItem> items,
java.util.List<FlowGraph.EdgeKey> itemKeys,
FlowGraph.Peer<FlowItem> peer,
FlowGraph<FlowItem> graph)
The confluence operator for many flows.
|
protected static <FlowItem extends DataFlow.Item> |
constructItemsFromCondition(Expr booleanCond,
FlowItem startingItem,
java.util.Set<FlowGraph.EdgeKey> succEdgeKeys,
DataFlow.ConditionNavigator<FlowItem> navigator)
Deprecated.
|
protected CFGBuilder<FlowItem> |
createCFGBuilder(TypeSystem ts,
FlowGraph<FlowItem> g)
Construct a CFGBuilder.
|
protected DataFlow.Frame<FlowItem> |
createFrame(FlowGraph.Peer<FlowItem> p,
boolean forward,
FlowGraph<FlowItem> grahp) |
protected FlowItem |
createInitialItem(FlowGraph<FlowItem> graph,
FlowGraph.Peer<FlowItem> peer)
Create an initial Item for the term node.
|
protected abstract FlowItem |
createInitialItem(FlowGraph<FlowItem> graph,
Term node,
boolean entry)
Create an initial Item for the term node.
|
protected FlowGraph<FlowItem> |
currentFlowGraph()
Return the
FlowGraph at the top of the stack. |
protected void |
dataflow(CodeDecl cd)
Construct a flow graph for the
CodeNode provided, and call
dataflow(FlowGraph) . |
protected void |
dataflow(CodeNode cd) |
protected void |
dataflow(FlowGraph<FlowItem> graph)
Perform the dataflow on flow graph
graph . |
protected void |
dumpFlowGraph(FlowGraph<FlowItem> graph,
Term root)
Dump a flow graph, labeling edges with their flows, to aid in the
debugging of data flow.
|
protected NodeVisitor |
enterCall(Node n)
Overridden superclass method, to build the flow graph, perform dataflow
analysis, and check the analysis for CodeNode nodes.
|
protected java.util.List<FlowItem> |
filterItems(java.util.List<FlowItem> items,
java.util.List<FlowGraph.EdgeKey> itemKeys,
FlowGraph.EdgeKey filterEdgeKey)
Filter a list of
Item s to contain only Item s
that are associated with the given EdgeKey . |
protected java.util.List<FlowItem> |
filterItemsExceptionSubclass(java.util.List<FlowItem> items,
java.util.List<FlowGraph.EdgeKey> itemKeys,
Type excType)
Filter a list of
Item s to contain only Item s
that are associated with exception flows, whose exception is a subclass
of excType . |
protected java.util.List<FlowItem> |
filterItemsNonError(java.util.List<FlowItem> items,
java.util.List<FlowGraph.EdgeKey> itemKeys)
Filter a list of
Item s to contain only Item s
that are not associated with error flows, that is, only
Item s whose associated EdgeKey s are not
FlowGraph.ExceptionEdgeKey s with a type that is a subclass
of TypeSystem.Error() . |
protected java.util.List<FlowItem> |
filterItemsNonException(java.util.List<FlowItem> items,
java.util.List<FlowGraph.EdgeKey> itemKeys)
Filter a list of
Item s to contain only Item s
that are not associated with exception flows, that is, only
Item s whose associated EdgeKey s are not
FlowGraph.ExceptionEdgeKey s. |
protected Pair<FlowGraph.Peer<FlowItem>[],int[]> |
findSCCs(FlowGraph<FlowItem> graph)
Returns the linked list [by_scc, scc_head] where
by_scc is an array in which SCCs occur in topologically
sorted order.
|
protected java.util.Map<FlowGraph.EdgeKey,FlowItem> |
flow(FlowItem in,
FlowGraph<FlowItem> graph,
FlowGraph.Peer<FlowItem> peer)
Produce new
Item s as appropriate for the
Peer and the input Item s. |
protected java.util.Map<FlowGraph.EdgeKey,FlowItem> |
flow(FlowItem trueItem,
FlowItem falseItem,
FlowItem otherItem,
FlowGraph<FlowItem> graph,
FlowGraph.Peer<FlowItem> peer) |
protected java.util.Map<FlowGraph.EdgeKey,FlowItem> |
flow(java.util.List<FlowItem> inItems,
java.util.List<FlowGraph.EdgeKey> inItemKeys,
FlowGraph<FlowItem> graph,
FlowGraph.Peer<FlowItem> peer)
Produce new
Item s as appropriate for the peer's node
and the input Item s. |
protected java.util.Map<FlowGraph.EdgeKey,FlowItem> |
flow(java.util.List<FlowItem> inItems,
java.util.List<FlowGraph.EdgeKey> inItemKeys,
java.util.List<FlowGraph.Peer<FlowItem>> inItemPeers,
FlowGraph<FlowItem> graph,
FlowGraph.Peer<FlowItem> p)
Produce new
Item s as appropriate for the
Peer and the input Item s. |
protected java.util.Map<FlowGraph.EdgeKey,FlowItem> |
flow(java.util.List<FlowItem> inItems,
java.util.List<FlowGraph.EdgeKey> inItemKeys,
java.util.List<FlowGraph.Peer<FlowItem>> inItemPeers,
java.util.List<java.lang.Boolean> isBackEdges,
FlowGraph<FlowItem> graph,
FlowGraph.Peer<FlowItem> p) |
protected java.util.Map<FlowGraph.EdgeKey,FlowItem> |
flowBooleanConditions(FlowItem trueItem,
FlowItem falseItem,
FlowItem otherItem,
FlowGraph<FlowItem> graph,
FlowGraph.Peer<FlowItem> peer) |
protected java.util.Map<FlowGraph.EdgeKey,FlowItem> |
flowToBooleanFlow(java.util.List<FlowItem> inItems,
java.util.List<FlowGraph.EdgeKey> inItemKeys,
FlowGraph<FlowItem> graph,
FlowGraph.Peer<FlowItem> peer)
A utility method that simply collects together all the
TRUE items, FALSE items, and all other items (including ExceptionEdgeKey
items), calls
confluence on each of these three collections
as necessary, and passes the results to
flow(Item, Item, Item, FlowGraph, Term, Set). |
protected static boolean |
hasTrueFalseBranches(java.util.Set<FlowGraph.EdgeKey> edgeKeys)
This utility method is for subclasses to determine if the node currently
under consideration has both true and false edges leaving it.
|
protected FlowGraph<FlowItem> |
initGraph(CodeDecl code,
Term root)
Initialize the
FlowGraph to be used in the dataflow
analysis. |
protected FlowGraph<FlowItem> |
initGraph(CodeNode code,
Term root)
Initialize the
FlowGraph to be used in the dataflow
analysis. |
protected static <FlowItem> java.util.Map<FlowGraph.EdgeKey,FlowItem> |
itemsToMap(FlowItem trueItem,
FlowItem falseItem,
FlowItem remainingItem,
java.util.Set<FlowGraph.EdgeKey> edgeKeys)
This utility method is for subclasses to convert Items into
a
Map , to return from the
flow methods. |
static <FlowItem> java.util.Map<FlowGraph.EdgeKey,FlowItem> |
itemToMap(FlowItem i,
java.util.Set<FlowGraph.EdgeKey> edgeKeys)
This utility method is for subclasses to convert a single Item into
a
Map , to return from the
flow methods. |
JLang |
lang() |
Node |
leave(Node parent,
Node old,
Node n,
NodeVisitor v)
Overridden superclass method, to make sure that if a subclass has changed
a Term, that we update the peer maps appropriately, since they are based
on
IdentityKey s. |
protected Node |
leaveCall(Node old,
Node n,
NodeVisitor v)
Overridden superclass method, to pop from the stack of
FlowGraph s if necessary. |
protected void |
post(FlowGraph<FlowItem> graph,
Term root)
Check all of the Peers in the graph, after the dataflow analysis has
been performed.
|
protected FlowItem |
safeConfluence(FlowItem item1,
FlowGraph.EdgeKey key1,
FlowItem item2,
FlowGraph.EdgeKey key2,
FlowGraph.Peer<FlowItem> peer,
FlowGraph<FlowItem> graph) |
protected FlowItem |
safeConfluence(FlowItem item1,
FlowGraph.EdgeKey key1,
FlowItem item2,
FlowGraph.EdgeKey key2,
FlowItem item3,
FlowGraph.EdgeKey key3,
FlowGraph.Peer<FlowItem> peer,
FlowGraph<FlowItem> graph) |
protected FlowItem |
safeConfluence(java.util.List<FlowItem> items,
java.util.List<FlowGraph.EdgeKey> itemKeys,
FlowGraph.Peer<FlowItem> peer,
FlowGraph<FlowItem> graph)
The confluence operator for many flows.
|
begin, catchErrors, enter, enterCall, enterError, errorQueue, hasErrors, job, leaveCall, leaveCall, nodeFactory, typeSystem
bypass, bypass, bypassChildren, override, visitChildren
copy, enter, finish, finish, leave, override, toString, visitEdge, visitEdgeNoOverride
protected final boolean forward
protected final boolean detectBackEdges
protected final boolean dataflowOnEntry
CodeNode
, or on leaving a CodeNode
.
If dataflow is performed on entry, then the control flow graph
will be available when visiting children of the
CodeNode
, via the currentFlowGraph
method. If dataflow is performed on leaving, then the control
flow graph will not be available, but nested
CodeNode
s will have already been processed.protected java.util.LinkedList<DataFlow.FlowGraphSource<FlowItem extends DataFlow.Item>> flowgraphStack
FlowGraphSource
. The flow graph is constructed
upon entering a CodeNode AST node, and dataflow performed on that flow
graph immediately. The flow graph is available during the visiting of
children of the CodeNode, if subclasses want to use this information
to update AST nodes. The stack is maintained only if
dataflowOnEntry
is true.protected java.util.Map<FlowGraph.Peer<FlowItem extends DataFlow.Item>,java.lang.Integer> postordering
Peer
s to Integer
s that contains a post-ordering
of Peer
s if this.detectBackEdges
is true.protected static int flowCounter
public DataFlow(Job job, TypeSystem ts, NodeFactory nf, boolean forward)
public DataFlow(Job job, TypeSystem ts, NodeFactory nf, boolean forward, boolean dataflowOnEntry)
public DataFlow(Job job, TypeSystem ts, NodeFactory nf, boolean forward, boolean dataflowOnEntry, boolean detectBackEdges)
public JLang lang()
lang
in class NodeVisitor
protected FlowItem createInitialItem(FlowGraph<FlowItem> graph, FlowGraph.Peer<FlowItem> peer)
protected abstract FlowItem createInitialItem(FlowGraph<FlowItem> graph, Term node, boolean entry)
protected java.util.Map<FlowGraph.EdgeKey,FlowItem> flow(FlowItem in, FlowGraph<FlowItem> graph, FlowGraph.Peer<FlowItem> peer)
Item
s as appropriate for the
Peer
and the input Item
s.inItems
- all the Items flowing into the node.inItemKeys
- the FlowGraph.EdgeKeys for the items in the list inItemsgraph
- the FlowGraph which the dataflow is operating onpeer
- the Peer which this method must calculate the flow for.protected java.util.Map<FlowGraph.EdgeKey,FlowItem> flow(java.util.List<FlowItem> inItems, java.util.List<FlowGraph.EdgeKey> inItemKeys, java.util.List<FlowGraph.Peer<FlowItem>> inItemPeers, FlowGraph<FlowItem> graph, FlowGraph.Peer<FlowItem> p)
Item
s as appropriate for the
Peer
and the input Item
s.
Subclasses should override if flow behavior needs to distinguish
between source peers.inItems
- all the Items flowing into the node.inItemKeys
- the FlowGraph.EdgeKeys for the items in the list inItemsinItemPeers
- the Peers from which the Items flowed into the nodegraph
- the FlowGraph which the dataflow is operating onpeer
- the Peer which this method must calculate the flow for.protected java.util.Map<FlowGraph.EdgeKey,FlowItem> flow(java.util.List<FlowItem> inItems, java.util.List<FlowGraph.EdgeKey> inItemKeys, java.util.List<FlowGraph.Peer<FlowItem>> inItemPeers, java.util.List<java.lang.Boolean> isBackEdges, FlowGraph<FlowItem> graph, FlowGraph.Peer<FlowItem> p)
inItems
- all the Items flowing into the node.inItemKeys
- the FlowGraph.EdgeKeys for the items in the list inItemsinItemPeers
- the Peers from which the Items flowed into the nodeisBackEdge
- list of Booleans indicating whether the edge represented
by the corresponding element in inItems is a back edge or not.graph
- the FlowGraph which the dataflow is operating onpeer
- the Peer which this method must calculate the flow for.protected java.util.Map<FlowGraph.EdgeKey,FlowItem> flow(java.util.List<FlowItem> inItems, java.util.List<FlowGraph.EdgeKey> inItemKeys, FlowGraph<FlowItem> graph, FlowGraph.Peer<FlowItem> peer)
Item
s as appropriate for the peer's node
and the input Item
s. The default
implementation of this method is simply to call confluence
for the list of inItems, and pass the result to flow(Item, FlowGraph,
Term, Set). Subclasses may want to override this method if a finer-grained
dataflow is required. Some subclasses may wish to override this method
to call flowToBooleanFlow
.inItems
- all the Items flowing into the node.inItemKeys
- the FlowGraph.EdgeKeys for the items in the list inItemsgraph
- the FlowGraph which the dataflow is operating onn
- the Term which this method must calculate the flow for.entry
- indicates whether we are looking at the entry or exit of n.edgeKeys
- a set of FlowGraph.EdgeKeys, being all the
EdgeKeys of the edges leaving this node. The
returned Map must have mappings for all objects in this set.protected final java.util.Map<FlowGraph.EdgeKey,FlowItem> flowToBooleanFlow(java.util.List<FlowItem> inItems, java.util.List<FlowGraph.EdgeKey> inItemKeys, FlowGraph<FlowItem> graph, FlowGraph.Peer<FlowItem> peer)
confluence
on each of these three collections
as necessary, and passes the results to
flow(Item, Item, Item, FlowGraph, Term, Set). It is expected that
this method will typically be called by subclasses overriding the
flow(List, List, FlowGraph, Term, Set) method, due to the need for
a finer-grained dataflow analysis.inItems
- all the Items flowing into the node.inItemKeys
- the FlowGraph.EdgeKeys for the items in the list inItemsgraph
- the FlowGraph which the dataflow is operating onpeer
- the Peer which this method must calculate the flow for.protected java.util.Map<FlowGraph.EdgeKey,FlowItem> flow(FlowItem trueItem, FlowItem falseItem, FlowItem otherItem, FlowGraph<FlowItem> graph, FlowGraph.Peer<FlowItem> peer)
protected java.util.Map<FlowGraph.EdgeKey,FlowItem> flowBooleanConditions(FlowItem trueItem, FlowItem falseItem, FlowItem otherItem, FlowGraph<FlowItem> graph, FlowGraph.Peer<FlowItem> peer)
trueItem
- The item for flows coming into n for true conditions. Cannot be null.falseItem
- The item for flows coming into n for false conditions. Cannot be null.otherItem
- The item for all other flows coming into npeer
- The Peer for the boolean expression.protected abstract FlowItem confluence(java.util.List<FlowItem> items, FlowGraph.Peer<FlowItem> peer, FlowGraph<FlowItem> graph)
items
- List of Item
s that flow into node
.
this method will only be called if the list has at least 2
elements.peer
- Peer
for which the items
are
flowing into.protected FlowItem confluence(java.util.List<FlowItem> items, java.util.List<FlowGraph.EdgeKey> itemKeys, FlowGraph.Peer<FlowItem> peer, FlowGraph<FlowItem> graph)
items
- List of Item
s that flow into node
.
This method will only be called if the list has at least 2
elements.itemKeys
- List of FlowGraph.ExceptionEdgeKey
s for
the edges that the corresponding Item
s in
items
flowed from.peer
- Peer
for which the items
are
flowing into.protected FlowItem safeConfluence(java.util.List<FlowItem> items, java.util.List<FlowGraph.EdgeKey> itemKeys, FlowGraph.Peer<FlowItem> peer, FlowGraph<FlowItem> graph)
items
- List of Item
s that flow into node
.
This method will only be called if the list has at least 2
elements.itemKeys
- List of FlowGraph.ExceptionEdgeKey
s for
the edges that the corresponding Item
s in
items
flowed from.peer
- Peer
for which the items
are
flowing into.protected FlowItem safeConfluence(FlowItem item1, FlowGraph.EdgeKey key1, FlowItem item2, FlowGraph.EdgeKey key2, FlowGraph.Peer<FlowItem> peer, FlowGraph<FlowItem> graph)
protected FlowItem safeConfluence(FlowItem item1, FlowGraph.EdgeKey key1, FlowItem item2, FlowGraph.EdgeKey key2, FlowItem item3, FlowGraph.EdgeKey key3, FlowGraph.Peer<FlowItem> peer, FlowGraph<FlowItem> graph)
protected abstract void check(FlowGraph<FlowItem> graph, Term n, boolean entry, FlowItem inItem, java.util.Map<FlowGraph.EdgeKey,FlowItem> outItems) throws SemanticException
SemanticException
- if the properties this dataflow
analysis is checking for is not satisfied.protected void check(FlowGraph<FlowItem> graph, FlowGraph.Peer<FlowItem> p) throws SemanticException
SemanticException
- if the properties this dataflow
analysis is checking for is not satisfied.protected void dataflow(CodeDecl cd) throws SemanticException
CodeNode
provided, and call
dataflow(FlowGraph)
. Is also responsible for calling
post(FlowGraph, Block)
after
dataflow(FlowGraph)
has been called, and for pushing
the FlowGraph
onto the stack of FlowGraph
s if
dataflow analysis is performed on entry to CodeNode
nodes.SemanticException
protected void dataflow(CodeNode cd) throws SemanticException
SemanticException
protected DataFlow.Frame<FlowItem> createFrame(FlowGraph.Peer<FlowItem> p, boolean forward, FlowGraph<FlowItem> grahp)
protected Pair<FlowGraph.Peer<FlowItem>[],int[]> findSCCs(FlowGraph<FlowItem> graph)
protected void dataflow(FlowGraph<FlowItem> graph)
graph
.protected FlowGraph<FlowItem> initGraph(CodeNode code, Term root)
FlowGraph
to be used in the dataflow
analysis.FlowGraph.
protected FlowGraph<FlowItem> initGraph(CodeDecl code, Term root)
FlowGraph
to be used in the dataflow
analysis.FlowGraph.
protected CFGBuilder<FlowItem> createCFGBuilder(TypeSystem ts, FlowGraph<FlowItem> g)
ts
- The type systemg
- The flow graph to that the CFGBuilder will construct.protected NodeVisitor enterCall(Node n) throws SemanticException
enterCall
in class ErrorHandlingVisitor
SemanticException
public Node leave(Node parent, Node old, Node n, NodeVisitor v)
IdentityKey
s.leave
in class ErrorHandlingVisitor
parent
- The parent of old
,
null
if old
has no parent.old
- The original state of root of the current subtree.n
- The current state of the root of the current subtree.v
- The NodeVisitor
object used to visit the children.n
.protected Node leaveCall(Node old, Node n, NodeVisitor v) throws SemanticException
FlowGraph
s if necessary.leaveCall
in class ErrorHandlingVisitor
SemanticException
protected void post(FlowGraph<FlowItem> graph, Term root) throws SemanticException
SemanticException
protected FlowGraph<FlowItem> currentFlowGraph()
FlowGraph
at the top of the stack. This method
should not be called if dataflow is not being performed on entry to
the CodeNode
s, as the stack is not maintained in that case.
If this
method is called by a subclass from the enterCall
or leaveCall
methods, for an AST node that is a child
of a CodeNode
, then the FlowGraph
returned
should be the FlowGraph
for the dataflow for innermost
CodeNode
.public static final <FlowItem> java.util.Map<FlowGraph.EdgeKey,FlowItem> itemToMap(FlowItem i, java.util.Set<FlowGraph.EdgeKey> edgeKeys)
Map
, to return from the
flow
methods. This
method should be used when the same output Item
from the
flow is to be used for all edges leaving the node.i
- the Item
to be placed in the returned
Map
as the value for every EdgeKey
in
edgeKeys.
edgeKeys
- the Set
of EdgeKey
s to be used
as keys in the returned Map
.Map
containing a mapping from every
EdgeKey
in edgeKeys
to the
Item i
.protected static final <FlowItem> java.util.Map<FlowGraph.EdgeKey,FlowItem> itemsToMap(FlowItem trueItem, FlowItem falseItem, FlowItem remainingItem, java.util.Set<FlowGraph.EdgeKey> edgeKeys)
Map
, to return from the
flow
methods.trueItem
- the Item
to be placed in the returned
Map
as the value for the
FlowGraph.EDGE_KEY_TRUE
, if that key is present in
edgeKeys.
falseItem
- the Item
to be placed in the returned
Map
as the value for the
FlowGraph.EDGE_KEY_FALSE
, if that key is present in
edgeKeys.
remainingItem
- the Item
to be placed in the returned
Map
as the value for any edge key other than
FlowGraph.EDGE_KEY_TRUE
or
FlowGraph.EDGE_KEY_FALSE
, if any happen to be
present in
edgeKeys.
edgeKeys
- the Set
of EdgeKey
s to be used
as keys in the returned Map
.Map
containing a mapping from every
EdgeKey
in edgeKeys
to the
Item i
.protected final java.util.List<FlowItem> filterItemsNonError(java.util.List<FlowItem> items, java.util.List<FlowGraph.EdgeKey> itemKeys)
Item
s to contain only Item
s
that are not associated with error flows, that is, only
Item
s whose associated EdgeKey
s are not
FlowGraph.ExceptionEdgeKey
s with a type that is a subclass
of TypeSystem.Error()
.items
- List of Items to filteritemKeys
- List of EdgeKey
s corresponding
to the edge keys for the Item
s in items
.FlowGraph.ExceptionEdgeKey
s with
whose exception types are Error
s.protected final java.util.List<FlowItem> filterItemsNonException(java.util.List<FlowItem> items, java.util.List<FlowGraph.EdgeKey> itemKeys)
Item
s to contain only Item
s
that are not associated with exception flows, that is, only
Item
s whose associated EdgeKey
s are not
FlowGraph.ExceptionEdgeKey
s.items
- List of Items to filteritemKeys
- List of EdgeKey
s corresponding
to the edge keys for the Item
s in items
.FlowGraph.ExceptionEdgeKey
s.protected final java.util.List<FlowItem> filterItemsExceptionSubclass(java.util.List<FlowItem> items, java.util.List<FlowGraph.EdgeKey> itemKeys, Type excType)
Item
s to contain only Item
s
that are associated with exception flows, whose exception is a subclass
of excType
. That is, only
Item
s whose associated EdgeKey
s are
FlowGraph.ExceptionEdgeKey
s, with the type a subclass
of excType
.items
- List of Items to filteritemKeys
- List of EdgeKey
s corresponding
to the edge keys for the Item
s in items
.excType
- an Exception Type
.FlowGraph.ExceptionEdgeKey
s.protected final java.util.List<FlowItem> filterItems(java.util.List<FlowItem> items, java.util.List<FlowGraph.EdgeKey> itemKeys, FlowGraph.EdgeKey filterEdgeKey)
Item
s to contain only Item
s
that are associated with the given EdgeKey
.items
- List of Items to filteritemKeys
- List of EdgeKey
s corresponding
to the edge keys for the Item
s in items
.filterEdgeKey
- the EdgeKey
to use as a filter.filterEdgeKey
s.protected static final boolean hasTrueFalseBranches(java.util.Set<FlowGraph.EdgeKey> edgeKeys)
EdgeKey
s Edge_KEY_TRUE
and
Edge_KEY_FALSE
.edgeKeys
- the Set
of EdgeKey
s of the
successor edges of a given node.edgeKeys
contains both
Edge_KEY_TRUE
and
Edge_KEY_FALSE
@Deprecated protected static <FlowItem extends DataFlow.Item> java.util.Map<FlowGraph.EdgeKey,FlowItem> constructItemsFromCondition(Expr booleanCond, FlowItem startingItem, java.util.Set<FlowGraph.EdgeKey> succEdgeKeys, DataFlow.ConditionNavigator<FlowItem> navigator)
Item
s for the
FlowGraph.EDGE_KEY_TRUE
and
FlowGraph.EDGE_KEY_FALSE
edges from a boolean condition.booleanCond
- the boolean condition that is used to branch on. The
type of the expression must be boolean.startingItem
- the Item
at the start of the flow for
the expression booleanCond
.succEdgeKeys
- the set of EdgeKeys
of the successor
nodes of the current node. Must contain both
FlowGraph.EDGE_KEY_TRUE
and FlowGraph.EDGE_KEY_FALSE
.navigator
- an instance of ConditionNavigator
to be
used to generate appropriate Item
s from the
boolean condition.Map
containing mappings for all entries in
succEdgeKeys
.
FlowGraph.EDGE_KEY_TRUE
and
FlowGraph.EDGE_KEY_FALSE
map to Item
s calculated for them using
navigator, and all other objects in
succEdgeKeys
are mapped to
startingItem
.