Example #1
0
        public PrgState Execute(PrgState state)
        {
            MyIList <int> ot = state.GetOut();
            MyIDictionary <String, int> symtbl = state.GetSymTable();
            int val = exp.Eval(symtbl);

            ot.Add(val);
            return(state);
        }
Example #2
0
        public PrgState <T> Execute <T>(PrgState <T> state)
        {
            MyIStack <T> stk2 = new MyStack <T>();

            stk2.Push((T)mStmt);
            int          id   = state.GetId();
            MyDictionary sym2 = new MyDictionary();

            sym2 = (MyDictionary)state.GetSymTable().DeepCopy();
            PrgState <T> state2 = new PrgState <T>(
                stk2, sym2, state.GetOut(), state.GetHeap(), ++id);

            return(state2);
        }