Package it.unive.lisa.symbolic.heap
Class HeapExpression
- java.lang.Object
-
- it.unive.lisa.symbolic.SymbolicExpression
-
- it.unive.lisa.symbolic.heap.HeapExpression
-
- Direct Known Subclasses:
AccessChild
,HeapAllocation
,HeapDereference
,HeapReference
public abstract class HeapExpression extends SymbolicExpression
A symbolic expression that identifies a location in the program's heap. Instances of this expressions must be rewritten byHeapDomain
s to aValueExpression
before being evaluated from aValueDomain
.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
HeapExpression(Type type, CodeLocation location)
Builds the heap expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SymbolicExpression
popScope(ScopeToken token)
Pops the scope identified by the given token from the expression.SymbolicExpression
pushScope(ScopeToken token)
Pushes a new scope, identified by the give token, in the expression.-
Methods inherited from class it.unive.lisa.symbolic.SymbolicExpression
accept, equals, getCodeLocation, getDynamicType, getRuntimeTypes, getStaticType, hashCode, hasRuntimeTypes, setRuntimeTypes, toString
-
-
-
-
Constructor Detail
-
HeapExpression
protected HeapExpression(Type type, CodeLocation location)
Builds the heap expression.- Parameters:
type
- the static types of this expressionlocation
- the code location of the statement that has generated this heap expression
-
-
Method Detail
-
pushScope
public SymbolicExpression pushScope(ScopeToken token)
Description copied from class:SymbolicExpression
Pushes a new scope, identified by the give token, in the expression. This causes allVariable
s to becomeOutOfScopeIdentifier
s associated with the given token.- Specified by:
pushScope
in classSymbolicExpression
- Parameters:
token
- the token identifying the scope to push- Returns:
- a copy of this expression where the local variables have gone out of scope
-
popScope
public SymbolicExpression popScope(ScopeToken token) throws SemanticException
Description copied from class:SymbolicExpression
Pops the scope identified by the given token from the expression. This causes all the invisible variables (i.e.OutOfScopeIdentifier
s) mapped to the given scope to become visible (i.e.Variable
s) again.- Specified by:
popScope
in classSymbolicExpression
- Parameters:
token
- the token of the scope to be restored- Returns:
- a copy of this expression where the local variables associated with the given scope are visible again
- Throws:
SemanticException
- if an error occurs during the computation
-
-