Package it.unive.lisa.symbolic.heap
Class MemoryAllocation
- java.lang.Object
-
- it.unive.lisa.symbolic.SymbolicExpression
-
- it.unive.lisa.symbolic.heap.HeapExpression
-
- it.unive.lisa.symbolic.heap.MemoryAllocation
-
- All Implemented Interfaces:
ScopedObject<SymbolicExpression>
public class MemoryAllocation extends HeapExpression
An allocation of a memory location.
-
-
Constructor Summary
Constructors Constructor Description MemoryAllocation(Type staticType, CodeLocation location)
Builds the heap allocation.MemoryAllocation(Type staticType, CodeLocation location, boolean isStackAllocation)
Builds the heap allocation.MemoryAllocation(Type staticType, CodeLocation location, Annotations anns)
Builds the heap allocation.MemoryAllocation(Type staticType, CodeLocation location, Annotations anns, boolean isStackAllocation)
Builds the heap allocation.
-
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.boolean
equals(java.lang.Object obj)
Annotations
getAnnotations()
Yields the annotations of this expression.int
hashCode()
boolean
isStackAllocation()
Yields whether this memory allocation is allocated in the stack.java.lang.String
toString()
-
Methods inherited from class it.unive.lisa.symbolic.heap.HeapExpression
mightNeedRewriting, popScope, pushScope
-
Methods inherited from class it.unive.lisa.symbolic.SymbolicExpression
getCodeLocation, getStaticType
-
-
-
-
Constructor Detail
-
MemoryAllocation
public MemoryAllocation(Type staticType, CodeLocation location)
Builds the heap allocation.- Parameters:
staticType
- the static type of this expressionlocation
- the code location of the statement that has generated this expression
-
MemoryAllocation
public MemoryAllocation(Type staticType, CodeLocation location, Annotations anns)
Builds the heap allocation.- Parameters:
staticType
- the static type of this expressionlocation
- the code location of the statement that has generated this expressionanns
- the annotations of this memory allocation
-
MemoryAllocation
public MemoryAllocation(Type staticType, CodeLocation location, boolean isStackAllocation)
Builds the heap allocation.- Parameters:
staticType
- the static type of this expressionlocation
- the code location of the statement that has generated this expressionisStackAllocation
- if this allocation is allocated in the stack
-
MemoryAllocation
public MemoryAllocation(Type staticType, CodeLocation location, Annotations anns, boolean isStackAllocation)
Builds the heap allocation.- Parameters:
staticType
- the static type of this expressionlocation
- the code location of the statement that has generated this expressionanns
- the annotations of this memory allocationisStackAllocation
- if this allocation is allocated in the stack
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classSymbolicExpression
-
isStackAllocation
public boolean isStackAllocation()
Yields whether this memory allocation is allocated in the stack.- Returns:
- whether this memory allocation is allocated in the stack
-
getAnnotations
public Annotations getAnnotations()
Yields the annotations of this expression.- Returns:
- the annotations of this expression
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classSymbolicExpression
-
toString
public java.lang.String toString()
- Specified by:
toString
in classSymbolicExpression
-
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
-
-