|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectautohit.vm.i.VMInstruction
A Virtual Machine instruction base class. All vm instructions extend this class. This class also defines the static/final tokens and related constants used by both the vm and the compiler.
We will implement Serializable with this base class, so all final instruction classes will inherit it,
I thought about making this an interface, but since this IS a vm, it seem like a needless slowdown of a class that is going to get banged around enough as it is.
This class defines the numeric token for all instructions. So, if you create a new instruction, be sure to add a token for it in this class... and recompile ALL of the packages.
All derived-class constructors must set the numeric token.
EPG - Rewrite - 9Apr03
EPG - Add goto - 16Jul03
Field Summary | |
static int |
ASSERT
|
static int |
CALL
|
static int |
CLEAR
|
static int |
EVAL
|
static int |
EXEC
|
static int |
FAULT
|
static int |
FETCH
|
static int |
GOTO
|
static int |
IF
|
int |
instruction
instruction |
static int |
JUMP
|
static int |
LOAD
|
static int |
MASK
|
static int |
MATH
|
static int |
MERGE
|
static int |
METHOD
|
static int |
NEW
|
static int |
NOP
Numeric token values. |
static int |
REDUCE
|
static int |
RIGHT
|
static int |
RSCOPE
|
static int |
SCOPE
|
int |
sourceline
source code line - good for debugging TODO sourceline doesn't actually work |
static int |
STORE
|
static int |
SUBR
|
Constructor Summary | |
VMInstruction()
Default constructor Normally you would use the other constructor. |
|
VMInstruction(int I)
Typical constructor. |
Method Summary | |
java.lang.String |
dump()
Dump this Instruction. |
java.lang.String |
toString()
Dump this Instruction. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int NOP
public static final int EVAL
public static final int STORE
public static final int NEW
public static final int SCOPE
public static final int RSCOPE
public static final int REDUCE
public static final int MASK
public static final int MERGE
public static final int RIGHT
public static final int MATH
public static final int LOAD
public static final int CLEAR
public static final int FAULT
public static final int FETCH
public static final int IF
public static final int CALL
public static final int EXEC
public static final int SUBR
public static final int JUMP
public static final int GOTO
public static final int ASSERT
public static final int METHOD
public int instruction
public int sourceline
Constructor Detail |
public VMInstruction()
public VMInstruction(int I)
Method Detail |
public java.lang.String toString()
public java.lang.String dump()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |