public PrgState oneStep(PrgState state) { MyIStack <IStmt> stk = state.getExeStack(); try { if (stk.empty()) { throw new Exception("Empty stack"); } IStmt crtStmt = stk.pop(); PrgState newState = crtStmt.execute(state); if (flag == 1) { this.displayCrtPrgState(newState); } //repo.logPrgStateExec(); return(newState); } catch (Exception ex) { throw new Exception(ex.Message); } }
public PrgState oneStep(PrgState state) { MyIStack <IStmt> stk = state.getStk(); IStmt crtStmt = stk.pop(); return(crtStmt.execute(state)); }
public PrgState oneStep(PrgState prgState) { MyIStack <IStmt> exeStack = prgState.getExeStack(); if (exeStack.isEmpty()) { throw new Exception("stack is empty"); } return(exeStack.pop().execute(prgState)); }
public ProgState onestep(ProgState prog) { MyIStack <IStmt> stk = prog.getStk(); try { stk.isEmpty(); } catch (StackExceptions) { throw new StmtExecException("The program is over!!! \n"); } IStmt st = stk.pop(); if (flag == 1) { System.Console.WriteLine(st.ToString()); } try { return(st.execute(prog)); } catch (ControllerException e) { throw new StmtExecException(e); } }
private PrgState oneStep(PrgState state) { MyIStack <IStmt> stk = state.getStk(); if (stk.isEmpty()) { throw new MyStmtExecException("The stack is empty"); } IStmt crtStmt = stk.pop(); try { return(crtStmt.execute(state)); } catch (MyException ex) { throw new MyStmtExecException("" + ex); } }