tip.instructions
Class Instruction

java.lang.Object
  extended by tip.instructions.Instruction
Direct Known Subclasses:
Iadd, Iaload, Icall, Icall_indirect, Ideref, Idiv, Iinput, Ilabel, Iload, Iloadc, Imalloc, Imload, Imstore, Imul, Ioutput, Ireturn, Istore, Isub, JumpInstruction

public abstract class Instruction
extends Object


Field Summary
 int location
           
 
Constructor Summary
Instruction()
           
 
Method Summary
abstract  int[] genCode()
           
abstract  int getCodeSize()
           
 int getID()
          Returns an identification number associated with the instruction type.
static int getID(Class<? extends Instruction> c)
          Returns an identification number associated with the instruction type.
abstract  String toAsm()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

location

public int location
Constructor Detail

Instruction

public Instruction()
Method Detail

getID

public final int getID()
Returns an identification number associated with the instruction type. Each instruction class gets a unique ID which can be used to do efficient switching on instruction types.


getID

public static int getID(Class<? extends Instruction> c)
Returns an identification number associated with the instruction type. Each instruction class gets a unique ID which can be used to do efficient switching on instruction types.

Parameters:
c - the instruction class to get the ID for

toAsm

public abstract String toAsm()

genCode

public abstract int[] genCode()

getCodeSize

public abstract int getCodeSize()