예제 #1
0
        public PrgState execute(PrgState prgState)
        {
            MyIStack <IStmt> stk = prgState.getExeStack();

            stk.push(second);
            stk.push(first);
            return(prgState);
        }
예제 #2
0
        public PrgState execute(PrgState prgState)
        {
            MyIStack <IStmt> stk = prgState.getExeStack();
            int val = this.exp.evaluate(prgState.getSymTable());

            if (val != 0)
            {
                stk.push(this.thenStmt);
            }
            else
            {
                stk.push(this.elseStmt);
            }
            return(prgState);
        }