Class CFCFGBuilder.CFCFGTranslationPhaseOne
java.lang.Object
com.sun.source.util.TreeScanner<Node,Void>
org.checkerframework.dataflow.cfg.builder.CFGTranslationPhaseOne
org.checkerframework.framework.flow.CFCFGBuilder.CFCFGTranslationPhaseOne
- All Implemented Interfaces:
TreeVisitor<Node,
Void>
- Enclosing class:
- CFCFGBuilder
A specialized phase-one CFG builder, with a few modifications that make use of the type
factory. It is responsible for: 1) translating foreach loops so that the declarations of their
iteration variables have the right annotations, 2) registering the containing elements of
artificial trees with the relevant type factories, and 3) generating appropriate assertion CFG
structure in the presence of @AssumeAssertion assertion strings which mention the checker or
its supercheckers.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.checkerframework.dataflow.cfg.builder.CFGTranslationPhaseOne
CFGTranslationPhaseOne.AssertMethodTuple
-
Field Summary
Modifier and TypeFieldDescriptionprotected final BaseTypeChecker
The associated checker.protected final AnnotatedTypeFactory
Type factory to provide types used during CFG building.Fields inherited from class org.checkerframework.dataflow.cfg.builder.CFGTranslationPhaseOne
annotationProvider, arithmeticExceptionType, arrayIndexOutOfBoundsExceptionType, assertionErrorType, assumeAssertionsDisabled, assumeAssertionsEnabled, classCastExceptionType, classCircularityErrorType, classFormatErrorType, ea, elements, env, iterableType, negativeArraySizeExceptionType, newArrayExceptionTypes, noClassDefFoundErrorType, nullPointerExceptionType, outOfMemoryErrorType, stringType, throwableType, treeBuilder, trees, types, uid, uncheckedExceptionTypes
-
Constructor Summary
ConstructorDescriptionCFCFGTranslationPhaseOne
(CFTreeBuilder builder, BaseTypeChecker checker, AnnotatedTypeFactory factory, boolean assumeAssertionsEnabled, boolean assumeAssertionsDisabled, ProcessingEnvironment env) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Should assertions be assumed to be executed for a givenAssertTree
? False by default.protected VariableTree
createEnhancedForLoopArrayVariable
(ExpressionTree expression, VariableElement variableElement) protected VariableTree
createEnhancedForLoopIteratorVariable
(MethodInvocationTree iteratorCall, VariableElement variableElement) void
handleArtificialTree
(Tree tree) Perform any actions required when CFG translation creates a new Tree that is not part of the original AST.Methods inherited from class org.checkerframework.dataflow.cfg.builder.CFGTranslationPhaseOne
addLabelForNextNode, addToConvertedLookupMap, addToConvertedLookupMap, addToLookupMap, assignConvert, binaryNumericPromotion, binaryPromotedType, box, commonConvert, conditionalExprPromotion, conversionRequiresNarrowing, convertCallArguments, extendWithClassNameNode, extendWithExtendedNode, extendWithNode, extendWithNodeWithException, extendWithNodeWithExceptions, getAssertionsEnabledVariable, getAssertMethodTuple, getCurrentPath, getLabel, getTypeMirror, insertExtendedNodeAfter, insertNodeAfter, insertNodeWithExceptionsAfter, isNumericOrBoxed, maybeGetTypeMirror, methodInvocationConvert, narrow, narrowAndBox, process, process, scan, stringConversion, translateAssertWithAssertionsEnabled, translateAssignment, translateAssignment, treatMethodAsAssert, unaryNumericPromotion, unbox, uniqueName, visitAnnotatedType, visitAnnotation, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBinary, visitBindingPattern17, visitBlock, visitBreak, visitCase, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitContinue, visitDeconstructionPattern21, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExpressionStatement, visitForLoop, visitIdentifier, visitIf, visitImport, visitInstanceOf, visitLabeledStatement, visitLambdaExpression, visitLiteral, visitMemberReference, visitMemberSelect, visitMethod, visitMethodInvocation, visitModifiers, visitNewArray, visitNewClass, visitOther, visitParameterizedType, visitParenthesized, visitPrimitiveType, visitReturn, visitSwitch, visitSwitchExpression17, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitVariable, visitWhileLoop, visitWildcard, visitYield17, widen, withoutAssignment
Methods inherited from class com.sun.source.util.TreeScanner
reduce, scan, visitBindingPattern, visitDefaultCaseLabel, visitExports, visitGuardedPattern, visitIntersectionType, visitModule, visitOpens, visitPackage, visitParenthesizedPattern, visitProvides, visitRequires, visitSwitchExpression, visitUses, visitYield
-
Field Details
-
checker
The associated checker. -
factory
Type factory to provide types used during CFG building.
-
-
Constructor Details
-
CFCFGTranslationPhaseOne
public CFCFGTranslationPhaseOne(CFTreeBuilder builder, BaseTypeChecker checker, AnnotatedTypeFactory factory, boolean assumeAssertionsEnabled, boolean assumeAssertionsDisabled, ProcessingEnvironment env)
-
-
Method Details
-
assumeAssertionsEnabledFor
Description copied from class:CFGTranslationPhaseOne
Should assertions be assumed to be executed for a givenAssertTree
? False by default.- Overrides:
assumeAssertionsEnabledFor
in classCFGTranslationPhaseOne
-
handleArtificialTree
Description copied from class:CFGTranslationPhaseOne
Perform any actions required when CFG translation creates a new Tree that is not part of the original AST.- Overrides:
handleArtificialTree
in classCFGTranslationPhaseOne
- Parameters:
tree
- the newly created Tree
-
createEnhancedForLoopIteratorVariable
protected VariableTree createEnhancedForLoopIteratorVariable(MethodInvocationTree iteratorCall, VariableElement variableElement) - Overrides:
createEnhancedForLoopIteratorVariable
in classCFGTranslationPhaseOne
-
createEnhancedForLoopArrayVariable
protected VariableTree createEnhancedForLoopArrayVariable(ExpressionTree expression, VariableElement variableElement) - Overrides:
createEnhancedForLoopArrayVariable
in classCFGTranslationPhaseOne
-