Class CFCFGBuilder.CFCFGTranslationPhaseOne
- java.lang.Object
-
- com.sun.source.util.TreeScanner<Node,java.lang.Void>
-
- org.checkerframework.dataflow.cfg.builder.CFGTranslationPhaseOne
-
- org.checkerframework.framework.flow.CFCFGBuilder.CFCFGTranslationPhaseOne
-
- All Implemented Interfaces:
com.sun.source.tree.TreeVisitor<Node,java.lang.Void>
- Enclosing class:
- CFCFGBuilder
protected static class CFCFGBuilder.CFCFGTranslationPhaseOne extends CFGTranslationPhaseOne
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.
-
-
Field Summary
Fields Modifier and Type Field Description protected AnnotatedTypeFactory
atypeFactory
Type factory to provide types used during CFG building.protected BaseTypeChecker
checker
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
Constructors Constructor Description CFCFGTranslationPhaseOne(CFTreeBuilder builder, BaseTypeChecker checker, AnnotatedTypeFactory atypeFactory, boolean assumeAssertionsEnabled, boolean assumeAssertionsDisabled, javax.annotation.processing.ProcessingEnvironment env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
assumeAssertionsEnabledFor(com.sun.source.tree.AssertTree tree)
Should assertions be assumed to be executed for a givenAssertTree
? False by default.protected com.sun.source.tree.VariableTree
createEnhancedForLoopArrayVariable(com.sun.source.tree.ExpressionTree expression, javax.lang.model.element.VariableElement variableElement)
protected com.sun.source.tree.VariableTree
createEnhancedForLoopIteratorVariable(com.sun.source.tree.MethodInvocationTree iteratorCall, javax.lang.model.element.VariableElement variableElement)
void
handleArtificialTree(com.sun.source.tree.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, getCurrentPath, getLabel, getTypeMirror, insertExtendedNodeAfter, insertNodeAfter, insertNodeWithExceptionsAfter, isNumericOrBoxed, maybeGetTypeMirror, methodInvocationConvert, narrow, narrowAndBox, process, process, scan, stringConversion, translateAssertWithAssertionsEnabled, translateAssignment, translateAssignment, 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
-
-
-
-
Field Detail
-
checker
protected final BaseTypeChecker checker
The associated checker.
-
atypeFactory
protected final AnnotatedTypeFactory atypeFactory
Type factory to provide types used during CFG building.
-
-
Constructor Detail
-
CFCFGTranslationPhaseOne
public CFCFGTranslationPhaseOne(CFTreeBuilder builder, BaseTypeChecker checker, AnnotatedTypeFactory atypeFactory, boolean assumeAssertionsEnabled, boolean assumeAssertionsDisabled, javax.annotation.processing.ProcessingEnvironment env)
-
-
Method Detail
-
assumeAssertionsEnabledFor
protected boolean assumeAssertionsEnabledFor(com.sun.source.tree.AssertTree tree)
Description copied from class:CFGTranslationPhaseOne
Should assertions be assumed to be executed for a givenAssertTree
? False by default.- Overrides:
assumeAssertionsEnabledFor
in classCFGTranslationPhaseOne
-
handleArtificialTree
public void handleArtificialTree(com.sun.source.tree.Tree tree)
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 com.sun.source.tree.VariableTree createEnhancedForLoopIteratorVariable(com.sun.source.tree.MethodInvocationTree iteratorCall, javax.lang.model.element.VariableElement variableElement)
- Overrides:
createEnhancedForLoopIteratorVariable
in classCFGTranslationPhaseOne
-
createEnhancedForLoopArrayVariable
protected com.sun.source.tree.VariableTree createEnhancedForLoopArrayVariable(com.sun.source.tree.ExpressionTree expression, javax.lang.model.element.VariableElement variableElement)
- Overrides:
createEnhancedForLoopArrayVariable
in classCFGTranslationPhaseOne
-
-