(int stackNum, int value)
| 22 | } |
| 23 | |
| 24 | static void push(int stackNum, int value) throws Exception { |
| 25 | /* Check that we have space for the next element */ |
| 26 | if (stackPointer[stackNum] + 1 >= stackSize) { |
| 27 | throw new FullStackException(); |
| 28 | } |
| 29 | /* Increment stack pointer and then update top value*/ |
| 30 | stackPointer[stackNum]++; |
| 31 | buffer[absTopOfStack(stackNum)] = value; |
| 32 | } |
| 33 | |
| 34 | static int pop(int stackNum) throws Exception { |
| 35 | if (isEmpty(stackNum)) { |