예제 #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());
            }
        }
예제 #2
0
 private void Compiler_AfterCompile(object sender, EventArgs e)
 {
     AfterCompile?.Invoke(this, e);
 }