private void oneStep(PrgState state) { IStack <IStmt> stk = state.getStack(); if (stk.isEmpty()) { throw new MyStmtExecException(); } IStmt crtStmt = stk.pop(); crtStmt.execute(state); }
public void allStep() { PrgState prg = repo.getCrtPrg(); Console.WriteLine(prg); this.repo.logPrgStateExec(); while (!prg.getStack().isEmpty()) { try { oneStep(prg); }catch (Exception a) { Console.WriteLine(a.GetType() + " " + a.Message); } Console.WriteLine(prg); this.repo.logPrgStateExec(); } }