Ejemplo n.º 1
0
        public PrgState OneStep(PrgState state)
        {
            MyIStack <IStmt> stk = state.GetExeStack();

            if (stk.IsEmpty())
            {
                throw new MyException("Stack is empty");
            }
            IStmt crtStmt = stk.Pop();

            return(crtStmt.Execute(state));
        }
Ejemplo n.º 2
0
        public PrgState OneStep(PrgState state)
        {
            IMyStack <IStmt> stk = state.ExeStack;

            if (stk.IsEmpty())
            {
                throw new Exception("The execution stack is empty");
            }
            IStmt crtStmt = stk.Pop();

            return(crtStmt.Execute(state));
        }
Ejemplo n.º 3
0
        private PrgState OneStep(PrgState state)
        {
            IExeStack <IStmt> stk = state.ExeStack;

            if (stk.IsEmpty())
            {
                throw new Exception("Empty stack");
            }

            IStmt crtStmt = stk.Pop();

            return(crtStmt.Execute(state));
        }
Ejemplo n.º 4
0
        public PrgState OneStep()
        {
            IStmt crtStmt = null;

            if (exeStack.IsEmpty())
            {
                Console.Write("empty stack!! \n");
                return(null);
            }
            else
            {
                crtStmt = exeStack.Pop();
            }

            return(crtStmt.Execute(this));
        }