| 
 | GNU Prolog for Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgnu.prolog.vm.interpreter.InterpretedCodeCompiler
public class InterpretedCodeCompiler
compiler from predicate to interpreted code This version assume following
| Field Summary | |
|---|---|
| protected  int | allocatedReservednumber of already allocated reserved variables | 
| static CompoundTermTag | catchTagcatch tag | 
| protected  List<Instruction> | codecode so far compiled | 
| protected  CompoundTermTag | codeTagthis predicate tag | 
| protected  int | currentCodePositioncurrent code position | 
| protected  List<Integer> | cutPositionStackcut position stack | 
| static ExceptionHandlerInfo[] | exceptionHandlerArrayConstantarray type constant ExceptionHandlerInfo.class | 
| protected  List<ExceptionHandlerInfo> | exceptionHandlersexception handlers | 
| static Instruction[] | instructionArrayConstantarray type constant for Instruction.class | 
| protected  int | numberOfReservednumber of reserved fields, one position for saving cut | 
| protected  List<Term> | passedClausesclauses to compile | 
| static CompoundTermTag | throwTagthrow tag | 
| static CompoundTermTag | unifyTagunify tag | 
| protected  Map<Term,Integer> | variableToEnvironmentIndexmapping from variables to environment indexes | 
| Constructor Summary | |
|---|---|
| InterpretedCodeCompiler(List<Term> clauses)a constructor | |
| Method Summary | |
|---|---|
| protected  int | allocReserved() | 
| static PrologCode | compile(List<Term> passedClauses)compile set of clauses to interpreted code | 
| static Term | rdereferenced(Term term)recursively dereference term | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final CompoundTermTag unifyTag
public static final CompoundTermTag throwTag
public static final CompoundTermTag catchTag
public static final Instruction[] instructionArrayConstant
public static final ExceptionHandlerInfo[] exceptionHandlerArrayConstant
protected List<Instruction> code
protected List<ExceptionHandlerInfo> exceptionHandlers
protected int currentCodePosition
protected int allocatedReserved
protected Map<Term,Integer> variableToEnvironmentIndex
protected CompoundTermTag codeTag
protected int numberOfReserved
protected List<Integer> cutPositionStack
protected List<Term> passedClauses
| Constructor Detail | 
|---|
public InterpretedCodeCompiler(List<Term> clauses)
clauses - | Method Detail | 
|---|
protected int allocReserved()
public static Term rdereferenced(Term term)
term - to be recursively dereferenced
public static PrologCode compile(List<Term> passedClauses)
                          throws PrologException
passedClauses - clauses passed to compiler
PrologException| 
 | GNU Prolog for Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||