Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| GNU Prolog for Java
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## gnu.prolog.vm.interpreter
Class ExecutionState

    java.lang.Object
      gnu.prolog.vm.interpreter.ExecutionState

    public class ExecutionState

extends Object

execution state class

Field Summary
`Term[]` | `args` arguments
`static int` | `BACKTRACK` instruction return code indicating need for backtracking
`Term[]` | `environment` current environment
`Interpreter` | `interpreter` current interpreter
`static int` | `JUMP` instruction return code indicating success.
`int` | `jumpPosition` current position
`static int` | `NEXT` instruction return code indicating success.
`List<Term>` | `pushdown` pushdown stack, used for unification and calls
`static int` | `RETURN` instruction return code indicating success.
`BacktrackInfo` | `startBacktrackInfo` current backtrack info, only active on backtracking

Constructor Summary
`ExecutionState()`

Method Summary
`CallBacktrackInfo` | `getCallBacktrackInfo(int codePosition, Term[] args, PrologCode code, CompoundTermTag tag)` get BacktrackInfo for call instruction.
`EnterBacktrackInfo` | `getEnterBacktrackInfo()` get enter backtrack info
`Term` | `getEnvironment(int environmentIndex)` get term from environment
`LeaveBacktrackInfo` | `getLeaveBacktrackInfo()` get leave backtrack info
`RetryBacktrackInfo` | `getRetryBacktrackInfo(int retryPosition)` get BacktrackInfo for try family instructions.
`BacktrackInfo` | `peekBacktrackInfo()` peek backtrack info w/o popping it
`BacktrackInfo` | `popBacktrackInfo()` pop backtrack info from stack
`Term` | `popPushDown()` pop term from pushdown stack
`void` | `pushBacktrackInfo(BacktrackInfo cbi)` push backtrack info to stack
`void` | `pushPushDown(Term term)` push term to pushdown stack
`void` | `putEnvironment(int environmentIndex, Term term)` put term to environment

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### BACKTRACK

    public static final int BACKTRACK

  instruction return code indicating need for backtracking

  See Also:
    Constant Field Values

### NEXT

    public static final int NEXT

  instruction return code indicating success. backtrack information may or not be created

  See Also:
    Constant Field Values

### JUMP

    public static final int JUMP

  instruction return code indicating success. jump to position in instruction pointer needed

  See Also:
    Constant Field Values

### RETURN

    public static final int RETURN

  instruction return code indicating success. return from function needed.

  See Also:
    Constant Field Values

### interpreter

    public Interpreter interpreter

  current interpreter

### startBacktrackInfo

    public BacktrackInfo startBacktrackInfo

  current backtrack info, only active on backtracking

### environment

    public Term[] environment

  current environment

### pushdown

    public List<Term> pushdown

  pushdown stack, used for unification and calls

### jumpPosition

    public int jumpPosition

  current position

### args

    public Term[] args

  arguments

Constructor Detail

### ExecutionState

    public ExecutionState()

Method Detail

### popBacktrackInfo

    public BacktrackInfo popBacktrackInfo()

  pop backtrack info from stack

  Returns:
    the popped backtrack info from the stack

### peekBacktrackInfo

    public BacktrackInfo peekBacktrackInfo()

  peek backtrack info w/o popping it

  Returns:
    the top of the backtrack info stack without popping

### pushBacktrackInfo

    public void pushBacktrackInfo(BacktrackInfo cbi)

  push backtrack info to stack

  Parameters:
    `cbi` -

### getCallBacktrackInfo

    public CallBacktrackInfo getCallBacktrackInfo(int codePosition,
                                                  Term[] args,
                                                  PrologCode code,
                                                  CompoundTermTag tag)

  get BacktrackInfo for call instruction.

  Parameters:
    `codePosition` -
    `args` -
    `code` -
    `tag` -
  Returns:
    BacktrackInfo for call instruction

### getRetryBacktrackInfo

    public RetryBacktrackInfo getRetryBacktrackInfo(int retryPosition)

  get BacktrackInfo for try family instructions.

  Parameters:
    `retryPosition` -
  Returns:
    BacktrackInfo for try family instructions

### popPushDown

    public Term popPushDown()

  pop term from pushdown stack

  Returns:
    term removed from pushdown stack

### pushPushDown

    public void pushPushDown(Term term)

  push term to pushdown stack

  Parameters:
    `term` -

### getEnvironment

    public Term getEnvironment(int environmentIndex)

  get term from environment

  Parameters:
    `environmentIndex` -
  Returns:
    term from environment

### putEnvironment

    public void putEnvironment(int environmentIndex,
                               Term term)

  put term to environment

  Parameters:
    `environmentIndex` -
    `term` -

### getLeaveBacktrackInfo

    public LeaveBacktrackInfo getLeaveBacktrackInfo()

  get leave backtrack info

  Returns:
    the leave backtrack info

### getEnterBacktrackInfo

    public EnterBacktrackInfo getEnterBacktrackInfo()

  get enter backtrack info

  Returns:
    the enter backtrack info

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| GNU Prolog for Java
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD