|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NewArrayInstruction
x = new T[y1]...[yn] or x = new T[]...[] = z.
ArrayCreation
Method Summary | |
---|---|
ArrayType |
getArrayType()
Returns the type of the array being created. |
List<Variable> |
getDimensionOperands()
Returns the list of operands specifying dimensions of the allocated array. |
int |
getDimensions()
Returns the number of dimensions in the new array. |
Variable |
getInitOperand()
Returns the array initializer, if any. |
ASTNode |
getNode()
Returns the node this instruction is for. |
int |
getUnallocated()
Returns the number of dimensions that will be initialized with null cells. |
boolean |
isInitialized()
Indicates whether this array has an initializer associated with it. |
Methods inherited from interface edu.cmu.cs.crystal.tac.model.AssignmentInstruction |
---|
getTarget |
Methods inherited from interface edu.cmu.cs.crystal.tac.model.TACInstruction |
---|
transfer, transfer |
Method Detail |
---|
ASTNode getNode()
ArrayCreation
. Usually,
one instruction exists per AST node, but can be more
when AST nodes are desugared, such as for post-increment.
getNode
in interface TACInstruction
TACInstruction.getNode()
ArrayType getArrayType()
List<Variable> getDimensionOperands()
new T[y1]...[yn]
this would be variables y1, ..., yn. This is only interesting
if isInitialized()
returns false
.
int getDimensions()
int getUnallocated()
null
cells.
null
cells.boolean isInitialized()
true
,
the initializer can be retrieved with getInitOperand()
.
true
if this array has an initializer,
false
otherwise.Variable getInitOperand()
null
if there is none.to test whether this array
has an initializer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |