cfg
Class ErrParamInst

java.lang.Object
  extended by cfg.TACInst
      extended by cfg.ParamInst
          extended by cfg.ErrParamInst

public class ErrParamInst
extends ParamInst

A class representing a three-address code error parameter instruction (ErrParamInst). These parameters are used in calls to error subroutines to hold things such as filenames and line numbers, etc. An error parameter instruction consists of a type (e.g., ErrParamInst.FILENAME, etc.) and a source value (inherited from ParamInst). From TACInst it also inherits an opcode (ERRPARAM).

Author:
Marc Corliss and Lori Pietraszek

Field Summary
static int ARRAYIDXID
          ID for array index error parameter (used in extended compiler only)
static int ARRAYSIZEID
          ID for array size error parameter (used in extended compiler only)
static int FILENAME
          ID for filename error parameter (used in all error calls)
static int LINENUM
          ID for line number error parameter (used in all error calls)
static int OBJECTID
          ID for object type error parameter (used in class cast errors only)
static int TARGETID
          ID for target type error parameter (used in class cast errors only)
protected  int type
          Type (ID) of error parameter (e.g., ErrParamInst.FILENAME, etc.)
 
Fields inherited from class cfg.ParamInst
paramType, source
 
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
ErrParamInst(int type, java.lang.String value)
          ErrParamInst 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 getString()
          Get string representation of instruction (without comments) (note: in general, you want to use toString() to get instruction string)
 int getType()
          Get the type (ID) of error parameter (e.g., ErrParamInst.FILENAME, etc.)
 
Methods inherited from class cfg.ParamInst
getParamType, getSource, setSource
 
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

FILENAME

public static final int FILENAME
ID for filename error parameter (used in all error calls)

See Also:
Constant Field Values

LINENUM

public static final int LINENUM
ID for line number error parameter (used in all error calls)

See Also:
Constant Field Values

OBJECTID

public static final int OBJECTID
ID for object type error parameter (used in class cast errors only)

See Also:
Constant Field Values

TARGETID

public static final int TARGETID
ID for target type error parameter (used in class cast errors only)

See Also:
Constant Field Values

ARRAYSIZEID

public static final int ARRAYSIZEID
ID for array size error parameter (used in extended compiler only)

See Also:
Constant Field Values

ARRAYIDXID

public static final int ARRAYIDXID
ID for array index error parameter (used in extended compiler only)

See Also:
Constant Field Values

type

protected int type
Type (ID) of error parameter (e.g., ErrParamInst.FILENAME, etc.)

Constructor Detail

ErrParamInst

public ErrParamInst(int type,
                    java.lang.String value)
ErrParamInst constructor

Parameters:
type - type (ID) of error parameter (e.g., ErrParamInst.FILENAME, etc.)
value - source value of error parameter (as a string)
Method Detail

getType

public int getType()
Get the type (ID) of error parameter (e.g., ErrParamInst.FILENAME, etc.)

Returns:
type

equals

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

Overrides:
equals in class ParamInst
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)

Overrides:
getString in class ParamInst
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.