Example #1
0
        public ProgState execute(ProgState state)
        {
            MyIntStack <IntStatement> stack = state.getExecStack();

            stack.push(second);
            stack.push(first);
            return(null);
        }
Example #2
0
        public ProgState execute(ProgState state)
        {
            MyIntDict <String, int>   tabel = state.getSymTable();
            MyIntStack <IntStatement> stack = state.getExecStack();
            int val;

            try {
                val = exp.eval(tabel);
            }
            catch (MyException.MyException e) {
                throw e;
            }
            if (val != 0)
            {
                stack.push(first);
            }
            else
            {
                stack.push(second);
            }
            return(null);
        }