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 AnnotatedTypeFactory
Type factory to provide types used during CFG building.protected final BaseTypeChecker
The associated checker.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 atypeFactory, 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, visitAnyPattern, visitBindingPattern, visitConstantCaseLabel, visitDeconstructionPattern, visitDefaultCaseLabel, visitExports, visitIntersectionType, visitModule, visitOpens, visitPackage, visitPatternCaseLabel, visitProvides, visitRequires, visitStringTemplate, visitSwitchExpression, visitUses, visitYield
-
Field Details
-
checker
The associated checker. -
atypeFactory
Type factory to provide types used during CFG building.
-
-
Constructor Details
-
CFCFGTranslationPhaseOne
public CFCFGTranslationPhaseOne(CFTreeBuilder builder, BaseTypeChecker checker, AnnotatedTypeFactory atypeFactory, 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
Perform any actions required when CFG translation creates a new Tree that is not part of the original AST.Assigns a path to the artificial tree.
- 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
-