Class CFGVisualizeLauncher

java.lang.Object
org.checkerframework.dataflow.cfg.visualize.CFGVisualizeLauncher

public final class CFGVisualizeLauncher extends Object
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 ConstantPropagationPlayground for another way to use it.

  • Constructor Details

    • CFGVisualizeLauncher

      public CFGVisualizeLauncher()
      Create a CFGVisualizeLauncher.
  • Method Details

    • main

      public static void main(String[] args)
      The main entry point of CFGVisualizeLauncher.
      Parameters:
      args - the passed arguments, see printUsage() for the usage
    • generateDOTofCFG

      public <V extends AbstractValue<V>, S extends Store<S>, T extends TransferFunction<V, S>> void generateDOTofCFG(String inputFile, String outputDir, String method, String clas, boolean pdf, boolean verbose, @Nullable Analysis<V,S,T> analysis)
      Generate the DOT representation of the CFG for a method.
      Type Parameters:
      V - the abstract value type to be tracked by the analysis
      S - the store type used in the analysis
      T - the transfer function type that is used to approximated runtime behavior
      Parameters:
      inputFile - a Java source file, used as input
      outputDir - source output directory
      method - name of the method to generate the CFG for
      clas - name of the class which includes the method to generate the CFG for
      pdf - also generate a PDF
      verbose - show verbose information in CFG
      analysis - analysis to perform before the visualization (or null if no analysis is to be performed)
    • generateStringOfCFG

      public <V extends AbstractValue<V>, S extends Store<S>, T extends TransferFunction<V, S>> @Nullable Map<String,Object> generateStringOfCFG(String inputFile, String method, String clas, boolean verbose, @Nullable Analysis<V,S,T> analysis)
      Generate the String representation of the CFG for a method.
      Type Parameters:
      V - the abstract value type to be tracked by the analysis
      S - the store type used in the analysis
      T - the transfer function type that is used to approximated runtime behavior
      Parameters:
      inputFile - a Java source file, used as input
      method - name of the method to generate the CFG for
      clas - name of the class which includes the method to generate the CFG for
      verbose - show verbose information in CFG
      analysis - analysis to perform before the visualization (or null if no analysis is to be performed)
      Returns:
      a map which includes a key "stringGraph" and the String representation of CFG as the value