Class CFGProcessor
- java.lang.Object
-
- javax.annotation.processing.AbstractProcessor
-
- org.checkerframework.javacutil.AbstractTypeProcessor
-
- org.checkerframework.javacutil.BasicTypeProcessor
-
- org.checkerframework.dataflow.cfg.CFGProcessor
-
- All Implemented Interfaces:
javax.annotation.processing.Processor
@SupportedAnnotationTypes("*") public class CFGProcessor extends BasicTypeProcessor
Generate the control flow graph of a given method in a given class. SeeCFGVisualizeLauncher
for example usage.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CFGProcessor.CFGProcessResult
The result of the CFG process, contains the control flow graph when successful.
-
Field Summary
-
Fields inherited from class org.checkerframework.javacutil.BasicTypeProcessor
currentRoot
-
-
Constructor Summary
Constructors Constructor Description CFGProcessor(java.lang.String className, java.lang.String methodName)
Create a CFG processor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.sun.source.util.TreePathScanner<?,?>
createTreePathScanner(com.sun.source.tree.CompilationUnitTree root)
Create a TreePathScanner at the given root.@Nullable CFGProcessor.CFGProcessResult
getCFGProcessResult()
Get the CFG process result.javax.lang.model.SourceVersion
getSupportedSourceVersion()
void
typeProcessingOver()
A method to be called once all the classes are processed.-
Methods inherited from class org.checkerframework.javacutil.BasicTypeProcessor
typeProcess
-
Methods inherited from class org.checkerframework.javacutil.AbstractTypeProcessor
getCompilerLog, init, process, typeProcessingStart
-
-
-
-
Constructor Detail
-
CFGProcessor
public CFGProcessor(java.lang.String className, java.lang.String methodName)
Create a CFG processor.- Parameters:
className
- the qualified name of class which includes the specified method to generate the CFG formethodName
- the name of the method to generate the CFG for
-
-
Method Detail
-
getCFGProcessResult
public final @Nullable CFGProcessor.CFGProcessResult getCFGProcessResult()
Get the CFG process result.- Returns:
- result of cfg process
-
typeProcessingOver
public void typeProcessingOver()
Description copied from class:AbstractTypeProcessor
A method to be called once all the classes are processed.Subclasses may override this method to do any aggregate analysis (e.g. generate report, persistence) or resource deallocation.
Method
AbstractTypeProcessor.getCompilerLog()
can be used to access the number of compiler errors.- Overrides:
typeProcessingOver
in classAbstractTypeProcessor
-
createTreePathScanner
protected com.sun.source.util.TreePathScanner<?,?> createTreePathScanner(com.sun.source.tree.CompilationUnitTree root)
Description copied from class:BasicTypeProcessor
Create a TreePathScanner at the given root.- Specified by:
createTreePathScanner
in classBasicTypeProcessor
- Parameters:
root
- where to start the tree traversal- Returns:
- a TreePathScanner at the given root
-
getSupportedSourceVersion
public javax.lang.model.SourceVersion getSupportedSourceVersion()
- Specified by:
getSupportedSourceVersion
in interfacejavax.annotation.processing.Processor
- Overrides:
getSupportedSourceVersion
in classjavax.annotation.processing.AbstractProcessor
-
-