Class OperandStack


  • public final class OperandStack
    extends Object
    Operand stack.

    You can read more about it here

    It emulates the behaviour of JVM operand stack.
    Since:
    0.2
    • Method Detail

      • pop

        public AstNode pop()
        Pop one node from the stack.
        Returns:
        Node.
      • pop

        public List<AstNode> pop​(int number)
        Pop N nodes from the stack.
        Parameters:
        number - Number of nodes to pop.
        Returns:
        Collection of nodes.
      • push

        public void push​(AstNode node)
        Push one more node to the stack.
        Parameters:
        node - Node to add to the stack.
      • dup

        public void dup()
        Duplicate the higher value on the stack.