Пример #1
0
        static void Main(string[] args)
        {
            string        t     = "ArloopaScript  a,c:int; void update()  i:int; { i=3; if i < 4  { i=--7; write(i) } else ; } { write(\" update \"); update() }";
            Interpretator inter = new Interpretator(t + "@");

            inter.interpretation();
        }
 void key_on_input_was_pressed(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter) // && e.Control) {
     {
         string prog = input.Text;
         string add  = " ";
         input.Text = "";
         if (prog != "")
         {
             cmd_history.add(prog);
             if (prog[prog.Length - 1] != ';' && prog[prog.Length - 1] != ' ')
             {
                 add = "; ";
             }
             prog += add;
             print_in_output("<<< " + prog + '\n');
         }
         try {
             if (intrpr != null)
             {
                 intrpr.step_execute(prog);
             }
             else
             {
                 initialize_browser("");
                 intrpr.interpretation(input, output);
                 intrpr.step_execute(prog);
             }
         }
         catch (Exception ex) {
             print_in_output("error: " + ex.Message + '\n');
         }
     }
     else if (e.KeyCode == Keys.Up)
     {
         input.Text = cmd_history.getPrev();
     }
     else if (e.KeyCode == Keys.Down)
     {
         input.Text = cmd_history.getNext();
     }
 }
Пример #3
0
        static void Main(string[] args)
        {
            System.Console.WriteLine(args[0]);
            Interpretator intrpr = new Interpretator(args[0], true);

            //wb = new WB(fileName.FileName);
            System.Windows.Forms.Application.DoEvents();
            try {
                intrpr.interpretation(null, (System.Windows.Forms.RichTextBox)null);
                System.Windows.Forms.Application.Run();
            }
            catch (Exception exc) {
                System.IO.File.WriteAllText("error.txt", "error: " + exc.Message);
            }
        }