public class StringCFGVisualizer<V extends AbstractValue<V>,S extends Store<S>,T extends TransferFunction<V,S>> extends AbstractCFGVisualizer<V,S,T>
AbstractCFGVisualizer.VisualizeWherelineSeparator, storeEntryIndent, verbose| Constructor and Description |
|---|
StringCFGVisualizer() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
format(Object obj)
Format the given object as a String suitable for the output format, i.e.
|
String |
getSeparator()
Returns the separator for lines within a node's representation.
|
void |
shutdown()
Shutdown method called once from the shutdown hook of the
BaseTypeChecker. |
Map<String,Object> |
visualize(ControlFlowGraph cfg,
Block entry,
@Nullable Analysis<V,S,T> analysis)
Output a visualization representing the control flow graph starting at
entry. |
String |
visualizeBlock(Block bb,
@Nullable Analysis<V,S,T> analysis)
Visualize a block based on the analysis.
|
String |
visualizeBlockTransferInputAfter(Block bb,
Analysis<V,S,T> analysis)
Visualize the transferInput after a Block based on the analysis.
|
String |
visualizeBlockTransferInputBefore(Block bb,
Analysis<V,S,T> analysis)
Visualize the transferInput before a Block based on the analysis.
|
String |
visualizeConditionalBlock(ConditionalBlock cbb)
Visualize a ConditionalBlock.
|
protected String |
visualizeEdge(Object sId,
Object eId,
String flowRule)
Generate the String representation of an edge.
|
protected String |
visualizeGraphFooter()
Return the footer of the generated graph.
|
protected String |
visualizeGraphHeader()
Return the header of the generated graph.
|
String |
visualizeNodes(Set<Block> blocks,
ControlFlowGraph cfg,
@Nullable Analysis<V,S,T> analysis)
Generate the String representation of the nodes of a control flow graph.
|
String |
visualizeSpecialBlock(SpecialBlock sbb)
Visualize a SpecialBlock.
|
String |
visualizeStoreArrayVal(ArrayAccess arrayValue,
V value)
Called by
CFAbstractStore#internalVisualize() to visualize the value of one array
collected by this Store. |
String |
visualizeStoreClassVals(ClassName className,
V value)
Called by
CFAbstractStore#internalVisualize() to visualize the value of class names
collected by this Store. |
String |
visualizeStoreFieldVal(FieldAccess fieldAccess,
V value)
Called by
CFAbstractStore#internalVisualize() to visualize the value of one field
collected by this Store. |
String |
visualizeStoreKeyVal(String keyName,
Object value)
Called by
CFAbstractStore#internalVisualize() to visualize the specific information
collected according to the specific kind of Store. |
String |
visualizeStoreLocalVar(LocalVariable localVar,
V value)
Called by
CFAbstractStore#internalVisualize() to visualize a local variable. |
String |
visualizeStoreMethodVals(MethodCall methodCall,
V value)
Called by
CFAbstractStore#internalVisualize() to visualize the value of pure method
calls collected by this Store. |
String |
visualizeStoreThisVal(V value)
Called by
CFAbstractStore#internalVisualize() to visualize the value of the current
object this in this Store. |
addBlock, addBlockContent, getNodeSimpleName, getProcessOrder, getProcessOrderSimpleString, handleSuccessorsHelper, init, loopOverBlockContents, visualizeBlockHelper, visualizeBlockNode, visualizeBlockTransferInputHelper, visualizeGraph, visualizeGraphWithoutHeaderAndFooter, visualizeSpecialBlockHelper, visualizeStorepublic String getSeparator()
CFGVisualizerpublic Map<String,Object> visualize(ControlFlowGraph cfg, Block entry, @Nullable Analysis<V,S,T> analysis)
CFGVisualizerentry. 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 visualizeentry - the entry node of the control flow graph to be representedanalysis - an analysis containing information about the program represented by the CFG.
The information includes Stores that are valid at the beginning of basic blocks
reachable from entry and per-node information for value producing Nodes.
Can also be null to indicate that this information should not be output.DOTCFGVisualizer) or a
String representation of the CFG (StringCFGVisualizer)public String visualizeNodes(Set<Block> blocks, ControlFlowGraph cfg, @Nullable Analysis<V,S,T> analysis)
AbstractCFGVisualizervisualizeNodes in class AbstractCFGVisualizer<V extends AbstractValue<V>,S extends Store<S>,T extends TransferFunction<V,S>>blocks - the set of all the blocks in a control flow graphcfg - the control flow graphanalysis - the current analysisprotected String visualizeEdge(Object sId, Object eId, String flowRule)
AbstractCFGVisualizervisualizeEdge in class AbstractCFGVisualizer<V extends AbstractValue<V>,S extends Store<S>,T extends TransferFunction<V,S>>sId - a representation of the current block, such as its IDeId - a representation of the successor block, such as its IDflowRule - the content of the edgepublic String visualizeBlock(Block bb, @Nullable Analysis<V,S,T> analysis)
CFGVisualizerbb - the blockanalysis - the current analysispublic String visualizeSpecialBlock(SpecialBlock sbb)
CFGVisualizersbb - the special blocksbb: entry, exit,
or exceptional-exitpublic String visualizeConditionalBlock(ConditionalBlock cbb)
CFGVisualizercbb - the conditional blockpublic String visualizeBlockTransferInputBefore(Block bb, Analysis<V,S,T> analysis)
CFGVisualizerbb - the blockanalysis - the current analysispublic String visualizeBlockTransferInputAfter(Block bb, Analysis<V,S,T> analysis)
CFGVisualizerbb - the blockanalysis - the current analysisprotected String format(Object obj)
AbstractCFGVisualizerformat in class AbstractCFGVisualizer<V extends AbstractValue<V>,S extends Store<S>,T extends TransferFunction<V,S>>obj - an objectpublic String visualizeStoreThisVal(V value)
CFGVisualizerCFAbstractStore#internalVisualize() to visualize the value of the current
object this in this Store.value - the value of the current object thisthispublic String visualizeStoreLocalVar(LocalVariable localVar, V value)
CFGVisualizerCFAbstractStore#internalVisualize() to visualize a local variable.localVar - the local variablevalue - the value of the local variablepublic String visualizeStoreFieldVal(FieldAccess fieldAccess, V value)
CFGVisualizerCFAbstractStore#internalVisualize() to visualize the value of one field
collected by this Store.fieldAccess - the fieldvalue - the value of the fieldpublic String visualizeStoreArrayVal(ArrayAccess arrayValue, V value)
CFGVisualizerCFAbstractStore#internalVisualize() to visualize the value of one array
collected by this Store.arrayValue - the arrayvalue - the value of the arraypublic String visualizeStoreMethodVals(MethodCall methodCall, V value)
CFGVisualizerCFAbstractStore#internalVisualize() to visualize the value of pure method
calls collected by this Store.methodCall - the pure method callvalue - the value of the pure method callpublic String visualizeStoreClassVals(ClassName className, V value)
CFGVisualizerCFAbstractStore#internalVisualize() to visualize the value of class names
collected by this Store.className - the class namevalue - the value of the class namepublic String visualizeStoreKeyVal(String keyName, Object value)
CFGVisualizerCFAbstractStore#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 visualizedpublic void shutdown()
BaseTypeChecker.
StringCFGVisualizer does not write into file, so left intentionally blank.
protected String visualizeGraphHeader()
StringCFGVisualizer does not need a specific header, so just return an empty string.
visualizeGraphHeader in class AbstractCFGVisualizer<V extends AbstractValue<V>,S extends Store<S>,T extends TransferFunction<V,S>>protected String visualizeGraphFooter()
StringCFGVisualizer does not need a specific footer, so just return an empty string.
visualizeGraphFooter in class AbstractCFGVisualizer<V extends AbstractValue<V>,S extends Store<S>,T extends TransferFunction<V,S>>