Class BaseNonRelationalValueDomain.EvaluationVisitor<T extends BaseNonRelationalValueDomain<T>>
- java.lang.Object
-
- it.unive.lisa.analysis.nonrelational.value.BaseNonRelationalValueDomain.EvaluationVisitor<T>
-
- Type Parameters:
T
- the concrete type of the domain using this visitor
- All Implemented Interfaces:
ExpressionVisitor<T>
- Enclosing interface:
- BaseNonRelationalValueDomain<T extends BaseNonRelationalValueDomain<T>>
public static class BaseNonRelationalValueDomain.EvaluationVisitor<T extends BaseNonRelationalValueDomain<T>> extends java.lang.Object implements ExpressionVisitor<T>
AExpressionVisitor
forBaseNonRelationalValueDomain
instances.
-
-
Constructor Summary
Constructors Constructor Description EvaluationVisitor(T singleton)
Builds the visitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
visit(AccessChild expression, T receiver, T child, java.lang.Object... params)
Visits anAccessChild
.T
visit(HeapDereference expression, T arg, java.lang.Object... params)
Visits aHeapDereference
.T
visit(HeapExpression expression, T[] subExpressions, java.lang.Object... params)
Visits a genericHeapExpression
.T
visit(HeapReference expression, T arg, java.lang.Object... params)
Visits aHeapReference
.T
visit(MemoryAllocation expression, java.lang.Object... params)
Visits aMemoryAllocation
.T
visit(BinaryExpression expression, T left, T right, java.lang.Object... params)
Visits aBinaryExpression
.T
visit(Constant expression, java.lang.Object... params)
Visits aConstant
.T
visit(Identifier expression, java.lang.Object... params)
Visits anIdentifier
.T
visit(PushAny expression, java.lang.Object... params)
Visits aPushAny
.T
visit(PushInv expression, java.lang.Object... params)
Visits aPushInv
.T
visit(Skip expression, java.lang.Object... params)
Visits aSkip
.T
visit(TernaryExpression expression, T left, T middle, T right, java.lang.Object... params)
Visits aTernaryExpression
.T
visit(UnaryExpression expression, T arg, java.lang.Object... params)
Visits aUnaryExpression
.T
visit(ValueExpression expression, T[] subExpressions, java.lang.Object... params)
Visits a genericValueExpression
.
-
-
-
Constructor Detail
-
EvaluationVisitor
public EvaluationVisitor(T singleton)
Builds the visitor.- Parameters:
singleton
- an instance of the domain using this visitor
-
-
Method Detail
-
visit
public T visit(HeapExpression expression, T[] subExpressions, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits a genericHeapExpression
. This callback is invoked after the inner expressions have been visited, and their produced value is passed as argument.
This overload allows visiting frontend-defined expressions. For all standard expressions defined within LiSA, the corresponding overload will be invoked instead.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the expressionsubExpressions
- the values produced by visiting the sub-expressions, if any; if there are no sub-expressions, this parameter can benull
or emptyparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the expression
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(AccessChild expression, T receiver, T child, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits anAccessChild
. This callback is invoked after the inner expressions have been visited, and their produced value is passed as argument.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the expressionreceiver
- the value produced by visiting the receiver (AccessChild.getContainer()
) of the accesschild
- the value produced by visiting the child (AccessChild.getChild()
) of the accessparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the expression
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(MemoryAllocation expression, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aMemoryAllocation
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the allocationparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the allocation
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(HeapReference expression, T arg, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aHeapReference
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the heap referencearg
- the value produced by visiting the argument of the expressionparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the heap reference
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(HeapDereference expression, T arg, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aHeapDereference
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the heap dereferencearg
- the value produced by visiting the argument of the expressionparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the heap dereference
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(UnaryExpression expression, T arg, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aUnaryExpression
. This callback is invoked after the inner expressions have been visited, and their produced value is passed as argument.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the expressionarg
- the value produced by visiting the argument of the expressionparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the expression
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(BinaryExpression expression, T left, T right, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aBinaryExpression
. This callback is invoked after the inner expressions have been visited, and their produced value is passed as argument.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the expressionleft
- the value produced by visiting the left-hand side of the expressionright
- the value produced by visiting the right-hand side of the expressionparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the expression
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(TernaryExpression expression, T left, T middle, T right, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aTernaryExpression
. This callback is invoked after the inner expressions have been visited, and their produced value is passed as argument.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the expressionleft
- the value produced by visiting the left-hand side of the expressionmiddle
- the value produced by visiting the middle-hand side of the expressionright
- the value produced by visiting the right-hand side of the expressionparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the expression
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(Skip expression, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aSkip
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the skipparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the skip
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(PushAny expression, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aPushAny
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the pushanyparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the pushany
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(PushInv expression, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aPushInv
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the pushinvparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the pushinv
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(Constant expression, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aConstant
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the constantparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the constant
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(Identifier expression, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits anIdentifier
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the identifierparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the identifier
- Throws:
SemanticException
- if an error occurs during the visit operation
-
visit
public T visit(ValueExpression expression, T[] subExpressions, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits a genericValueExpression
. This callback is invoked after the inner expressions have been visited, and their produced value is passed as argument.
This overload allows visiting frontend-defined expressions. For all standard expressions defined within LiSA, the corresponding overload will be invoked instead.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseNonRelationalValueDomain<T>>
- Parameters:
expression
- the expressionsubExpressions
- the values produced by visiting the sub-expressions, if any; if there are no sub-expressions, this parameter can benull
or emptyparams
- the additional parameters provided toSymbolicExpression.accept(ExpressionVisitor, Object...)
, if any- Returns:
- the value produced by visiting the expression
- Throws:
SemanticException
- if an error occurs during the visit operation
-
-