public PixelMonkeyNavigator(PixelMonkeyLanguage language)
        {
            InitializeComponent();
            Language = language;

            FillTree();
        }
 public PixelMonkeyScript(PixelMonkeyLanguage lang)
 {
     Loader = new PixelMonkeyLoader(lang.GetCoreClass());
     Commands = new List<PixelMonkeyCommand>();
     Context = new PixelMonkeyContext();
     Language = lang;
     Parser = new PixelMonkeyParser();
     CommandCursor = 0;
 }
Esempio n. 3
0
        private void InterpretFile(String path)
        {
            try
            {
                DateTime starttime = DateTime.Now;

                Language = new PixelMonkeyLanguage();
                Language.LoadFile(path);

                LIST_ResultContent.Items.AddRange(Language.GetFunctionList().ToArray());
                LIST_ResultContent.Items.AddRange(Language.GetClassList().ToArray());

                LB_ErrorCount.Text = "No error";
                LB_ErrorCount.ForeColor = Color.Green;

                TimeSpan span = DateTime.Now.Subtract(starttime);
                LB_TimeToInterpret.Text = span.TotalMilliseconds + " milliseconds";

                Script = new PixelMonkeyScript(Language);

                TB_PMSLOutput.AppendText("Successfully loaded Core\r\n");
                TB_PMSLInput.Enabled = true;
                BTN_InterpretCore.Enabled = false;
            }
            catch (PixelMonkeyCoreException ex)
            {
                LB_ErrorCount.Text = "1";
                LB_ErrorCount.ForeColor = Color.Red;

                TB_PMSLOutput.AppendText("[CORE ERROR] " + ex.CustomMessage + "\r\n");
            }
        }