|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsoot.util.cfgcmd.CFGToDotGraph
public class CFGToDotGraph
Class that creates a DotGraph
visualization
of a control flow graph.
Constructor Summary | |
---|---|
CFGToDotGraph()
Returns a CFGToDotGraph converter which will draw the graph as a single arbitrarily-sized page, with full-length node labels. |
Method Summary | ||
---|---|---|
DotGraph |
drawCFG(DirectedGraph graph,
Body body)
Create a DotGraph whose nodes and edges depict
a control flow graph without distinguished
exceptional edges. |
|
|
drawCFG(ExceptionalGraph<N> graph)
Create a DotGraph whose nodes and edges depict the
control flow in a ExceptionalGraph , with
distinguished edges for exceptional control flow. |
|
void |
setBriefLabels(boolean useBrief)
Specify whether to abbreviate the text in node labels. |
|
void |
setExceptionalControlFlowAttr(String id,
String value)
Specify the dot graph attribute to use for exceptional control flow edges. |
|
void |
setExceptionEdgeAttr(String id,
String value)
Specify the dot graph attribute to use for edges depicting the exceptions each node may throw, and their handlers. |
|
void |
setHeadAttr(String id,
String value)
Specify the dot graph attribute to use for head nodes (in addition to filling in the nodes). |
|
void |
setOnePage(boolean onePage)
Specify whether to split the graph into pages. |
|
void |
setShowExceptions(boolean showExceptions)
Specify whether the graph should depict the exceptions which each node may throw, in the form of an edge from the throwing node to the handler (if any), labeled with the possible exception types. |
|
void |
setTailAttr(String id,
String value)
Specify the dot graph attribute to use for tail nodes (in addition to filling in the nodes). |
|
void |
setUnexceptionalControlFlowAttr(String id,
String value)
Specify the dot graph attribute to use for regular control flow edges. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CFGToDotGraph()
Returns a CFGToDotGraph converter which will draw the graph as a single arbitrarily-sized page, with full-length node labels.
If asked to draw a ExceptionalGraph
, the
converter will identify the exceptions that will be thrown. By
default, it will distinguish different edges by coloring regular
control flow edges black, exceptional control flow edges red, and
thrown exception edges light gray. Head and tail nodes are filled
in, head nodes with gray, and tail nodes with light gray.
Method Detail |
---|
public void setOnePage(boolean onePage)
onePage
- indicates whether to produce the graph as a
single, arbitrarily-sized page (if onePage
is
true
) or several 8.5x11-inch pages (if
onePage
is false
).public void setBriefLabels(boolean useBrief)
useBrief
- indicates whether to abbreviate the text of
node labels.public void setShowExceptions(boolean showExceptions)
ExceptionalGraph
s.
showExceptions
- indicates whether to show possible exceptions
and their handlers.public void setUnexceptionalControlFlowAttr(String id, String value)
ExceptionalGraph
s.
id
- The attribute name, for example "style" or "color".value
- The attribute value, for example "solid" or "black".public void setExceptionalControlFlowAttr(String id, String value)
ExceptionalGraph
s.
id
- The attribute name, for example "style" or "color".value
- The attribute value, for example "dashed" or "red".public void setExceptionEdgeAttr(String id, String value)
ExceptionalGraph
s.
id
- The attribute name, for example "style" or "color".value
- The attribute value, for example "dotted" or "lightgray".public void setHeadAttr(String id, String value)
id
- The attribute name, for example "fillcolor".value
- The attribute value, for example "gray".public void setTailAttr(String id, String value)
id
- The attribute name, for example "fillcolor".value
- The attribute value, for example "lightgray".public DotGraph drawCFG(DirectedGraph graph, Body body)
DotGraph
whose nodes and edges depict
a control flow graph without distinguished
exceptional edges.
graph
- a DirectedGraph
representing a CFG
(probably an instance of UnitGraph
, BlockGraph
,
or one of their subclasses).body
- the Body
represented by graph
(used
to format the text within nodes). If no body is available, pass
null
.
graph
.public <N> DotGraph drawCFG(ExceptionalGraph<N> graph)
DotGraph
whose nodes and edges depict the
control flow in a ExceptionalGraph
, with
distinguished edges for exceptional control flow.
graph
- the control flow graph
graph
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |