Interface PsyContext

All Superinterfaces:
PsyObject
All Known Implementing Classes:
Interpreter

@Type("context") public interface PsyContext extends PsyObject
The representation of context, an execution context.
  • Field Details

  • Method Details

    • getId

      long getId()
    • join

      void join() throws InterruptedException
      Throws:
      InterruptedException
    • toSyntaxString

      default String toSyntaxString()
      Description copied from interface: PsyObject
      Returns the syntactic representation of this object.
      Specified by:
      toSyntaxString in interface PsyObject
      Returns:
      the syntactic representation of this object.
    • psyCurrentContext

      static PsyContext psyCurrentContext()
      Returns the currently executing context.
      Returns:
      the currently executing context.
    • fork

      Throws:
      PsyStackUnderflowException
      PsyUnmatchedMarkException
    • quit

      void quit()
    • stop_

      void stop_()
    • operandStack

      OperandStack operandStack()
      Returns the operand stack.
      Returns:
      the operand stack.
    • dictStack

      DictStack dictStack()
      Returns the dictionary stack.
      Returns:
      the dictionary stack.
    • executionStack

      ExecutionStack executionStack()
      Returns the execution stack.
      Returns:
      the execution stack.
    • systemDict

      PsyFormalDict systemDict()
      Returns the system dictionary.
      Returns:
      the system dictionary.
    • userDict

      PsyFormalDict userDict()
      Returns the user dictionary.
      Returns:
      the user dictionary.
    • currentDict

      PsyFormalDict currentDict()
      Returns the current dictionary (the topmost on the dictionary stack).
      Returns:
      the current dictionary.
    • namespacePool

      NamespacePool namespacePool()
      Returns the namespace pool.
      Returns:
      the namespace pool.
    • execLevel

      int execLevel()
      Returns the size of the execution stack.
      Returns:
      the size of the execution stack.
    • pushLoopLevel

      int pushLoopLevel()
      Pushes the current execution level onto the loop stack and returns this level.
      Returns:
      the current execution level.
    • popLoopLevel

      int popLoopLevel()
      Removes the execution level from the loop stack and returns this level or -1 if the loop stack is empty.
      Returns:
      the execution level on the top of the loop stack or -1 if the loop stack is empty.
    • currentLoopLevel

      int currentLoopLevel()
      Returns the topmost execution level at the loop stack or -1 if the loop stack is empty.
      Returns:
      the topmost execution level at the loop stack or -1 if the loop stack is empty.
    • pushStopLevel

      int pushStopLevel()
      Pushes the current execution level onto the stop stack and returns this level.
      Returns:
      the current execution level.
    • popStopLevel

      int popStopLevel()
      Removes the execution level from the stop stack and returns this level or -1 if the stop stack is empty.
      Returns:
      the execution level on the top of the stop stack or -1 if the stop stack is empty.
    • currentStopLevel

      int currentStopLevel()
      Returns the topmost execution level at the stop stack or -1 if the stop stack is empty.
      Returns:
      the topmost execution level at the stop stack or -1 if the stop stack is empty.
    • repl

      void repl() throws PsyErrorException
      Throws:
      PsyErrorException
    • getStopped

      boolean getStopped()
      Gets the stopped flag to the specified value.
      Returns:
      the value of the stopped flag.
    • setStopped

      void setStopped(boolean stopFlag)
      Sets the stopped flag to the specified value.
      Parameters:
      stopFlag - the value of the stopped flag.
    • handleExecutionStack

      void handleExecutionStack(int level)
    • interpret

      void interpret(PsyReader oReader)
    • interpretBraced

      void interpretBraced(PsyReader oReader) throws PsyErrorException
      Throws:
      PsyErrorException
    • operandStackBacked

      OperandStack operandStackBacked(int count) throws PsyStackUnderflowException
      Throws:
      PsyStackUnderflowException
    • psyWhere

      default Optional<PsyFormalDict> psyWhere(PsyTextual oKey)
    • psyLoad

      <T extends PsyObject> T psyLoad(PsyTextual oKey) throws PsyUndefinedException
      Throws:
      PsyUndefinedException
    • psyRequire

      void psyRequire(PsyTextual o) throws PsyErrorException
      Throws:
      PsyErrorException