Package it.unive.lisa.symbolic
Interface ExpressionVisitor<T>
-
- Type Parameters:
T- the return type of the visiting callbacks
- All Known Implementing Classes:
BaseHeapDomain.Rewriter,PointBasedHeap.Rewriter
public interface ExpressionVisitor<T>A visitor forSymbolicExpressions, to be used as parameter toSymbolicExpression.accept(ExpressionVisitor, Object...). The expression will invoke the callbacks provided by this interface while traversing its structure.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tvisit(AccessChild expression, T receiver, T child, java.lang.Object... params)Visits anAccessChild.Tvisit(HeapAllocation expression, java.lang.Object... params)Visits aHeapAllocation.Tvisit(HeapDereference expression, T arg, java.lang.Object... params)Visits aHeapDereference.Tvisit(HeapReference expression, T arg, java.lang.Object... params)Visits aHeapReference.Tvisit(BinaryExpression expression, T left, T right, java.lang.Object... params)Visits aBinaryExpression.Tvisit(Constant expression, java.lang.Object... params)Visits aConstant.Tvisit(Identifier expression, java.lang.Object... params)Visits anIdentifier.Tvisit(PushAny expression, java.lang.Object... params)Visits aPushAny.Tvisit(Skip expression, java.lang.Object... params)Visits aSkip.Tvisit(TernaryExpression expression, T left, T middle, T right, java.lang.Object... params)Visits aTernaryExpression.Tvisit(UnaryExpression expression, T arg, java.lang.Object... params)Visits aUnaryExpression.
-
-
-
Method Detail
-
visit
T visit(AccessChild expression, T receiver, T child, java.lang.Object... params) throws SemanticException
Visits anAccessChild. This callback is invoked after the inner expressions have been visited, and their produced value is passed as argument.- 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
T visit(HeapAllocation expression, java.lang.Object... params) throws SemanticException
Visits aHeapAllocation.- 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
T visit(HeapReference expression, T arg, java.lang.Object... params) throws SemanticException
Visits aHeapReference.- 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
T visit(HeapDereference expression, T arg, java.lang.Object... params) throws SemanticException
Visits aHeapDereference.- 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
T visit(UnaryExpression expression, T arg, java.lang.Object... params) throws SemanticException
Visits aUnaryExpression. This callback is invoked after the inner expressions have been visited, and their produced value is passed as argument.- 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
T visit(BinaryExpression expression, T left, T right, java.lang.Object... params) throws SemanticException
Visits aBinaryExpression. This callback is invoked after the inner expressions have been visited, and their produced value is passed as argument.- 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
T visit(TernaryExpression expression, T left, T middle, T right, java.lang.Object... params) throws SemanticException
Visits aTernaryExpression. This callback is invoked after the inner expressions have been visited, and their produced value is passed as argument.- 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
T visit(Skip expression, java.lang.Object... params) throws SemanticException
Visits aSkip.- 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
T visit(PushAny expression, java.lang.Object... params) throws SemanticException
Visits aPushAny.- 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
T visit(Constant expression, java.lang.Object... params) throws SemanticException
Visits aConstant.- 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
T visit(Identifier expression, java.lang.Object... params) throws SemanticException
Visits anIdentifier.- 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
-
-