|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.cast.tree.impl.CAstControlFlowRecorder
public class CAstControlFlowRecorder
An implementation of a CAstControlFlowMap that is designed to be used by producers of CAPA asts. In addition to implementing the control flow map, it additionally allows clients to record control flow mappings in terms of some arbitrary type object that are then mapped to CAstNodes by the client. These objects can be anything, but one common use is that some type of parse tree is walked to build a capa ast, with control flow being recorded in terms of parse tree nodes and then ast nodes being mapped to parse tree nodes. 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).
| Field Summary |
|---|
| Fields inherited from interface com.ibm.wala.cast.tree.CAstControlFlowMap |
|---|
EXCEPTION_TO_EXIT, SWITCH_DEFAULT |
| Constructor Summary | |
|---|---|
CAstControlFlowRecorder(CAstSourcePositionMap src)
|
|
| Method Summary | |
|---|---|
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'. |
java.util.Collection<CAstNode> |
getMappedNodes()
Returns an iterator of all CAstNodes for which this map contains control flow mapping information. |
java.util.Collection |
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CAstControlFlowRecorder(CAstSourcePositionMap src)
| Method Detail |
|---|
public CAstNode getTarget(CAstNode from,
java.lang.Object label)
CAstControlFlowMap
getTarget in interface CAstControlFlowMappublic java.util.Collection<java.lang.Object> getTargetLabels(CAstNode from)
CAstControlFlowMapfrom has a target.
getTargetLabels in interface CAstControlFlowMappublic java.util.Collection getSourceNodes(CAstNode to)
CAstControlFlowMap
getSourceNodes in interface CAstControlFlowMappublic java.util.Collection<CAstNode> getMappedNodes()
CAstControlFlowMap
getMappedNodes in interface CAstControlFlowMap
public void add(java.lang.Object from,
java.lang.Object to,
java.lang.Object label)
public void map(java.lang.Object node,
CAstNode ast)
public boolean isMapped(java.lang.Object node)
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 | ||||||||