Esempio n. 1
0
        public void executeOneStep()
        {
            PrgState ps = repo.GetCurrentProgram();
            IExeStack <Statement> ex = ps.ExeStack;

            if (!ex.IsEmpty())
            {
                Statement stmt = ex.PopS();
                stmt.Execute(ps);
            }
            Console.WriteLine("----------------------------------------------\n\n");
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        public void executeAll()
        {
            PrgState ps = repo.GetCurrentProgram();
            IExeStack <Statement> es = ps.ExeStack;

            while (!es.IsEmpty())
            {
                try
                {
                    executeOneStep();
                    repo.logPrgStateExec();
                }
                catch (FileException e)
                {
                    Console.WriteLine(e.Message);
                }
            }
            Console.WriteLine("----------------------------------------------\n\n");
        }