Class PurityChecker.PurityCheckerHelper
java.lang.Object
com.sun.source.util.TreeScanner<R,P>
com.sun.source.util.TreePathScanner<Void,Void>
org.checkerframework.dataflow.util.PurityChecker.PurityCheckerHelper
- All Implemented Interfaces:
TreeVisitor<Void,
Void>
- Enclosing class:
- PurityChecker
Helper class to keep
PurityChecker
's interface clean.
The scanner is run on a single statement, not on a class or method.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AnnotationProvider
The annotation provider (typically an AnnotatedTypeFactory). -
Constructor Summary
ConstructorDescriptionPurityCheckerHelper
(AnnotationProvider annoProvider, boolean assumeSideEffectFree, boolean assumeDeterministic) Create a PurityCheckerHelper. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
assignmentCheck
(ExpressionTree variable) Check whethervariable
is permitted on the left-hand-side of an assignment.protected boolean
isLocalVariable
(ExpressionTree variable) Checks if the argument is a local variable.visitAssignment
(AssignmentTree tree, Void ignore) visitCatch
(CatchTree tree, Void ignore) visitCompoundAssignment
(CompoundAssignmentTree tree, Void ignore) visitMethodInvocation
(MethodInvocationTree tree, Void ignore) visitNewClass
(NewClassTree tree, Void ignore) visitUnary
(UnaryTree tree, Void ignore) Methods inherited from class com.sun.source.util.TreePathScanner
getCurrentPath, scan, scan
Methods inherited from class com.sun.source.util.TreeScanner
reduce, scan, visitAnnotatedType, visitAnnotation, visitArrayAccess, visitArrayType, visitAssert, visitBinary, visitBindingPattern, visitBlock, visitBreak, visitCase, visitClass, visitCompilationUnit, visitConditionalExpression, visitContinue, visitDefaultCaseLabel, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitGuardedPattern, visitIdentifier, visitIf, visitImport, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLambdaExpression, visitLiteral, visitMemberReference, visitMemberSelect, visitMethod, visitModifiers, visitModule, visitNewArray, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitParenthesizedPattern, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitSwitch, visitSwitchExpression, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnionType, visitUses, visitVariable, visitWhileLoop, visitWildcard, visitYield
-
Field Details
-
annoProvider
The annotation provider (typically an AnnotatedTypeFactory).
-
-
Constructor Details
-
PurityCheckerHelper
public PurityCheckerHelper(AnnotationProvider annoProvider, boolean assumeSideEffectFree, boolean assumeDeterministic) Create a PurityCheckerHelper.- Parameters:
annoProvider
- the annotation providerassumeSideEffectFree
- true if all methods should be assumed to be @SideEffectFreeassumeDeterministic
- true if all methods should be assumed to be @Deterministic
-
-
Method Details
-
visitCatch
- Specified by:
visitCatch
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitCatch
in classTreeScanner<Void,
Void>
-
visitMethodInvocation
- Specified by:
visitMethodInvocation
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitMethodInvocation
in classTreeScanner<Void,
Void>
-
visitNewClass
- Specified by:
visitNewClass
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitNewClass
in classTreeScanner<Void,
Void>
-
visitAssignment
- Specified by:
visitAssignment
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitAssignment
in classTreeScanner<Void,
Void>
-
visitUnary
- Specified by:
visitUnary
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitUnary
in classTreeScanner<Void,
Void>
-
assignmentCheck
Check whethervariable
is permitted on the left-hand-side of an assignment.- Parameters:
variable
- the lhs to check
-
isLocalVariable
Checks if the argument is a local variable.- Parameters:
variable
- the tree to check- Returns:
- true if the argument is a local variable
-
visitCompoundAssignment
- Specified by:
visitCompoundAssignment
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitCompoundAssignment
in classTreeScanner<Void,
Void>
-