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 BasicTypeProcessorGenerate the control flow graph of a given method in a given class. SeeCFGVisualizeLauncherfor example usage.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCFGProcessor.CFGProcessResultThe 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.CFGProcessResultgetCFGProcessResult()Get the CFG process result.javax.lang.model.SourceVersiongetSupportedSourceVersion()voidtypeProcessingOver()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:AbstractTypeProcessorA 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:
typeProcessingOverin classAbstractTypeProcessor
-
createTreePathScanner
protected com.sun.source.util.TreePathScanner<?,?> createTreePathScanner(com.sun.source.tree.CompilationUnitTree root)
Description copied from class:BasicTypeProcessorCreate a TreePathScanner at the given root.- Specified by:
createTreePathScannerin 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:
getSupportedSourceVersionin interfacejavax.annotation.processing.Processor- Overrides:
getSupportedSourceVersionin classjavax.annotation.processing.AbstractProcessor
-
-