use of org.checkerframework.javacutil.AnnotationProvider in project checker-framework by typetools.
the class SignaturePrinter method init.
// /////// Initialization /////////////
private void init(ProcessingEnvironment env, String checkerName) {
if (checkerName != null) {
try {
Class<?> checkerClass = Class.forName(checkerName);
Constructor<?> cons = checkerClass.getConstructor();
checker = (SourceChecker) cons.newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
} else {
checker = new SourceChecker() {
@Override
protected SourceVisitor<?, ?> createSourceVisitor() {
return null;
}
@Override
public AnnotationProvider getAnnotationProvider() {
throw new UnsupportedOperationException("getAnnotationProvider is not implemented for this class.");
}
};
}
checker.init(env);
}
use of org.checkerframework.javacutil.AnnotationProvider 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;
}
use of org.checkerframework.javacutil.AnnotationProvider 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;
}
use of org.checkerframework.javacutil.AnnotationProvider 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;
}
use of org.checkerframework.javacutil.AnnotationProvider 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;
}
Aggregations