Class AbstractIntStackMachine.MachineState

    • Method Detail

      • duplicate

        public AbstractIntStackMachine.MachineState duplicate()
        I'm not using clone because I don't want to necessarily inherit the AbstractVariable state from the superclass
      • push

        public void push​(int i)
      • pop

        public int pop()
      • peek

        public int peek()
      • swap

        public void swap()
      • clearStack

        public void clearStack()
      • setLocal

        public void setLocal​(int i,
                             int j)
        set the value of local i to symbol j
        Parameters:
        i -
        j -
      • getLocal

        public int getLocal​(int i)
        Parameters:
        i -
        Returns:
        the number of the symbol corresponding to local i
      • replaceValue

        public void replaceValue​(int from,
                                 int to)
      • hasValue

        public boolean hasValue​(int val)
      • getStackHeight

        public int getStackHeight()
        Returns the stackHeight.
        Returns:
        int
      • getLocals

        public int[] getLocals()
        Use with care.