Exemple #1
0
        private void oneStep(PrgState state)
        {
            IStack <IStmt> stk = state.getStack();

            if (stk.isEmpty())
            {
                throw new MyStmtExecException();
            }
            IStmt crtStmt = stk.pop();

            crtStmt.execute(state);
        }
Exemple #2
0
        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();
            }
        }