public PrgState execute(PrgState state) { MapInterface<String, int> symTbl = state.SymTable; HeapInterface<int> heap = state.HeapTable; heap.Update (symTbl [Id], Exp.eval (symTbl, heap)); return null; }
public PrgState execute(PrgState state) { ListInterface<int> output = state.Output; MapInterface<String, int> symTbl = state.SymTable; HeapInterface<int> heap = state.HeapTable; output.Add (Exp.eval (symTbl, heap)); return null; }
public PrgState execute(PrgState state) { MapInterface<String, int> symTbl = state.SymTable; HeapInterface<int> heap = state.HeapTable; int val = exp.eval (symTbl, heap); symTbl [id] = val; return null; }
public PrgState execute(PrgState state) { Exp difSwitch = new ArithExp (Exp, "-", ExpCase2); Exp difSwitch2 = new ArithExp (Exp, "-", ExpCase1); IStmt ifSwitch = new IfStmt (difSwitch2, DefaultCase, Case1); IStmt switchStmt = new IfStmt (difSwitch, ifSwitch, Case2); state.ExeStack.Push (switchStmt); return null; }
public PrgState execute(PrgState state) { MapInterface<String, int> symTbl = state.SymTable; HeapInterface<int> heap = state.HeapTable; if (Exp.eval (symTbl, heap) != 0) { state.ExeStack.Push (this); state.ExeStack.Push (this.Stmt); } return null; }
public PrgState execute(PrgState state) { state.ExeStack.Push (new IfStmt (Exp, ThenS, new SkipStmt ())); return null; }
public PrgState execute(PrgState state) { state.ExeStack.Push (new CompStmt (stmt, new WhileStmt (new NotExp (exp), stmt))); return null; }
public PrgState execute(PrgState state) { state.ExeStack.Push(new CompStmt(stmt, new WhileStmt(new NotExp(exp), stmt))); return(null); }
public PrgState execute(PrgState state) { state.ExeStack.Push(second); state.ExeStack.Push(first); return(null); }
public PrgState execute(PrgState state) { state.ExeStack.Push (second); state.ExeStack.Push (first); return null; }