Example #1
0
        public PrgState execute(PrgState state)
        {
            int value = exp.eval(state.getSymTable(), state.getHeap());

            state.getSymTable().Add(id, state.getHeap().Add(value));
            return(state);
        }
Example #2
0
 public PrgState execute(PrgState state)
 {
     if (exp.eval(state.getSymTable(), state.getHeap()) != 0) {
         state.getExeStack().Push(this);
         state.getExeStack().Push(stmt);
     }
     return state;
 }
Example #3
0
 public PrgState execute(PrgState state)
 {
     int result = exp.eval(state.getSymTable(), state.getHeap());
     if (result != 0)
         state.getExeStack().Push(thenStmt);
     else
         state.getExeStack().Push(elseStmt);
     return state;
 }
Example #4
0
 public PrgState execute(PrgState state)
 {
     if (exp.eval(state.getSymTable(), state.getHeap()) != 0)
     {
         state.getExeStack().Push(this);
         state.getExeStack().Push(stmt);
     }
     return(state);
 }
Example #5
0
 public PrgState execute(PrgState state)
 {
     IStack<IStmt> newStk = new ArrayStack<IStmt>();
     newStk.Push(forkStmt);
     IDictionary<String, int> newDict = new ArrayDictionary<String, int>(
         (ArrayDictionary<String, int>) state.getSymTable()
     );
     return new PrgState(newStk, newDict, state.getOut(), state.getHeap(), (state.getId() + 1) * 10);
 }
Example #6
0
        public PrgState execute(PrgState state)
        {
            IStack <IStmt> newStk = new ArrayStack <IStmt>();

            newStk.Push(forkStmt);
            IDictionary <String, int> newDict = new ArrayDictionary <String, int>(
                (ArrayDictionary <String, int>)state.getSymTable()
                );

            return(new PrgState(newStk, newDict, state.getOut(), state.getHeap(), (state.getId() + 1) * 10));
        }
Example #7
0
        public PrgState execute(PrgState state)
        {
            int result = exp.eval(state.getSymTable(), state.getHeap());

            if (result != 0)
            {
                state.getExeStack().Push(thenStmt);
            }
            else
            {
                state.getExeStack().Push(elseStmt);
            }
            return(state);
        }
Example #8
0
 public PrgState execute(PrgState state)
 {
     state.getHeap().Update(state.getSymTable()[id], exp.eval(state.getSymTable(), state.getHeap()));
     return(state);
 }
Example #9
0
 public PrgState execute(PrgState state)
 {
     int value = exp.eval(state.getSymTable(), state.getHeap());
     state.getSymTable().Add(id, state.getHeap().Add(value));
     return state;
 }
Example #10
0
 public PrgState execute(PrgState state)
 {
     state.getHeap().Update(state.getSymTable()[id], exp.eval(state.getSymTable(), state.getHeap()));
     return state;
 }
Example #11
0
 public PrgState execute(PrgState state)
 {
     state.getSymTable().Add(id, exp.eval(state.getSymTable(), state.getHeap()));
     return state;
 }
Example #12
0
 public PrgState execute(PrgState state)
 {
     state.getOut().Add(exp.eval(state.getSymTable(), state.getHeap()));
     return(state);
 }