Interface Instruction

All Known Implementing Classes:
Constant, Operator

public interface Instruction
The instruction that the Interpreter runs.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Interacts with the specified stack of the SyntaxNode object to build a SyntaxTree object.
    int
    apply(int[] stack, int offset)
    Interacts with the specified stack of an integer.
  • Method Details

    • accept

      void accept(Deque<SyntaxNode> stack)
      Interacts with the specified stack of the SyntaxNode object to build a SyntaxTree object.
      Parameters:
      stack - The stack of a SyntaxNode object.
    • apply

      int apply(int[] stack, int offset)
      Interacts with the specified stack of an integer.
      Parameters:
      stack - The stack of an integer.
      offset - The position of the top of the stack.
      Returns:
      The new offset of the top of the stack.