|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcfg.TACInst
cfg.BinaryInst
public abstract class BinaryInst
A generic class representing a three-address code binary instruction (BinaryInst). It is extended by several specific binary instructions: (BinaryAddInst, BinarySubInst, BinaryMulInst, BinaryDivInst, BinaryModInst, BinaryAndInst, BinaryOrInst, BinaryEqInst, BinaryNEInst, BinaryLTInst, BinaryLEInst, and BinaryGTInst, and BinaryGEInst). A binary instruction consists of a destination variable and two source operands (the types allowed for the two sources depends on the particular type of binary instruction). From TACInst it also inherits an opcode.
Field Summary | |
---|---|
protected java.lang.String |
destination
Destination variable |
protected java.lang.String |
leftSource
Left source operand (type of source allowed varies in different binary instructions) |
protected java.lang.String |
rightSource
Right source operand (type of source allowed varies in different binary instructions) |
Fields inherited from class cfg.TACInst |
---|
BINADD, BINAND, BINDIV, BINMOD, BINMUL, BINOR, BINSUB, comments, DIRCALL, ERRPARAM, IF, INDIRCALL, LDADDR, LDCONST, LDENTRY, LDVAR, NUM_INSN_TYPES, opcode, PHI, REFPARAM, RETN, STDPARAM, STENTRY, UNNEG, UNNOT |
Constructor Summary | |
---|---|
BinaryInst(int opcode,
java.lang.String destination,
java.lang.String leftSource,
java.lang.String rightSource)
BinaryInst constructor |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Compares this object with the parameter object |
java.lang.String |
getDestination()
Get the destination operand variable |
java.lang.String |
getLeftSource()
Get the left source operand |
java.lang.String |
getRightSource()
Get the right source operand |
java.lang.String |
getString()
Get string representation of instruction (without comments) (note: in general, you want to use toString() to get instruction string) |
void |
setDestination(java.lang.String destination)
Set the destination operand variable |
abstract void |
setLeftSource(java.lang.String leftSource)
Set the left source operand |
abstract void |
setRightSource(java.lang.String rightSource)
Set the right source operand |
Methods inherited from class cfg.TACInst |
---|
accept, addComment, checkBoolConst, checkConst, checkIntConst, checkLabel, checkStrConst, checkVar, getBinaryOpcode, getComments, getOp, getOpcode, getUnaryOpcode, isBinary, isCall, isIf, isLoad, isParam, isReturn, isStore, isUnary, isValidID, removeComments, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String destination
protected java.lang.String leftSource
protected java.lang.String rightSource
Constructor Detail |
---|
public BinaryInst(int opcode, java.lang.String destination, java.lang.String leftSource, java.lang.String rightSource)
opcode
- opcode of binary instructiondestination
- destination variableleftSource
- source operand (type of source allowed varies in
different binary insn)rightSource
- source operand (type of source allowed varies in
different binary insn)branch
- branch of this phi assignment (for upward recursion)Method Detail |
---|
public java.lang.String getDestination()
public void setDestination(java.lang.String destination)
destination
- new destination operandpublic java.lang.String getLeftSource()
public abstract void setLeftSource(java.lang.String leftSource)
leftSource
- new left source operandpublic java.lang.String getRightSource()
public abstract void setRightSource(java.lang.String rightSource)
rightSource
- new right source operandpublic boolean equals(java.lang.Object o)
equals
in class TACInst
o
- object to compare the reference object with
public java.lang.String getString()
getString
in class TACInst
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |