Class StringCFGVisualizer<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.StringCFGVisualizer<V,S,T>  
- All Implemented Interfaces:
- CFGVisualizer<V,- S, - T> 
public class StringCFGVisualizer<V extends AbstractValue<V>,S extends Store<S>,T extends TransferFunction<V,S>>   
extends AbstractCFGVisualizer<V,S,T>  
Generate the String representation of a control flow graph.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.checkerframework.dataflow.cfg.visualize.AbstractCFGVisualizerAbstractCFGVisualizer.VisualizeWhere
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected PrintStreamStream to output String representation to.Fields inherited from class org.checkerframework.dataflow.cfg.visualize.AbstractCFGVisualizerlineSeparator, storeEntryIndent, verbose
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected 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>)orCFGVisualizer.visualizeWithAction(org.checkerframework.dataflow.cfg.ControlFlowGraph, org.checkerframework.dataflow.cfg.block.Block, org.checkerframework.dataflow.analysis.Analysis<V, S, T>).voidshutdown()Shutdown method called once from the shutdown hook of theBaseTypeChecker.Creates 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.visualizeWithAction(ControlFlowGraph cfg, Block entry, @Nullable Analysis<V, S, T> analysis) Output a visualization representing the control flow graph starting atentry.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- 
outStream to output String representation to.
 
- 
- 
Constructor Details- 
StringCFGVisualizerpublic StringCFGVisualizer()Create a StringCFGVisualizer.
 
- 
- 
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>)orCFGVisualizer.visualizeWithAction(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 Map<String,Object> visualize(ControlFlowGraph cfg, Block entry, @Nullable Analysis<V, S, T> analysis) Description copied from interface:CFGVisualizerCreates a visualization representing the control flow graph starting atentry. The keys and values in the returned map are implementation dependent. The method should not perform any actions.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)
- See Also:
 
- 
visualizeWithActionpublic Map<String,Object> visualizeWithAction(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 keys and values in the returned map are implementation dependent. The concrete actions are implementation dependent, and can include outputting information and producing files.An invocation visualizeWithAction(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)
- See Also:
 
- 
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
 
- 
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()Shutdown method called once from the shutdown hook of theBaseTypeChecker.StringCFGVisualizer does not write into file, so left intentionally blank. 
- 
visualizeGraphHeaderReturn the header of the generated graph.StringCFGVisualizer does not need a specific header, so just return an empty string. - 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
 
 
-