예제 #1
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);
        }
예제 #2
0
 //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);
 }
예제 #3
0
        //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);
        }
예제 #4
0
        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);
        }
예제 #5
0
파일: SFM.cs 프로젝트: Xijezu/GM-Tool
 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;
 }