Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 6
0
 public PrgState execute(PrgState state)
 {
     state.ExeStack.Push (new IfStmt (Exp, ThenS, new SkipStmt ()));
     return null;
 }
Exemplo n.º 7
0
 public PrgState execute(PrgState state)
 {
     state.ExeStack.Push (new CompStmt (stmt, new WhileStmt (new NotExp (exp), stmt)));
     return null;
 }
Exemplo n.º 8
0
 public PrgState execute(PrgState state)
 {
     state.ExeStack.Push(new CompStmt(stmt, new WhileStmt(new NotExp(exp), stmt)));
     return(null);
 }
Exemplo n.º 9
0
 public PrgState execute(PrgState state)
 {
     state.ExeStack.Push(second);
     state.ExeStack.Push(first);
     return(null);
 }
Exemplo n.º 10
0
 public PrgState execute(PrgState state)
 {
     state.ExeStack.Push (second);
     state.ExeStack.Push (first);
     return null;
 }