Example #1
0
        public ProgState OneStep(int index)
        {
            ProgState state;

            try {
                state = rep.getPrg(index);
            }
            catch (MyException.MyException e) {
                throw e;
            }


            MyIntStack <IntStatement> stack = state.getExecStack();

            if (stack.empty())
            {
                throw new MyException.MyException("Stack is empty!");
            }
            IntStatement statement = stack.pop();
            ProgState    newstate;

            try {
                newstate = statement.execute(state);
            }
            catch (MyException.MyException e) {
                throw e;
            }


            return(newstate);
        }