|
GNU Prolog for Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.prolog.vm.interpreter.InterpretedByteCode
public class InterpretedByteCode
Interpreted Code. This class is used by call_term instruction and InterpretedCode
Field Summary | |
---|---|
protected CompoundTermTag |
codeTag
tag of this code |
protected AtomicTerm[] |
constants
constants used by code |
protected ExceptionHandlerInfo[] |
exceptionHandlers
set of exception handlers |
static int |
IALLOCATE
|
static int |
ICALL
|
static int |
ICREATE_COMPOUND
|
static int |
ICREATE_VARIABLE
|
static int |
ICUT
|
static int |
IDUP
|
static int |
IFAIL
|
static int |
IJUMP
|
protected byte[] |
instructions
set of instructions |
static int |
IPOP
|
static int |
IPUSH_ARGUMENT
|
static int |
IPUSH_CONSTANT
|
static int |
IPUSH_ENVIRONMENT
|
static int |
IRETRY_ME_ELSE
|
static int |
IRETURN
|
static int |
ISAVE_CUT
|
static int |
ISTORE_ENVIRONMENT
|
static int |
ITHROW
|
static int |
ITRUE
|
static int |
ITRUST_ME
|
static int |
ITRY_ME_ELSE
|
static int |
IUNIFY
|
protected PrologCode[] |
predicateCodes
predicate codes used by code |
protected CompoundTermTag[] |
tags
tags used by code |
Fields inherited from interface gnu.prolog.vm.PrologCode |
---|
FAIL, HALT, SUCCESS, SUCCESS_LAST |
Constructor Summary | |
---|---|
protected |
InterpretedByteCode(CompoundTermTag codeTag,
Instruction[] isrc,
ExceptionHandlerInfo[] ehs)
constructor of code |
Method Summary | |
---|---|
int |
execute(Interpreter interpreter,
boolean backtrackMode,
Term[] args)
this method is used for execution of code |
String |
getIntruction(int currentPosition)
convert code to string |
void |
install(Environment env)
this method is called when code is installed to the environment code can be installed only for one environment. |
protected void |
pass1(Instruction[] isrc,
int[] ipos,
Map<CompoundTermTag,Integer> tag2idx,
Map<AtomicTerm,Integer> constant2idx)
|
protected void |
pass2(Instruction[] isrc,
int[] ipos,
Map<CompoundTermTag,Integer> tag2idx,
Map<AtomicTerm,Integer> constant2idx)
|
void |
prologCodeUpdated(PrologCodeUpdatedEvent evt)
this method is called when prolog code was updated |
String |
toString()
convert code to string |
void |
uninstall(Environment env)
this method is called when code is uninstalled from the environment |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected CompoundTermTag codeTag
protected CompoundTermTag[] tags
protected AtomicTerm[] constants
protected PrologCode[] predicateCodes
protected byte[] instructions
protected ExceptionHandlerInfo[] exceptionHandlers
public static final int IALLOCATE
public static final int ICALL
public static final int ICREATE_COMPOUND
public static final int ICREATE_VARIABLE
public static final int ICUT
public static final int IDUP
public static final int IFAIL
public static final int IJUMP
public static final int IPOP
public static final int IPUSH_ARGUMENT
public static final int IPUSH_CONSTANT
public static final int IPUSH_ENVIRONMENT
public static final int IRETRY_ME_ELSE
public static final int IRETURN
public static final int ISAVE_CUT
public static final int ISTORE_ENVIRONMENT
public static final int ITHROW
public static final int ITRUE
public static final int ITRUST_ME
public static final int ITRY_ME_ELSE
public static final int IUNIFY
Constructor Detail |
---|
protected InterpretedByteCode(CompoundTermTag codeTag, Instruction[] isrc, ExceptionHandlerInfo[] ehs)
Method Detail |
---|
protected void pass1(Instruction[] isrc, int[] ipos, Map<CompoundTermTag,Integer> tag2idx, Map<AtomicTerm,Integer> constant2idx)
protected void pass2(Instruction[] isrc, int[] ipos, Map<CompoundTermTag,Integer> tag2idx, Map<AtomicTerm,Integer> constant2idx)
public int execute(Interpreter interpreter, boolean backtrackMode, Term[] args) throws PrologException
execute
in interface PrologCode
interpreter
- interpreter in which context code is executedbacktrackMode
- true if predicate is called on backtracking and false otherwiseargs
- arguments of code
PrologException
public void prologCodeUpdated(PrologCodeUpdatedEvent evt)
prologCodeUpdated
in interface PrologCodeListener
public void install(Environment env)
install
in interface Installable
env
- Environment to install the predicatepublic void uninstall(Environment env)
uninstall
in interface Installable
env
- Environment to install the predicatepublic String toString()
toString
in class Object
public String getIntruction(int currentPosition)
|
GNU Prolog for Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |