Search in sources :

Example 1 with ConstantPropagationTransfer

use of org.checkerframework.dataflow.constantpropagation.ConstantPropagationTransfer in project bazel by bazelbuild.

the class ConstantPropagationPlayground method main.

/**
     * Run constant propagation for a specific file and create a PDF of the CFG
     * in the end.
     */
public static void main(String[] args) {
    /* Configuration: change as appropriate */
    // input file name and path
    String inputFile = "cfg-input.java";
    // output file name and path (without
    String outputFileName = "cfg";
    // extension)
    // name of the method to analyze
    String method = "test";
    // name of the class to consider
    String clazz = "Test";
    // run the analysis and create a PDF file
    ConstantPropagationTransfer transfer = new ConstantPropagationTransfer();
    // TODO: correct processing environment
    Analysis<Constant, ConstantPropagationStore, ConstantPropagationTransfer> analysis = new Analysis<>(null, transfer);
    JavaSource2CFGDOT.generateDOTofCFG(inputFile, outputFileName, method, clazz, true, analysis);
}
Also used : Analysis(org.checkerframework.dataflow.analysis.Analysis) Constant(org.checkerframework.dataflow.constantpropagation.Constant) ConstantPropagationTransfer(org.checkerframework.dataflow.constantpropagation.ConstantPropagationTransfer) ConstantPropagationStore(org.checkerframework.dataflow.constantpropagation.ConstantPropagationStore)

Aggregations

Analysis (org.checkerframework.dataflow.analysis.Analysis)1 Constant (org.checkerframework.dataflow.constantpropagation.Constant)1 ConstantPropagationStore (org.checkerframework.dataflow.constantpropagation.ConstantPropagationStore)1 ConstantPropagationTransfer (org.checkerframework.dataflow.constantpropagation.ConstantPropagationTransfer)1