Class DOTCFGVisualizer<V extends AbstractValue<V>,S extends Store<S>,T extends TransferFunction<V,S>>   
java.lang.Object
org.checkerframework.dataflow.cfg.visualize.AbstractCFGVisualizer<V,S,T>
  
org.checkerframework.dataflow.cfg.visualize.DOTCFGVisualizer<V,S,T>  
- All Implemented Interfaces:
- CFGVisualizer<V,- S, - T> 
public class DOTCFGVisualizer<V extends AbstractValue<V>,S extends Store<S>,T extends TransferFunction<V,S>>   
extends AbstractCFGVisualizer<V,S,T>  
Generate a graph description in the DOT language of a control graph.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.checkerframework.dataflow.cfg.visualize.AbstractCFGVisualizerAbstractCFGVisualizer.VisualizeWhere
- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe (optional) checker name.Mapping from class/method representation to generated dot file.protected static final StringTerminator for lines that are left-justified.protected StringThe output directory.Fields inherited from class org.checkerframework.dataflow.cfg.visualize.AbstractCFGVisualizerlineSeparator, storeEntryIndent, verbose
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected StringCreate a dot file and return its name.protected StringFormat the given object as a String suitable for the output format, i.e.Returns the separator for lines within a node's representation.voidInitialization method guaranteed to be called once before the first invocation ofCFGVisualizer.visualize(org.checkerframework.dataflow.cfg.ControlFlowGraph, org.checkerframework.dataflow.cfg.block.Block, org.checkerframework.dataflow.analysis.Analysis<V, S, T>).voidshutdown()Write a filemethods.txtthat contains a mapping from source code location to generated dot file.Output a visualization representing the control flow graph starting atentry.Visualize a block based on the analysis.Visualize the transferInput after a Block based on the analysis.Visualize the transferInput before a Block based on the analysis.Visualize a ConditionalBlock.protected StringvisualizeEdge(Object sId, Object eId, String flowRule) Generate the String representation of an edge.protected StringReturn the footer of the generated graph.protected StringReturn the header of the generated graph.visualizeNodes(Set<Block> blocks, ControlFlowGraph cfg, @Nullable Analysis<V, S, T> analysis) Generate the String representation of the nodes of a control flow graph.Visualize a SpecialBlock.visualizeStoreArrayVal(ArrayAccess arrayValue, V value) Called byCFAbstractStore#internalVisualize()to visualize the value of one array collected by this Store.visualizeStoreClassVals(ClassName className, V value) Called byCFAbstractStore#internalVisualize()to visualize the value of class names collected by this Store.visualizeStoreFieldVal(FieldAccess fieldAccess, V value) Called byCFAbstractStore#internalVisualize()to visualize the value of one field collected by this Store.visualizeStoreKeyVal(String keyName, Object value) Called byCFAbstractStore#internalVisualize()to visualize the specific information collected according to the specific kind of Store.visualizeStoreLocalVar(LocalVariable localVar, V value) Called byCFAbstractStore#internalVisualize()to visualize a local variable.visualizeStoreMethodVals(MethodCall methodCall, V value) Called byCFAbstractStore#internalVisualize()to visualize the value of pure method calls collected by this Store.visualizeStoreThisVal(V value) Called byCFAbstractStore#internalVisualize()to visualize the value of the current objectthisin this Store.Methods inherited from class org.checkerframework.dataflow.cfg.visualize.AbstractCFGVisualizeraddBlock, addBlockContent, getNodeSimpleName, getProcessOrder, getProcessOrderSimpleString, handleSuccessorsHelper, loopOverBlockContents, visualizeBlockHelper, visualizeBlockNode, visualizeBlockTransferInputHelper, visualizeGraph, visualizeGraphWithoutHeaderAndFooter, visualizeSpecialBlockHelper, visualizeStore
- 
Field Details- 
outDirThe output directory.
- 
checkerNameThe (optional) checker name. Used as a part of the name of the output dot file.
- 
generatedMapping from class/method representation to generated dot file.
- 
leftJustifiedTerminatorTerminator for lines that are left-justified.- See Also:
 
 
- 
- 
Constructor Details- 
DOTCFGVisualizerpublic DOTCFGVisualizer()
 
- 
- 
Method Details- 
initDescription copied from interface:CFGVisualizerInitialization method guaranteed to be called once before the first invocation ofCFGVisualizer.visualize(org.checkerframework.dataflow.cfg.ControlFlowGraph, org.checkerframework.dataflow.cfg.block.Block, org.checkerframework.dataflow.analysis.Analysis<V, S, T>).- Specified by:
- initin interface- CFGVisualizer<V extends AbstractValue<V>,- S extends Store<S>, - T extends TransferFunction<V, - S>> 
- Overrides:
- initin class- AbstractCFGVisualizer<V extends AbstractValue<V>,- S extends Store<S>, - T extends TransferFunction<V, - S>> 
- Parameters:
- args- implementation-dependent options
 
- 
getSeparatorDescription copied from interface:CFGVisualizerReturns the separator for lines within a node's representation.- Returns:
- the separator for lines within a node's representation
 
- 
visualizepublic @Nullable Map<String,Object> visualize(ControlFlowGraph cfg, Block entry, @Nullable Analysis<V, S, T> analysis) Description copied from interface:CFGVisualizerOutput a visualization representing the control flow graph starting atentry. The concrete actions are implementation dependent.An invocation visualize(cfg, entry, null);does not output stores at the beginning of basic blocks.- Parameters:
- 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- Stores that are valid at the beginning of basic blocks reachable from- entryand per-node information for value producing- Nodes. Can also be- nullto indicate that this information should not be output.
- Returns:
- visualization results, e.g. generated file names (DOTCFGVisualizer) or a String representation of the CFG (StringCFGVisualizer)
 
