コード例 #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));
        }
コード例 #2
0
ファイル: Controller.cs プロジェクト: marialzr/College
        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));
        }
コード例 #3
0
ファイル: Controller.cs プロジェクト: denisvieriu/College
        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));
        }
コード例 #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));
        }