Package it.unive.lisa.program
Class ConstantGlobal
- java.lang.Object
-
- it.unive.lisa.program.Global
-
- it.unive.lisa.program.ConstantGlobal
-
- All Implemented Interfaces:
CodeElement
public class ConstantGlobal extends Global
A global variable, scoped by its container, that is fixed to a statically constant (and immutable) value. A constant global is never an instance global.
-
-
Constructor Summary
Constructors Constructor Description ConstantGlobal(CodeLocation location, Unit container, java.lang.String name, Constant constant)
Builds an constant global variable, identified by its name.ConstantGlobal(CodeLocation location, Unit container, java.lang.String name, Constant constant, Annotations annotations)
Builds the constant global, identified by its name, happening at the given location in the program.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Constant
getConstant()
Yields the constant value associated to this global.int
hashCode()
java.lang.String
toString()
-
Methods inherited from class it.unive.lisa.program.Global
addAnnotation, getAnnotations, getContainer, getLocation, getName, getStaticType, isInstance, toSymbolicVariable
-
-
-
-
Constructor Detail
-
ConstantGlobal
public ConstantGlobal(CodeLocation location, Unit container, java.lang.String name, Constant constant)
Builds an constant global variable, identified by its name. The type of this global is the one of the constant.- Parameters:
location
- the location of this global variablecontainer
- theUnit
containing this globalname
- the name of this globalconstant
- the constant value of this global
-
ConstantGlobal
public ConstantGlobal(CodeLocation location, Unit container, java.lang.String name, Constant constant, Annotations annotations)
Builds the constant global, identified by its name, happening at the given location in the program.- Parameters:
location
- the location where this global is defined within the programcontainer
- theUnit
containing this globalname
- the name of this globalconstant
- the constant value of this globalannotations
- the annotations of this global variable
-
-
Method Detail
-
getConstant
public Constant getConstant()
Yields the constant value associated to this global.- Returns:
- the constant value
-
-