public interface CFGVisualizer<A extends AbstractValue<A>,S extends Store<S>,T extends TransferFunction<A,S>>
Modifier and Type | Method and Description |
---|---|
void |
init(Map<String,Object> args)
Initialization method guaranteed to be called once before the
first invocation of
visualize . |
void |
shutdown()
Shutdown method called once from the shutdown hook of the
BaseTypeChecker . |
@Nullable Map<String,Object> |
visualize(ControlFlowGraph cfg,
Block entry,
@Nullable Analysis<A,S,T> analysis)
Output a visualization representing the control flow graph starting
at
entry . |
void |
visualizeBlock(Block bb,
@Nullable Analysis<A,S,T> analysis)
Visualize a block based on the analysis.
|
void |
visualizeBlockNode(Node t,
@Nullable Analysis<A,S,T> analysis)
Visualize a Node based on the analysis.
|
void |
visualizeBlockTransferInput(Block bb,
Analysis<A,S,T> analysis)
Visualize the transferInput of a Block based on the analysis.
|
void |
visualizeSpecialBlock(SpecialBlock sbb)
Visualize a SpecialBlock.
|
void |
visualizeStore(S store)
Delegate the visualization responsibility
to the passed
Store instance, which will call back to this
visualizer instance for sub-components. |
void |
visualizeStoreArrayVal(FlowExpressions.ArrayAccess arrayValue,
A value)
Called by
CFAbstractStore#internalVisualize() to visualize
the value of arrays collected by this Store. |
void |
visualizeStoreClassVals(FlowExpressions.ClassName className,
A value)
Called by
CFAbstractStore#internalVisualize() to visualize
the value of class names collected by this Store. |
void |
visualizeStoreFieldVals(FlowExpressions.FieldAccess fieldAccess,
A value)
Called by
CFAbstractStore#internalVisualize() to visualize
the value of fields collected by this Store. |
void |
visualizeStoreFooter()
Called by
CFAbstractStore to visualize
any information after the invocation of CFAbstractStore#internalVisualize() . |
void |
visualizeStoreHeader(String classCanonicalName)
Called by a
CFAbstractStore to visualize
the class name before calling the
CFAbstractStore#internalVisualize() method. |
void |
visualizeStoreKeyVal(String keyName,
Object value)
Called by
CFAbstractStore#internalVisualize() to visualize
the specific information collected according to the specific kind of Store. |
void |
visualizeStoreLocalVar(FlowExpressions.LocalVariable localVar,
A value)
Called by
CFAbstractStore#internalVisualize() to visualize
a local variable. |
void |
visualizeStoreMethodVals(FlowExpressions.MethodCall methodCall,
A value)
Called by
CFAbstractStore#internalVisualize() to visualize
the value of pure method calls collected by this Store. |
void |
visualizeStoreThisVal(A value)
Called by
CFAbstractStore#internalVisualize() to visualize
the value of the current object this in this Store. |
void init(Map<String,Object> args)
visualize
.args
- implementation-dependent options@Nullable Map<String,Object> visualize(ControlFlowGraph cfg, Block entry, @Nullable Analysis<A,S,T> analysis)
entry
.
The concrete actions are implementation dependent.
An invocation visualize(cfg, entry, null);
does not
output stores at the beginning of basic blocks.cfg
- The CFG to visualize.entry
- The entry node of the control flow graph to be represented.analysis
- An analysis containing information about the program
represented by the CFG. The information includes Store
s
that are valid at the beginning of basic blocks reachable
from entry
and per-node information for value
producing Node
s. Can also be null
to
indicate that this information should not be output.void visualizeStore(S store)
Store
instance, which will call back to this
visualizer instance for sub-components.store
- the store to visualizevoid visualizeStoreHeader(String classCanonicalName)
CFAbstractStore
to visualize
the class name before calling the
CFAbstractStore#internalVisualize()
method.classCanonicalName
- the canonical name of the classvoid visualizeStoreLocalVar(FlowExpressions.LocalVariable localVar, A value)
CFAbstractStore#internalVisualize()
to visualize
a local variable.localVar
- the local variablevalue
- the value of the local variablevoid visualizeStoreThisVal(A value)
CFAbstractStore#internalVisualize()
to visualize
the value of the current object this
in this Store.value
- the value of the current object thisvoid visualizeStoreFieldVals(FlowExpressions.FieldAccess fieldAccess, A value)
CFAbstractStore#internalVisualize()
to visualize
the value of fields collected by this Store.fieldAccess
- the fieldvalue
- the value of the fieldvoid visualizeStoreArrayVal(FlowExpressions.ArrayAccess arrayValue, A value)
CFAbstractStore#internalVisualize()
to visualize
the value of arrays collected by this Store.arrayValue
- the arrayvalue
- the value of the arrayvoid visualizeStoreMethodVals(FlowExpressions.MethodCall methodCall, A value)
CFAbstractStore#internalVisualize()
to visualize
the value of pure method calls collected by this Store.methodCall
- the pure method callvalue
- the value of the pure method callvoid visualizeStoreClassVals(FlowExpressions.ClassName className, A value)
CFAbstractStore#internalVisualize()
to visualize
the value of class names collected by this Store.className
- the class namevalue
- the value of the class namevoid visualizeStoreKeyVal(String keyName, Object value)
CFAbstractStore#internalVisualize()
to visualize
the specific information collected according to the specific kind of Store.
Currently, these Stores call this method: LockStore
,
NullnessStore
, and InitializationStore
to visualize additional
information.keyName
- the name of the specific information to be visualizedvalue
- the value of the specific information to be visualizedvoid visualizeStoreFooter()
CFAbstractStore
to visualize
any information after the invocation of CFAbstractStore#internalVisualize()
.void visualizeBlock(Block bb, @Nullable Analysis<A,S,T> analysis)
bb
- the blockanalysis
- the current analysisvoid visualizeSpecialBlock(SpecialBlock sbb)
sbb
- the special blockvoid visualizeBlockTransferInput(Block bb, Analysis<A,S,T> analysis)
bb
- the blockanalysis
- the current analysisvoid visualizeBlockNode(Node t, @Nullable Analysis<A,S,T> analysis)
t
- the nodeanalysis
- the current analysisvoid shutdown()
BaseTypeChecker
.