cfg
Class StoreEntryInst

java.lang.Object
  extended by cfg.TACInst
      extended by cfg.StoreEntryInst

public class StoreEntryInst
extends TACInst

A class representing a three-address code store entry instruction (StoreEntryInst), which stores a value an entry from an indexable variable or string constant. A store entry instruction consists of a destination operand (which must be indexable, e.g., an object variable), a source operand, and an index (which must be either an int variable or constant). From TACInst it also inherits an opcode (STENTRY).

Author:
Marc Corliss and Lori Pietraszek

Field Summary
protected  java.lang.String destination
          Destination operand, which must be indexable (e.g., object variable)
protected  java.lang.String source
          Source operand
 
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
StoreEntryInst(java.lang.String destination, java.lang.String source, java.lang.String index)
          StoreEntryInst constructor
 
Method Summary
<ReturnType,ArgumentType>
ReturnType
accept(TACInstVisitor<ReturnType,ArgumentType> visitor, ArgumentType o)
          Abstract visitor method.
 boolean equals(java.lang.Object o)
          Compares this object with the parameter object
 java.lang.String getDestination()
          Get the destination operand
 java.lang.String getIndex()
          Get the index
 java.lang.String getSource()
          Get the 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
 void setIndex(java.lang.String index)
          Set the index
 void setSource(java.lang.String source)
          Set the source operand
 
Methods inherited from class cfg.TACInst
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

destination

protected java.lang.String destination
Destination operand, which must be indexable (e.g., object variable)


source

protected java.lang.String source
Source operand

Constructor Detail

StoreEntryInst

public StoreEntryInst(java.lang.String destination,
                      java.lang.String source,
                      java.lang.String index)
StoreEntryInst constructor

Parameters:
destination - destination operand (which must be indexable, e.g., an object variable)
source - source operand
index - index to store entry to in destination operand (either int variable or constant)
Method Detail

getDestination

public java.lang.String getDestination()
Get the destination operand

Returns:
destination operand

setDestination

public void setDestination(java.lang.String destination)
Set the destination operand

Parameters:
destination - new destination operand

getSource

public java.lang.String getSource()
Get the source operand

Returns:
source operand

setSource

public void setSource(java.lang.String source)
Set the source operand

Parameters:
source - new source operand

getIndex

public java.lang.String getIndex()
Get the index

Returns:
index

setIndex

public void setIndex(java.lang.String index)
Set the index

Parameters:
index - new index

equals

public boolean equals(java.lang.Object o)
Compares this object with the parameter object

Specified by:
equals in class TACInst
Parameters:
o - object to compare the reference object with
Returns:
boolean indicating whether the objects are equivalent

getString

public java.lang.String getString()
Get string representation of instruction (without comments) (note: in general, you want to use toString() to get instruction string)

Specified by:
getString in class TACInst
Returns:
string representation of three address code instruction (without comments)

accept

public <ReturnType,ArgumentType> ReturnType accept(TACInstVisitor<ReturnType,ArgumentType> visitor,
                                                   ArgumentType o)
Description copied from class: TACInst
Abstract visitor method.

Specified by:
accept in class TACInst
Parameters:
visitor - TACInstVisitor.
o - Data to pass down.
Returns:
return value of visitor.