public class Kernel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
ip
The Instruction Pointer which is the location of the next
instruction to be processed by the inner interpreter.
|
Modifier and Type | Method and Description |
---|---|
int |
colonDef(XT xt)
The colon definition hander.
|
int |
constantDef(XT xt)
The constant definition handler.
|
int |
definition(XT xt)
Execute a user definition.
|
int |
doesDef(XT xt)
The does definition handler.
|
int |
execute(XT xt)
Execute the given XT, converting any Java based exceptions into
the equivalent Forth Exceptions.
|
int |
variableDef(XT xt)
The variable definition handler.
|
public int ip
public Kernel(VM vm)
public int execute(XT xt) throws ForthException, java.lang.Exception
xt
- the XT to be executed.ForthException
- should the XT cause an exception it is converted
into a suitable ForthException.java.lang.Exception
- should the XT cause an exception that is not
catered for by the ForthException, or is caused
by the implementation, any other form of Exception
may be thrown.public int definition(XT xt) throws java.lang.Exception
Def
. Example include, but are not
limited to:
The handler for these XT's must process the additional address
on the stack.
The word >BODY
will reject any definition which does
not reference a xxxDef
handler.xt
- the XT of the current definitionjava.lang.Exception
- Any exception that may be raised by the
definition handler.public int variableDef(XT xt)
xt
- the XT of the current definition;public int constantDef(XT xt)
xt
- the XT of the current definitionpublic int colonDef(XT xt) throws ForthException, java.lang.Exception
xt
- the XT of the current definitionForthException
- as generated by the definition or the return stack.java.lang.Exception
- an error in the implementation.public int doesDef(XT xt) throws ForthException, java.lang.Exception
CREATE
part of the definition.xt
- the XT of the current definitionForthException
- as generated by the definition or the return stack.java.lang.Exception
- an error in the implementation.