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); }
//optional field, but good to have public PrgState(StackInterface<IStmt> stack, MapInterface<String, int> dictionary, HeapInterface<int> heap, ListInterface<int> list, IStmt prg) { id = generator++; exeStack = stack; symTable = dictionary; heapTable = heap; output = list; originalProgram = prg; exeStack.Push (originalProgram); }
//optional field, but good to have public PrgState(StackInterface <IStmt> stack, MapInterface <String, int> dictionary, HeapInterface <int> heap, ListInterface <int> list, IStmt prg) { id = generator++; exeStack = stack; symTable = dictionary; heapTable = heap; output = list; originalProgram = prg; exeStack.Push(originalProgram); }
static public List <ListInterface> ReadFile(string file, DataGridView pDgv) { List <ListInterface> pList = new List <ListInterface>(); using (StreamReader sr = new StreamReader(APP_FOLDER + file, Encoding.Default, true)) { string s = String.Empty; while ((s = sr.ReadLine()) != null) { ListInterface l = new ListInterface(s.Split('\t')); pList.Add(l); } } UpdateDataGridView(pDgv, pList); return(pList); }
public static List<ListInterface> ReadFile(string file, DataGridView pDgv) { List<ListInterface> pList = new List<ListInterface>(); using (StreamReader sr = new StreamReader(APP_FOLDER + file, Encoding.Default, true)) { string s = String.Empty; while ((s = sr.ReadLine()) != null) { ListInterface l = new ListInterface(s.Split('\t')); pList.Add(l); } } UpdateDataGridView(pDgv, pList); return pList; }