- 
visualizeNodespublic String visualizeNodes(Set<Block> blocks, ControlFlowGraph cfg, @Nullable Analysis<V, S, T> analysis) Description copied from class:AbstractCFGVisualizerGenerate the String representation of the nodes of a control flow graph.- Specified by:
- visualizeNodesin class- AbstractCFGVisualizer<V extends AbstractValue<V>,- S extends Store<S>, - T extends TransferFunction<V, - S>> 
- Parameters:
- blocks- the set of all the blocks in a control flow graph
- cfg- the control flow graph
- analysis- the current analysis
- Returns:
- the String representation of the nodes
 
- 
visualizeEdgeDescription copied from class:AbstractCFGVisualizerGenerate the String representation of an edge.- Specified by:
- visualizeEdgein class- AbstractCFGVisualizer<V extends AbstractValue<V>,- S extends Store<S>, - T extends TransferFunction<V, - S>> 
- Parameters:
- sId- a representation of the current block, such as its ID
- eId- a representation of the successor block, such as its ID
- flowRule- the content of the edge
- Returns:
- the String representation of the edge
 
- 
visualizeBlockDescription copied from interface:CFGVisualizerVisualize a block based on the analysis.- Parameters:
- bb- the block
- analysis- the current analysis
- Returns:
- the String representation of the given block
 
- 
visualizeSpecialBlockDescription copied from interface:CFGVisualizerVisualize a SpecialBlock.- Parameters:
- sbb- the special block
- Returns:
- the String representation of the type of the special block sbb: entry, exit, or exceptional-exit
 
- 
visualizeConditionalBlockDescription copied from interface:CFGVisualizerVisualize a ConditionalBlock.- Parameters:
- cbb- the conditional block
- Returns:
- the String representation of the conditional block
 
- 
visualizeBlockTransferInputBeforeDescription copied from interface:CFGVisualizerVisualize the transferInput before a Block based on the analysis.- Parameters:
- bb- the block
- analysis- the current analysis
- Returns:
- the String representation of the transferInput before the given block
 
- 
visualizeBlockTransferInputAfterDescription copied from interface:CFGVisualizerVisualize the transferInput after a Block based on the analysis.- Parameters:
- bb- the block
- analysis- the current analysis
- Returns:
- the String representation of the transferInput after the given block
 
- 
dotOutputFileNameCreate a dot file and return its name.- Parameters:
- ast- an abstract syntax tree
- Returns:
- the file name used for DOT output
 
- 
formatDescription copied from class:AbstractCFGVisualizerFormat the given object as a String suitable for the output format, i.e. with format-specific characters escaped.- Specified by:
- formatin class- AbstractCFGVisualizer<V extends AbstractValue<V>,- S extends Store<S>, - T extends TransferFunction<V, - S>> 
- Parameters:
- obj- an object
- Returns:
- the formatted String from the given object
 
- 
visualizeStoreThisValDescription copied from interface:CFGVisualizerCalled byCFAbstractStore#internalVisualize()to visualize the value of the current objectthisin this Store.- Parameters:
- value- the value of the current object- this
- Returns:
- the String representation of this
 
- 
visualizeStoreLocalVarDescription copied from interface:CFGVisualizerCalled byCFAbstractStore#internalVisualize()to visualize a local variable.- Parameters:
- localVar- the local variable
- value- the value of the local variable
- Returns:
- the String representation of the local variable
 
- 
visualizeStoreFieldValDescription copied from interface:CFGVisualizerCalled byCFAbstractStore#internalVisualize()to visualize the value of one field collected by this Store.- Parameters:
- fieldAccess- the field
- value- the value of the field
- Returns:
- the String representation of the field
 
- 
visualizeStoreArrayValDescription copied from interface:CFGVisualizerCalled byCFAbstractStore#internalVisualize()to visualize the value of one array collected by this Store.- Parameters:
- arrayValue- the array
- value- the value of the array
- Returns:
- the String representation of the array
 
- 
visualizeStoreMethodValsDescription copied from interface:CFGVisualizerCalled byCFAbstractStore#internalVisualize()to visualize the value of pure method calls collected by this Store.- Parameters:
- methodCall- the pure method call
- value- the value of the pure method call
- Returns:
- the String representation of the pure method call
 
- 
visualizeStoreClassValsDescription copied from interface:CFGVisualizerCalled byCFAbstractStore#internalVisualize()to visualize the value of class names collected by this Store.- Parameters:
- className- the class name
- value- the value of the class name
- Returns:
- the String representation of the class name
 
- 
visualizeStoreKeyValDescription copied from interface:CFGVisualizerCalled byCFAbstractStore#internalVisualize()to visualize the specific information collected according to the specific kind of Store. Currently, these Stores call this method:LockStore,NullnessStore, andInitializationStoreto visualize additional information.- Parameters:
- keyName- the name of the specific information to be visualized
- value- the value of the specific information to be visualized
- Returns:
- the String representation of the specific information
 
- 
shutdownpublic void shutdown()Write a filemethods.txtthat contains a mapping from source code location to generated dot file.
- 
visualizeGraphHeaderDescription copied from class:AbstractCFGVisualizerReturn the header of the generated graph.- Specified by:
- visualizeGraphHeaderin class- AbstractCFGVisualizer<V extends AbstractValue<V>,- S extends Store<S>, - T extends TransferFunction<V, - S>> 
- Returns:
- the String representation of the header of the control flow graph
 
 
-