Package it.unive.lisa.symbolic.value
Class MemoryPointer
- java.lang.Object
-
- it.unive.lisa.symbolic.SymbolicExpression
-
- it.unive.lisa.symbolic.value.ValueExpression
-
- it.unive.lisa.symbolic.value.Identifier
-
- it.unive.lisa.symbolic.value.MemoryPointer
-
public class MemoryPointer extends Identifier
A memory pointer to a heap location.
-
-
Constructor Summary
Constructors Constructor Description MemoryPointer(Type staticType, HeapLocation loc, Annotations annotations, CodeLocation location)
Builds a memory pointer.MemoryPointer(Type staticType, HeapLocation loc, CodeLocation location)
Builds a memory pointer with empty annotations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
accept(ExpressionVisitor<T> visitor, java.lang.Object... params)
Accepts anExpressionVisitor
, visiting this expression recursively.HeapLocation
getReferencedLocation()
Yields the heap location pointed by this pointer.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.java.lang.String
toString()
-
Methods inherited from class it.unive.lisa.symbolic.value.Identifier
addAnnotation, equals, getAnnotations, getName, hashCode, isWeak, lub
-
Methods inherited from class it.unive.lisa.symbolic.value.ValueExpression
removeNegations
-
Methods inherited from class it.unive.lisa.symbolic.SymbolicExpression
getCodeLocation, getDynamicType, getRuntimeTypes, getStaticType, hasRuntimeTypes, setRuntimeTypes
-
-
-
-
Constructor Detail
-
MemoryPointer
public MemoryPointer(Type staticType, HeapLocation loc, CodeLocation location)
Builds a memory pointer with empty annotations.- Parameters:
staticType
- the static type of this expressionloc
- the heap location pointed by this memory pointerlocation
- the code location of the statement that has generated this expression
-
MemoryPointer
public MemoryPointer(Type staticType, HeapLocation loc, Annotations annotations, CodeLocation location)
Builds a memory pointer.- Parameters:
staticType
- the static type of this expressionloc
- the heap location pointed by this memory pointerannotations
- the annotation of this memory pointerlocation
- the code location of the statement that has generated this 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
-
getReferencedLocation
public HeapLocation getReferencedLocation()
Yields the heap location pointed by this pointer.- Returns:
- the heap location pointed by this pointer
-
accept
public <T> T accept(ExpressionVisitor<T> visitor, java.lang.Object... params) throws SemanticException
Description copied from class:SymbolicExpression
Accepts anExpressionVisitor
, visiting this expression recursively.- Specified by:
accept
in classSymbolicExpression
- Type Parameters:
T
- the type of value produced by the visiting callbacks- Parameters:
visitor
- the visitorparams
- additional optional parameters to pass to each visiting callback- Returns:
- the value produced by the visiting operation
- Throws:
SemanticException
- if an error occurs during the visiting
-
toString
public java.lang.String toString()
- Specified by:
toString
in classSymbolicExpression
-
-