|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LoadLiteralInstruction
x = l, an assignment of a literal value to a variable.
Example:
a = 4;
Method Summary | |
---|---|
java.lang.Object |
getLiteral()
This method returns the literal node that is being assigned in this 3 address code statement. |
ASTNode |
getNode()
Returns the node this instruction is for. |
boolean |
isNonNullString()
Indicates whether this loads a string
literal. |
boolean |
isNull()
Indicates whether this loads the null literal. |
boolean |
isNumber()
Indicates the load of a number such as an int . |
boolean |
isPrimitive()
Indicates the load of a primitive value. |
Methods inherited from interface edu.cmu.cs.crystal.tac.AssignmentInstruction |
---|
getTarget |
Methods inherited from interface edu.cmu.cs.crystal.tac.TACInstruction |
---|
transfer, transfer |
Method Detail |
---|
ASTNode getNode()
Expression
. 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()
java.lang.Object getLiteral()
isPrimitive()
isNull()
methods
may be helpful here if you are trying to do something clever based on which
literal is actually being assigned.instanceof
tests on the return
type and cast it into something that is actually helpful.
boolean isPrimitive()
true
if this is a load of a primitive value,
false
otherwise.boolean isNumber()
int
.
Implies isPrimitive()
true
if this is a load of a number,
false
otherwise.boolean isNull()
null
literal.
true
if this loads the null
literal, false
otherwise.boolean isNonNullString()
string
literal.
true
if this loads a string
,
false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |