public class Cfg extends Object implements Graph<CfgNode<?>,CfgEdge,CfgTransformer>
Constructor and Description |
---|
Cfg() |
Modifier and Type | Method and Description |
---|---|
void |
addGraphInEdge(CfgEdge edge)
Add graph incoming edge.
|
void |
addGraphOutEdge(CfgEdge edge)
Add graph outgoing edge.
|
void |
addIn(CfgNode<?> node,
CfgEdge edge)
Add incoming edge to the node.
|
<N extends CfgNode<?>> |
addNode(N node)
Add new node to the graph.
|
void |
addOut(CfgNode<?> node,
CfgEdge edge)
Add outgoing edge from the node.
|
Object |
getEdgeData(CfgEdge edge) |
CfgNode<?> |
getEnd(CfgEdge e)
Returns edge end node.
|
ArrayList<CfgEdge> |
getGraphInEdges()
Returns graph incoming edges.
|
ArrayList<CfgEdge> |
getGraphOutEdges()
Returns graph outgoing edges.
|
List<CfgEdge> |
getInEdges(CfgNode<?> cfgNode)
Returns edges coming into node.
|
ArrayList<CfgNode<?>> |
getNodes()
Returns all nodes in the graph.
|
List<CfgEdge> |
getOutEdges(CfgNode<?> cfgNode)
Returns edges originating from the node.
|
CfgNode<?> |
getStart(CfgEdge e)
Returns edge start node.
|
String |
print()
Returns string representation of the graph.
|
void |
setEdgeData(CfgEdge edge,
Object data) |
String |
toString() |
boolean |
transform(CfgNode<?> node,
CfgTransformer actualizer)
Transforms the node with transformer.
|
public void addGraphInEdge(CfgEdge edge)
public void addGraphOutEdge(CfgEdge edge)
public <N extends CfgNode<?>> N addNode(N node)
public Object getEdgeData(CfgEdge edge)
getEdgeData
in interface Graph<CfgNode<?>,CfgEdge,CfgTransformer>
public CfgNode<?> getEnd(CfgEdge e)
getEnd
in interface Graph<CfgNode<?>,CfgEdge,CfgTransformer>
public ArrayList<CfgEdge> getGraphInEdges()
getGraphInEdges
in interface Graph<CfgNode<?>,CfgEdge,CfgTransformer>
public ArrayList<CfgEdge> getGraphOutEdges()
getGraphOutEdges
in interface Graph<CfgNode<?>,CfgEdge,CfgTransformer>
public List<CfgEdge> getInEdges(CfgNode<?> cfgNode)
getInEdges
in interface Graph<CfgNode<?>,CfgEdge,CfgTransformer>
public ArrayList<CfgNode<?>> getNodes()
getNodes
in interface Graph<CfgNode<?>,CfgEdge,CfgTransformer>
public List<CfgEdge> getOutEdges(CfgNode<?> cfgNode)
getOutEdges
in interface Graph<CfgNode<?>,CfgEdge,CfgTransformer>
public CfgNode<?> getStart(CfgEdge e)
getStart
in interface Graph<CfgNode<?>,CfgEdge,CfgTransformer>
public String print()
print
in interface Graph<CfgNode<?>,CfgEdge,CfgTransformer>
public void setEdgeData(CfgEdge edge, Object data)
setEdgeData
in interface Graph<CfgNode<?>,CfgEdge,CfgTransformer>
public boolean transform(CfgNode<?> node, CfgTransformer actualizer)
transform
in interface Graph<CfgNode<?>,CfgEdge,CfgTransformer>
true
if there were changes made by transformer. While
transformation should be always sound, it might be impossible to apply
it in current context due to complexities of underlying structures. E.g.
it is impossible to delete if statement test expression, while it is not
evaluated if statement is not reachable. In this case transformer can
return false
and do no changes.Copyright © 2018. All rights reserved.