Class JavaExpressionConverter
java.lang.Object
org.checkerframework.dataflow.expression.JavaExpressionVisitor<JavaExpression,Void>
org.checkerframework.dataflow.expression.JavaExpressionConverter
- Direct Known Subclasses:
JavaExpressionOptimizer
,ViewpointAdaptJavaExpression
This class calls
convert(JavaExpression)
on each subexpression of the JavaExpression
and returns a new JavaExpression
built from the result of calling
convert
on each subexpression. (If an expression has no subexpression, then the expression
itself is returned.)
This class makes it easy to implement a subclass that converts subexpressions of a JavaExpression
based on which kind of JavaExpression
the subexpression is. Subclasses
should override the visit method of kinds of JavaExpressions to convert.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvert
(List<@PolyNull JavaExpression> list) Converts all the expressions inlist
and returns the resulting list.convert
(JavaExpression javaExpr) ConvertsjavaExpr
and returns the resultingJavaExpression
.protected JavaExpression
visitArrayAccess
(ArrayAccess arrayAccessExpr, Void unused) Visit anArrayAccess
.protected JavaExpression
visitArrayCreation
(ArrayCreation arrayCreationExpr, Void unused) Visit anArrayCreation
.protected JavaExpression
visitBinaryOperation
(BinaryOperation binaryOpExpr, Void unused) Visit aBinaryOperation
.protected JavaExpression
visitClassName
(ClassName classNameExpr, Void unused) Visit aClassName
.protected JavaExpression
visitFieldAccess
(FieldAccess fieldAccessExpr, Void unused) Visit aFieldAccess
.protected JavaExpression
visitFormalParameter
(FormalParameter parameterExpr, Void unused) Visit aFormalParameter
.protected JavaExpression
visitLocalVariable
(LocalVariable localVarExpr, Void unused) Visit aLocalVariable
.protected JavaExpression
visitMethodCall
(MethodCall methodCallExpr, Void unused) Visit aMethodCall
.protected JavaExpression
visitThisReference
(ThisReference thisExpr, Void unused) Visit aThisReference
.protected JavaExpression
visitUnaryOperation
(UnaryOperation unaryOpExpr, Void unused) Visit anUnaryOperation
.protected JavaExpression
visitUnknown
(Unknown unknownExpr, Void unused) Visit anUnknown
.protected JavaExpression
visitValueLiteral
(ValueLiteral literalExpr, Void unused) Visit aValueLiteral
.Methods inherited from class org.checkerframework.dataflow.expression.JavaExpressionVisitor
visit
-
Constructor Details
-
JavaExpressionConverter
public JavaExpressionConverter()
-
-
Method Details
-
convert
ConvertsjavaExpr
and returns the resultingJavaExpression
.- Parameters:
javaExpr
- the expression to convert- Returns:
- the converted expression
-
convert
Converts all the expressions inlist
and returns the resulting list.- Parameters:
list
- the list of expressions to convert- Returns:
- the list of converted expressions
-
visitArrayAccess
Description copied from class:JavaExpressionVisitor
Visit anArrayAccess
.- Specified by:
visitArrayAccess
in classJavaExpressionVisitor<JavaExpression,
Void> - Parameters:
arrayAccessExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit method- Returns:
- the result of visiting the
arrayAccessExpr
-
visitArrayCreation
Description copied from class:JavaExpressionVisitor
Visit anArrayCreation
.- Specified by:
visitArrayCreation
in classJavaExpressionVisitor<JavaExpression,
Void> - Parameters:
arrayCreationExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit method- Returns:
- the result of visiting the
arrayCreationExpr
-
visitBinaryOperation
Description copied from class:JavaExpressionVisitor
Visit aBinaryOperation
.- Specified by:
visitBinaryOperation
in classJavaExpressionVisitor<JavaExpression,
Void> - Parameters:
binaryOpExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit method- Returns:
- the result of visiting the
binaryOpExpr
-
visitClassName
Description copied from class:JavaExpressionVisitor
Visit aClassName
.- Specified by:
visitClassName
in classJavaExpressionVisitor<JavaExpression,
Void> - Parameters:
classNameExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit method- Returns:
- the result of visiting the
classNameExpr
-
visitFieldAccess
Description copied from class:JavaExpressionVisitor
Visit aFieldAccess
.- Specified by:
visitFieldAccess
in classJavaExpressionVisitor<JavaExpression,
Void> - Parameters:
fieldAccessExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit method- Returns:
- the result of visiting the
fieldAccessExpr
-
visitFormalParameter
Description copied from class:JavaExpressionVisitor
Visit aFormalParameter
.- Specified by:
visitFormalParameter
in classJavaExpressionVisitor<JavaExpression,
Void> - Parameters:
parameterExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit method- Returns:
- the result of visiting the
parameterExpr
-
visitLocalVariable
Description copied from class:JavaExpressionVisitor
Visit aLocalVariable
.- Specified by:
visitLocalVariable
in classJavaExpressionVisitor<JavaExpression,
Void> - Parameters:
localVarExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit method- Returns:
- the result of visiting the
localVarExpr
-
visitMethodCall
Description copied from class:JavaExpressionVisitor
Visit aMethodCall
.- Specified by:
visitMethodCall
in classJavaExpressionVisitor<JavaExpression,
Void> - Parameters:
methodCallExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit method- Returns:
- the result of visiting the
methodCallExpr
-
visitThisReference
Description copied from class:JavaExpressionVisitor
Visit aThisReference
.- Specified by:
visitThisReference
in classJavaExpressionVisitor<JavaExpression,
Void> - Parameters:
thisExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit method- Returns:
- the result of visiting the
thisExpr
-
visitUnaryOperation
Description copied from class:JavaExpressionVisitor
Visit anUnaryOperation
.- Specified by:
visitUnaryOperation
in classJavaExpressionVisitor<JavaExpression,
Void> - Parameters:
unaryOpExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit method- Returns:
- the result of visiting the
unaryOpExpr
-
visitUnknown
Description copied from class:JavaExpressionVisitor
Visit anUnknown
.- Specified by:
visitUnknown
in classJavaExpressionVisitor<JavaExpression,
Void> - Parameters:
unknownExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit method- Returns:
- the result of visiting the
unknownExpr
-
visitValueLiteral
Description copied from class:JavaExpressionVisitor
Visit aValueLiteral
.- Specified by:
visitValueLiteral
in classJavaExpressionVisitor<JavaExpression,
Void> - Parameters:
literalExpr
- the JavaExpression to visitunused
- the parameter to pass to the visit method- Returns:
- the result of visiting the
literalExpr
-