Class PurityChecker
- java.lang.Object
-
- org.checkerframework.dataflow.util.PurityChecker
-
public class PurityChecker extends java.lang.Object
A visitor that determines the purity (as defined bySideEffectFree
,Deterministic
, andPure
) of a statement or expression. The entry point is methodcheckPurity(com.sun.source.util.TreePath, org.checkerframework.javacutil.AnnotationProvider, boolean, boolean)
.- See Also:
SideEffectFree
,Deterministic
,Pure
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
PurityChecker.PurityCheckerHelper
Helper class to keepPurityChecker
's interface clean.static class
PurityChecker.PurityResult
Result of thePurityChecker
.
-
Constructor Summary
Constructors Constructor Description PurityChecker()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PurityChecker.PurityResult
checkPurity(com.sun.source.util.TreePath statement, AnnotationProvider annoProvider, boolean assumeSideEffectFree, boolean assumeDeterministic)
Compute whether the given statement is side-effect-free, deterministic, or both.
-
-
-
Method Detail
-
checkPurity
public static PurityChecker.PurityResult checkPurity(com.sun.source.util.TreePath statement, AnnotationProvider annoProvider, boolean assumeSideEffectFree, boolean assumeDeterministic)
Compute whether the given statement is side-effect-free, deterministic, or both. Returns a result that can be queried.- Parameters:
statement
- the statement to checkannoProvider
- the annotation providerassumeSideEffectFree
- true if all methods should be assumed to be @SideEffectFreeassumeDeterministic
- true if all methods should be assumed to be @Deterministic- Returns:
- information about whether the given statement is side-effect-free, deterministic, or both
-
-