public class CAstControlFlowRecorder extends java.lang.Object implements CAstControlFlowMap
Note that, at present, support for mapping control flow on ast nodes directly is clunky. It is necessary to establish that an ast nodes maps to itself, i.e. call xx.map(node, node).
EXCEPTION_TO_EXIT, SWITCH_DEFAULT| Constructor and Description |
|---|
CAstControlFlowRecorder(CAstSourcePositionMap src) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.Object from,
java.lang.Object to,
java.lang.Object label)
Add a control-flow edge from the `from' node to the `to' node with the (possibly null) label
`label'.
|
void |
addAll(CAstControlFlowMap other) |
java.util.Collection<CAstNode> |
getMappedNodes()
Returns an iterator of all CAstNodes for which this map contains control flow mapping
information.
|
java.util.Set<java.lang.Object> |
getSourceNodes(CAstNode to)
Return a collection of control-flow ast nodes that have this one as a possible target.
|
CAstNode |
getTarget(CAstNode from,
java.lang.Object label)
Return the target ast node of the control-flow instruction denoted by from with respect to the
given label.
|
java.util.Collection<java.lang.Object> |
getTargetLabels(CAstNode from)
Return a collection of all labels for which the control-flow ast node
from has a
target. |
boolean |
isMapped(java.lang.Object node) |
void |
map(java.lang.Object node,
CAstNode ast)
Establish a mapping between some object `node' and the ast node `ast'.
|
java.lang.String |
toString() |
public CAstControlFlowRecorder(CAstSourcePositionMap src)
public CAstNode getTarget(CAstNode from, java.lang.Object label)
CAstControlFlowMapgetTarget in interface CAstControlFlowMappublic java.util.Collection<java.lang.Object> getTargetLabels(CAstNode from)
CAstControlFlowMapfrom has a
target.getTargetLabels in interface CAstControlFlowMappublic java.util.Set<java.lang.Object> getSourceNodes(CAstNode to)
CAstControlFlowMapgetSourceNodes in interface CAstControlFlowMappublic java.util.Collection<CAstNode> getMappedNodes()
CAstControlFlowMapgetMappedNodes in interface CAstControlFlowMappublic void add(java.lang.Object from,
java.lang.Object to,
java.lang.Object label)
public void map(java.lang.Object node,
CAstNode ast)
public void addAll(CAstControlFlowMap other)
public boolean isMapped(java.lang.Object node)
public java.lang.String toString()
toString in class java.lang.Object