Beispiel #1
0
        public PrgState <T> Execute <T>(PrgState <T> state)
        {
            MyIStack <T> stk = state.GetStk();

            stk.Push((T)mSecond);


            stk.Push((T)mFirst);
            return(null);
        }
Beispiel #2
0
        public PrgState Execute(PrgState state)
        {
            MyIStack <IStmt> stk = state.GetStk();

            stk.Push(this.snd);
            stk.Push(this.first);


            return(null);
        }
Beispiel #3
0
        public PrgState Execute(PrgState state)
        {
            MyIStack <IStmt> stk      = state.GetStk();
            IStmt            thenStmt = this.thenS;
            IStmt            elseStmt = this.elseS;

            if (exp.Eval(state.GetSymTable(), state.GetHeap()) != 0)
            {
                stk.Push(thenStmt);
            }
            else
            {
                stk.Push(elseStmt);
            }
            return(null);
        }
Beispiel #4
0
        public PrgState Execute(PrgState state)
        {
            MyIStack <IStmt> stk = state.GetStk();

            IStmt[] s = this.stmt;
            int     k = exp.Eval(state.GetSymTable(), state.GetHeap());

            while (k > 0)
            {
                for (int i = 0; i < s.Length; i++)
                {
                    stk.Push(s[i]);
                }
                k--;
            }
            return(null);
        }