Ejemplo n.º 1
0
        public void Compile(string scriptText)
        {
            HasErrors = false;
            BeforeCompile?.Invoke(this, new EventArgs());

            try
            {
                scopeTable.Clear();

                errorReport.Reporting = true;
                errorReport.ExecutionErrorDetected += errorReport_ExecutionErrorDetected;

                CompileInputs(scriptText);
                CompileExpressions(scriptText);
                CheckExecution();

                errorReport.ExecutionErrorDetected -= errorReport_ExecutionErrorDetected;
                errorReport.Reporting = false;

                // this doesn't appear to be used...
                bool success = !this.errorReport.HasErrors;
                this.errorReport.Clear();
            }
            catch (Exception exception)
            {
                HasErrors = true;
                CompileError?.Invoke(this, new CompileErrorEventArgs(exception));
            }
            finally
            {
                AfterCompile?.Invoke(this, new EventArgs());
            }
        }
Ejemplo n.º 2
0
 private void Compiler_BeforeCompile(object sender, EventArgs e)
 {
     BeforeCompile?.Invoke(this, e);
 }