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)); }
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)); }
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)); }
public PrgState OneStep() { IStmt crtStmt = null; if (exeStack.IsEmpty()) { Console.Write("empty stack!! \n"); return(null); } else { crtStmt = exeStack.Pop(); } return(crtStmt.Execute(this)); }