Class CFGVisualizeLauncher
java.lang.Object
org.checkerframework.dataflow.cfg.visualize.CFGVisualizeLauncher
Launcher to generate the DOT or String representation of the control flow graph of a given method
in a given class.
Usage: Directly run it as the main class to generate the DOT representation of the control
flow graph of a given method in a given class. See ConstantPropagationPdf
for another way to use it.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V extends AbstractValue<V>,
S extends Store<S>, T extends TransferFunction<V, S>>
voidgenerateDOTofCFG
(ControlFlowGraph cfg, String outputDir, boolean pdf, boolean verbose, @Nullable Analysis<V, S, T> analysis) Generate the DOT and PDF representations of the CFG for a method.static ControlFlowGraph
Generate the control flow graph of a method in a class.static void
The main entry point of CFGVisualizeLauncher.static <V extends AbstractValue<V>,
S extends Store<S>, T extends TransferFunction<V, S>>
voidperformAnalysis
(CFGVisualizeOptions config, @Nullable Analysis<V, S, T> analysis) Generate a visualization of the CFG of a method to a file, optionally running an analysis.static void
writeStringOfCFG
(String inputFile, String method, String clas, String outputFile, Analysis<?, ?, ?> analysis) Write generated String representation of the CFG for a method to a file.static void
writeStringOfCFG
(ControlFlowGraph cfg, String outputFile, Analysis<?, ?, ?> analysis) Write generated String representation of the CFG for a method to a file.
-
Method Details
-
main
The main entry point of CFGVisualizeLauncher.- Parameters:
args
- command-line arguments
-
performAnalysis
public static <V extends AbstractValue<V>,S extends Store<S>, void performAnalysisT extends TransferFunction<V, S>> (CFGVisualizeOptions config, @Nullable Analysis<V, S, T> analysis) Generate a visualization of the CFG of a method to a file, optionally running an analysis.- Type Parameters:
V
- the abstract value type of the analysisS
- the store type of the analysisT
- the transfer function type of the analysis- Parameters:
config
- CFGVisualizeOptions that includes input file, output directory, method name, and class nameanalysis
- analysis to perform before the visualization (ornull
if no analysis is to be performed)
-
generateDOTofCFG
public static <V extends AbstractValue<V>,S extends Store<S>, void generateDOTofCFGT extends TransferFunction<V, S>> (ControlFlowGraph cfg, String outputDir, boolean pdf, boolean verbose, @Nullable Analysis<V, S, T> analysis) Generate the DOT and PDF representations of the CFG for a method.- Type Parameters:
V
- the abstract value type to be tracked by the analysisS
- the store type used in the analysisT
- the transfer function type that is used to approximate run-time behavior- Parameters:
cfg
- the control flow graph to visualizeoutputDir
- source output directorypdf
- also generate a PDFverbose
- show verbose information in CFGanalysis
- analysis to perform before the visualization (ornull
if no analysis is to be performed)
-
generateMethodCFG
public static ControlFlowGraph generateMethodCFG(String file, String method, String clas, @Nullable Analysis<?, ?, ?> analysis) Generate the control flow graph of a method in a class.- Parameters:
file
- a Java source file, used as inputmethod
- name of the method to generate the CFG forclas
- name of the class which includes the method to generate the CFG foranalysis
- analysis to perform before the visualization (ornull
if no analysis is to be performed)- Returns:
- control flow graph of the specified method
-
writeStringOfCFG
public static void writeStringOfCFG(String inputFile, String method, String clas, String outputFile, Analysis<?, ?, ?> analysis) Write generated String representation of the CFG for a method to a file.- Parameters:
inputFile
- a Java source file, used as inputmethod
- name of the method to generate the CFG forclas
- name of the class which includes the method to generate the CFG foroutputFile
- source output fileanalysis
- instance of forward or backward analysis from specific dataflow test case
-
writeStringOfCFG
public static void writeStringOfCFG(ControlFlowGraph cfg, String outputFile, Analysis<?, ?, ?> analysis) Write generated String representation of the CFG for a method to a file.- Parameters:
cfg
- the control flow graphoutputFile
- source output fileanalysis
- the analysis that was run, or null
-