예제 #1
0
        public void ProgStateFile(PrgState p)
        {
            StreamWriter writer = null;

            writer = new StreamWriter("C:/Users/Live/IdeaProjects/FileProgState.txt");

            String s = p.TextBoxPrint();

            writer.Write(s);

            //writer.WriteLine("Stack");
            //for (int i = p.exeStack.GetLength() - 1; i >= 0; i--)
            //{
            //    writer.Write(((IStmt)p.exeStack.Get(i)).ToStr());
            //    writer.WriteLine();
            //}
            //writer.WriteLine();

            //writer.Write(" state id: ");
            //writer.WriteLine(p.id);
            //writer.WriteLine(" List");
            //for (int i = 0; i < p.output.Size(); i++)
            //{
            //    writer.Write(p.output.Get(i));
            //    writer.WriteLine();
            //}
            //writer.WriteLine();

            //writer.WriteLine("Dictionary");
            //for (int i = 0; i < p.symTable.GetLength(); i++)
            //{
            //    writer.Write((p.symTable.Get(i)).ToStr());
            //    writer.WriteLine();
            //}

            //writer.WriteLine("Heap");
            //for (int i = 0; i < p.GetHeap().Size(); i++)
            //{
            //    writer.Write((p.GetHeap().Gett(i)).ToStr());
            //    writer.WriteLine();
            //}



            writer.Close();
        }