예제 #1
0
파일: TachyRepl.cs 프로젝트: MilkTool/tachy
        public static void Repl(string loadFile)
        {
            int start = Environment.TickCount;

            A_Program prog = null;

            for (int i = 0; i < 10; i++)
            {
                prog = new A_Program();
                prog.LoadEmbededInitTachy();
            }

            int end = Environment.TickCount;

            if (loadFile != null)
            {
                String init = File.OpenText(loadFile).ReadToEnd();
                prog.Eval(new StringReader(init));
            }
            else
            {
                while (true)
                {
                    // Application.DoEvents();
                    StreamWriter str = new StreamWriter("transcript.ss", true);
                    try
                    {
                        Console.WriteLine("(" + (end - start) + " ms)");
                        Console.Write("> ");

                        String val = ReadAvailable();

                        str.WriteLine(val);

                        start = Environment.TickCount;
                        object result = prog.Eval(new StringReader(val));
                        end = Environment.TickCount;

                        Console.WriteLine(result);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Tachy Error: " + e.Message);                         // + e.Message); // .Message);
                        Console.WriteLine("Stacktrace: " + e.StackTrace);
                    }
                    str.Close();
                }
            }
        }
예제 #2
0
파일: TachyRepl.cs 프로젝트: jeffdik/tachy
        public static void Repl(string loadFile)
        {
            int start = Environment.TickCount;

            A_Program prog = null;
            for (int i = 0; i < 10; i++)
            {
                prog = new A_Program();
                prog.LoadEmbededInitTachy();
            }

            int end = Environment.TickCount;

            if (loadFile != null)
            {
                String init = File.OpenText(loadFile).ReadToEnd();
                prog.Eval(new StringReader(init));
            }
            else
            {
                while (true)
                {
                    // Application.DoEvents();
                    StreamWriter str = new StreamWriter("transcript.ss", true);
                    try
                    {
                        Console.WriteLine("(" + (end - start) + " ms)");
                        Console.Write("> ");

                        String val = ReadAvailable();

                        str.WriteLine(val);

                        start = Environment.TickCount;
                        object result = prog.Eval(new StringReader(val));
                        end = Environment.TickCount;

                        Console.WriteLine(result);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Tachy Error: " + e.Message); // + e.Message); // .Message);
                        Console.WriteLine("Stacktrace: " + e.StackTrace);
                    }
                    str.Close();
                }
            }
        }
예제 #3
0
파일: ReplForm.cs 프로젝트: MilkTool/tachy
 public ReplForm()
 {
     InitializeComponent();
     prog.LoadEmbededInitTachy();
 }