public PState execute(PState state) { IStack <IStatement> stack = state.getStack(); stack.push(second); stack.push(first); return(state); }
public PState execute(PState state) { IStack <IStatement> stack = state.getStack(); IMap <string, int> table = state.getTable(); int val = exp.eval(table); if (val != 0) { stack.push(s1); } else { stack.push(s2); } return(state); }
public PState execute(PState state) { IStack <IStatement> stack = state.getStack(); IMap <string, int> table = state.getTable(); int val = exp.eval(table); if (table.hasKey(id)) { table.update(id, val); } else { table.add(id, val); } return(state); }