public class DimensionDefinition
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BASE_DIM |
static java.lang.String |
SEPARATOR |
Constructor and Description |
---|
DimensionDefinition(java.lang.String id,
java.lang.String lowerBound,
java.lang.String upperBound)
Constructs a new dimension object from the extracted information.
|
Modifier and Type | Method and Description |
---|---|
DimensionDefinition |
copy()
Create a new copy of the current dimension definition.
|
Xnode |
generateAllocateNode(XcodeProgram xcodeml)
Generate additional node to be inserted in the allocate statement
arrayIndex based on the dimension definition.
|
Xnode |
generateArrayIndex(XcodeML xcodeml)
Generate the array index that will be placed in the array reference for
this additional dimension.
|
Xnode |
generateIndexRange(XcodeML xcodeml,
boolean withStep)
Generate the correct indexRange element with lowerBound, upperBound and
step from the current dimension.
|
java.lang.String |
getIdentifier()
Get the identifier for the current dimension.
|
InsertionPosition |
getInsertionPosition()
Get the insertion position value for this dimension definition.
|
BoundDefinition |
getLowerBound()
Get lower bound definition.
|
BoundDefinition |
getUpperBound()
Get upper bound definition.
|
void |
setInsertionPosition(InsertionPosition position)
Set the insertion position value for this dimension definition.
|
java.lang.String |
toString() |
public static final java.lang.String SEPARATOR
public static final java.lang.String BASE_DIM
public DimensionDefinition(java.lang.String id, java.lang.String lowerBound, java.lang.String upperBound)
id
- Identifier of the defined dimension. Will be used as the
array index variable.lowerBound
- Lower bound of the dimension.upperBound
- Upper bound of the dimension.
TODO maybe add step information (in the grammar as well)public BoundDefinition getLowerBound()
public BoundDefinition getUpperBound()
public java.lang.String getIdentifier()
public InsertionPosition getInsertionPosition()
public void setInsertionPosition(InsertionPosition position)
position
- InsertionPosition enum value.public Xnode generateIndexRange(XcodeML xcodeml, boolean withStep)
xcodeml
- Current XcodeML program unit in which elements will be
created.withStep
- IF true, step element is created.public Xnode generateArrayIndex(XcodeML xcodeml)
xcodeml
- Current XcodeML program unit.public Xnode generateAllocateNode(XcodeProgram xcodeml)
xcodeml
- Current XcodeML program unit.public DimensionDefinition copy()
public java.lang.String toString()
toString
in class java.lang.Object