Search in sources :

Example 1 with TreeBuilder

use of org.checkerframework.javacutil.trees.TreeBuilder in project checker-framework by typetools.

the class CFGBuilder method run.

/**
 * Build the control flow graph of some code (method, initializer block, ...). bodyPath is the
 * TreePath to the body of that code.
 */
public ControlFlowGraph run(TreePath bodyPath, ProcessingEnvironment env, UnderlyingAST underlyingAST) {
    declaredClasses.clear();
    TreeBuilder builder = new TreeBuilder(env);
    AnnotationProvider annotationProvider = new BasicAnnotationProvider();
    PhaseOneResult phase1result = new CFGTranslationPhaseOne().process(bodyPath, env, underlyingAST, exceptionalExitLabel, builder, annotationProvider);
    ControlFlowGraph phase2result = new CFGTranslationPhaseTwo().process(phase1result);
    ControlFlowGraph phase3result = CFGTranslationPhaseThree.process(phase2result);
    return phase3result;
}
Also used : BasicAnnotationProvider(org.checkerframework.javacutil.BasicAnnotationProvider) AnnotationProvider(org.checkerframework.javacutil.AnnotationProvider) BasicAnnotationProvider(org.checkerframework.javacutil.BasicAnnotationProvider) TreeBuilder(org.checkerframework.javacutil.trees.TreeBuilder)

Example 2 with TreeBuilder

use of org.checkerframework.javacutil.trees.TreeBuilder in project bazel by bazelbuild.

the class CFGBuilder method run.

/**
     * Build the control flow graph of some code.
     */
public ControlFlowGraph run(CompilationUnitTree root, ProcessingEnvironment env, UnderlyingAST underlyingAST) {
    declaredClasses = new LinkedList<>();
    declaredLambdas = new LinkedList<>();
    TreeBuilder builder = new TreeBuilder(env);
    AnnotationProvider annotationProvider = new BasicAnnotationProvider();
    PhaseOneResult phase1result = new CFGTranslationPhaseOne().process(root, env, underlyingAST, exceptionalExitLabel, builder, annotationProvider);
    ControlFlowGraph phase2result = new CFGTranslationPhaseTwo().process(phase1result);
    ControlFlowGraph phase3result = CFGTranslationPhaseThree.process(phase2result);
    return phase3result;
}
Also used : BasicAnnotationProvider(org.checkerframework.javacutil.BasicAnnotationProvider) AnnotationProvider(org.checkerframework.javacutil.AnnotationProvider) BasicAnnotationProvider(org.checkerframework.javacutil.BasicAnnotationProvider) TreeBuilder(org.checkerframework.javacutil.trees.TreeBuilder)

Example 3 with TreeBuilder

use of org.checkerframework.javacutil.trees.TreeBuilder in project bazel by bazelbuild.

the class CFGBuilder method run.

/**
     * Build the control flow graph of some code (method, initializer block, ...).
     * bodyPath is the TreePath to the body of that code.
     */
public ControlFlowGraph run(TreePath bodyPath, ProcessingEnvironment env, UnderlyingAST underlyingAST) {
    declaredClasses = new LinkedList<>();
    TreeBuilder builder = new TreeBuilder(env);
    AnnotationProvider annotationProvider = new BasicAnnotationProvider();
    PhaseOneResult phase1result = new CFGTranslationPhaseOne().process(bodyPath, env, underlyingAST, exceptionalExitLabel, builder, annotationProvider);
    ControlFlowGraph phase2result = new CFGTranslationPhaseTwo().process(phase1result);
    ControlFlowGraph phase3result = CFGTranslationPhaseThree.process(phase2result);
    return phase3result;
}
Also used : BasicAnnotationProvider(org.checkerframework.javacutil.BasicAnnotationProvider) AnnotationProvider(org.checkerframework.javacutil.AnnotationProvider) BasicAnnotationProvider(org.checkerframework.javacutil.BasicAnnotationProvider) TreeBuilder(org.checkerframework.javacutil.trees.TreeBuilder)

Example 4 with TreeBuilder

use of org.checkerframework.javacutil.trees.TreeBuilder in project checker-framework by typetools.

the class CFGBuilder method run.

/**
 * Build the control flow graph of some code.
 */
public ControlFlowGraph run(CompilationUnitTree root, ProcessingEnvironment env, UnderlyingAST underlyingAST) {
    declaredClasses.clear();
    declaredLambdas.clear();
    TreeBuilder builder = new TreeBuilder(env);
    AnnotationProvider annotationProvider = new BasicAnnotationProvider();
    PhaseOneResult phase1result = new CFGTranslationPhaseOne().process(root, env, underlyingAST, exceptionalExitLabel, builder, annotationProvider);
    ControlFlowGraph phase2result = new CFGTranslationPhaseTwo().process(phase1result);
    ControlFlowGraph phase3result = CFGTranslationPhaseThree.process(phase2result);
    return phase3result;
}
Also used : BasicAnnotationProvider(org.checkerframework.javacutil.BasicAnnotationProvider) AnnotationProvider(org.checkerframework.javacutil.AnnotationProvider) BasicAnnotationProvider(org.checkerframework.javacutil.BasicAnnotationProvider) TreeBuilder(org.checkerframework.javacutil.trees.TreeBuilder)

Aggregations

AnnotationProvider (org.checkerframework.javacutil.AnnotationProvider)4 BasicAnnotationProvider (org.checkerframework.javacutil.BasicAnnotationProvider)4 TreeBuilder (org.checkerframework.javacutil.trees.TreeBuilder)4