Пример #1
0
 /**
  * Consume the first work on the input tape
  *
  * @return The word of input
  * @throws EmptyInputException
  */
 public StackValue<?> consumeInput() throws EmptyInputException {
   if (hasInput()) {
     StackValue<?> value = input.get(inputIndex++);
     for (StackMachineListener l : listeners) l.inputConsumed(inputIndex);
     return value;
   } else throw new EmptyInputException(programCounter);
 }