Ejemplo n.º 1
0
        public PrgState Execute(PrgState p)
        {
            IExeStack <Statement> stk = p.Stack;

            stk.Push(this.second);
            stk.Push(this.first);
            return(p);
        }
Ejemplo n.º 2
0
        public PrgState Execute(PrgState state)
        {
            IExeStack <IStmt> exeStack = state.ExeStack;

            exeStack.Push(second);
            exeStack.Push(first);

            return(state);
        }
Ejemplo n.º 3
0
 public PrgState(ADT.IDictionary <string, int> s, IExeStack <Statement> exe, IOutput <int> o, IFileTable <int, FileData> ft, Statement st)
 {
     this.symbolTable = s;
     this.exeStack    = exe;
     this.output      = o;
     this.filetable   = ft;
     exe.Push(st);
 }
Ejemplo n.º 4
0
        public PrgState Execute(PrgState state)
        {
            IModDictionary<string, int> symbTable = state.SymbTable;
            IExeStack<IStmt> exeStack = state.ExeStack;

            int res = exp.Eval(symbTable);
            
            if (res != 0)
            {
                exeStack.Push(thenS);
            }
            else
            {
                exeStack.Push(elseS);
            }

            return state;
        }