cfg
Class ParamInst

java.lang.Object
  extended by cfg.TACInst
      extended by cfg.ParamInst
Direct Known Subclasses:
ErrParamInst, RefParamInst, StdParamInst

public abstract class ParamInst
extends TACInst

A generic class representing a three-address code parameter instruction (ParamInst). It is extended by three classes: StdParamInst, RefParamInst, and ErrParamInst. A parameter instruction consists of a source operand holding the value of the actual parameter expression. From TACInst it also inherits an opcode.

Author:
Marc Corliss and Lori Pietraszek

Field Summary
protected  java.lang.String paramType
          Type of the parameter (e.g., "stdparam", "refparam", errparam")
protected  java.lang.String source
          Source operand holding result of the actual parameter expression
 
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
ParamInst(int opcode, java.lang.String paramType, java.lang.String source)
          ParamInst constructor
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares this object with the parameter object
 java.lang.String getParamType()
          Get the parameter type (e.g., "stdparam", "refparam", errparam")
 java.lang.String getSource()
          Get the soure operand (result of parameter expression)
 java.lang.String getString()
          Get string representation of instruction (without comments) (note: in general, you want to use toString() to get instruction string)
 void setSource(java.lang.String source)
          Set the source operand (result of parameter expression)
 
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

paramType

protected java.lang.String paramType
Type of the parameter (e.g., "stdparam", "refparam", errparam")


source

protected java.lang.String source
Source operand holding result of the actual parameter expression

Constructor Detail

ParamInst

public ParamInst(int opcode,
                 java.lang.String paramType,
                 java.lang.String source)
ParamInst constructor

Parameters:
opcode - opcode of load instruction
paramType - type of the parameter (e.g., "stdparam", "refparam", errparam")
source - source operand holding value of the parameter expression
Method Detail

getSource

public java.lang.String getSource()
Get the soure operand (result of parameter expression)

Returns:
source operand

setSource

public void setSource(java.lang.String source)
Set the source operand (result of parameter expression)

Parameters:
source - new source operand

getParamType

public java.lang.String getParamType()
Get the parameter type (e.g., "stdparam", "refparam", errparam")

Returns:
parameter type

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)