Пример #1
0
 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;
 }
Пример #2
0
 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;
 }
Пример #3
0
 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;
 }
Пример #4
0
 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;
 }
Пример #5
0
 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;
 }
Пример #6
0
 public PrgState execute(PrgState state)
 {
     state.ExeStack.Push (new IfStmt (Exp, ThenS, new SkipStmt ()));
     return null;
 }
Пример #7
0
 public PrgState execute(PrgState state)
 {
     state.ExeStack.Push (new CompStmt (stmt, new WhileStmt (new NotExp (exp), stmt)));
     return null;
 }
Пример #8
0
 public PrgState execute(PrgState state)
 {
     state.ExeStack.Push(new CompStmt(stmt, new WhileStmt(new NotExp(exp), stmt)));
     return(null);
 }
Пример #9
0
 public PrgState execute(PrgState state)
 {
     state.ExeStack.Push(second);
     state.ExeStack.Push(first);
     return(null);
 }
Пример #10
0
 public PrgState execute(PrgState state)
 {
     state.ExeStack.Push (second);
     state.ExeStack.Push (first);
     return null;
 }