Class BaseInferredValue.EvaluationVisitor<T extends BaseInferredValue<T>>
- java.lang.Object
-
- it.unive.lisa.analysis.nonrelational.inference.BaseInferredValue.EvaluationVisitor<T>
-
- Type Parameters:
T
- the concrete type of the domain using this visitor
- All Implemented Interfaces:
ExpressionVisitor<InferredValue.InferredPair<T>>
- Enclosing interface:
- BaseInferredValue<T extends BaseInferredValue<T>>
public static class BaseInferredValue.EvaluationVisitor<T extends BaseInferredValue<T>> extends java.lang.Object implements ExpressionVisitor<InferredValue.InferredPair<T>>
AExpressionVisitor
forBaseInferredValue
instances.
-
-
Constructor Summary
Constructors Constructor Description EvaluationVisitor(T singleton)
Builds the visitor.
-
Method Summary
-
-
-
Constructor Detail
-
EvaluationVisitor
public EvaluationVisitor(T singleton)
Builds the visitor.- Parameters:
singleton
- an instance of the domain using this visitor
-
-
Method Detail
-
visit
public InferredValue.InferredPair<T> visit(HeapExpression expression, InferredValue.InferredPair<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 BaseInferredValue<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 InferredValue.InferredPair<T> visit(AccessChild expression, InferredValue.InferredPair<T> receiver, InferredValue.InferredPair<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 BaseInferredValue<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 InferredValue.InferredPair<T> visit(MemoryAllocation expression, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aMemoryAllocation
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseInferredValue<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 InferredValue.InferredPair<T> visit(HeapReference expression, InferredValue.InferredPair<T> arg, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aHeapReference
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseInferredValue<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 InferredValue.InferredPair<T> visit(HeapDereference expression, InferredValue.InferredPair<T> arg, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aHeapDereference
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseInferredValue<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 InferredValue.InferredPair<T> visit(UnaryExpression expression, InferredValue.InferredPair<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 BaseInferredValue<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 InferredValue.InferredPair<T> visit(BinaryExpression expression, InferredValue.InferredPair<T> left, InferredValue.InferredPair<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 BaseInferredValue<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 InferredValue.InferredPair<T> visit(TernaryExpression expression, InferredValue.InferredPair<T> left, InferredValue.InferredPair<T> middle, InferredValue.InferredPair<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 BaseInferredValue<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 InferredValue.InferredPair<T> visit(Skip expression, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aSkip
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseInferredValue<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 InferredValue.InferredPair<T> visit(PushAny expression, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aPushAny
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseInferredValue<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 InferredValue.InferredPair<T> visit(PushInv expression, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aPushInv
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseInferredValue<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 InferredValue.InferredPair<T> visit(Constant expression, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits aConstant
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseInferredValue<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 InferredValue.InferredPair<T> visit(Identifier expression, java.lang.Object... params) throws SemanticException
Description copied from interface:ExpressionVisitor
Visits anIdentifier
.- Specified by:
visit
in interfaceExpressionVisitor<T extends BaseInferredValue<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 InferredValue.InferredPair<T> visit(ValueExpression expression, InferredValue.InferredPair<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 BaseInferredValue<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
-
-