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
FieldsModifier and TypeFieldDescriptionprotected final AnnotatedTypeFactoryType factory to provide types used during CFG building.protected final BaseTypeCheckerThe 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
ConstructorsConstructorDescriptionCFCFGTranslationPhaseOne(CFTreeBuilder builder, BaseTypeChecker checker, AnnotatedTypeFactory atypeFactory, boolean assumeAssertionsEnabled, boolean assumeAssertionsDisabled, ProcessingEnvironment env) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanShould assertions be assumed to be executed for a givenAssertTree? False by default.protected VariableTreecreateEnhancedForLoopArrayVariable(ExpressionTree expression, VariableElement variableElement) protected VariableTreecreateEnhancedForLoopIteratorVariable(MethodInvocationTree iteratorCall, VariableElement variableElement) voidhandleArtificialTree(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, withoutAssignmentMethods 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:CFGTranslationPhaseOneShould assertions be assumed to be executed for a givenAssertTree? False by default.- Overrides:
assumeAssertionsEnabledForin 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:
handleArtificialTreein classCFGTranslationPhaseOne- Parameters:
tree- the newly created Tree
-
createEnhancedForLoopIteratorVariable
protected VariableTree createEnhancedForLoopIteratorVariable(MethodInvocationTree iteratorCall, VariableElement variableElement) - Overrides:
createEnhancedForLoopIteratorVariablein classCFGTranslationPhaseOne
-
createEnhancedForLoopArrayVariable
protected VariableTree createEnhancedForLoopArrayVariable(ExpressionTree expression, VariableElement variableElement) - Overrides:
createEnhancedForLoopArrayVariablein classCFGTranslationPhaseOne
-