void Compiler_OnChangeCompilerState(PascalABCCompiler.ICompiler sender, PascalABCCompiler.CompilerState State, string FileName)
 {
     States += State.ToString();
     if (FileName != null) 
         States += " "+System.IO.Path.GetFileName(FileName);
     States += Environment.NewLine;
     switch (State)
     {
         case PascalABCCompiler.CompilerState.CompilationStarting:
             FileNames.Clear();
             States = "";
             break;
         case PascalABCCompiler.CompilerState.BeginCompileFile:
             FileNames.Add(FileName);
             break;
         case PascalABCCompiler.CompilerState.ReadPCUFile:
             FileNames.Add(FileName);
             FileNames.Add(System.IO.Path.ChangeExtension(FileName,".pas"));
             break;
         case PascalABCCompiler.CompilerState.Ready:
             foreach (PascalABCCompiler.Errors.Error error in VisualEnvironmentCompiler.Compiler.ErrorsList)
                 if (error is PascalABCCompiler.Errors.CompilerInternalError)
                 {
                     ReportText = DateTime.Now.ToString() + Environment.NewLine;
                     ReportText += GetInfo()+Environment.NewLine;
                     ReportText += "StatesList: " + Environment.NewLine + States + Environment.NewLine;
                     for (int i = 0; i < VisualEnvironmentCompiler.Compiler.ErrorsList.Count; i++)
                         ReportText += string.Format("Error[{0}]: {1}{2}", i, VisualEnvironmentCompiler.Compiler.ErrorsList[i].ToString(),Environment.NewLine);
                     CompilerInternalErrorReport.ErrorMessage.Text = error.ToString();
                     CompilerInternalErrorReport.ReportText = ReportText;
                     CompilerInternalErrorReport.FileNames = FileNames;
                     CompilerInternalErrorReport.VEC = VisualEnvironmentCompiler;
                     CompilerInternalErrorReport.ShowDialog();
                     return;
                 }
             break;
     }
 }
예제 #2
0
 void Compiler_OnChangeCompilerState(PascalABCCompiler.ICompiler sender, PascalABCCompiler.CompilerState State, string FileName)
 {
     string text;
     if (State == PascalABCCompiler.CompilerState.CompilationStarting || State == PascalABCCompiler.CompilerState.Reloading)
     {
         //CompilerConsole.Clear();
         dt = DateTime.Now;
         if (OnRebuld.Checked)
             VisualEnvironmentCompiler.Compiler.CompilerOptions.Rebuild = true;
     }
     text = State.ToString();
     if (FileName != null)
         text += " " + System.IO.Path.GetFileName(FileName) + "...";
     if (State == PascalABCCompiler.CompilerState.Ready)
     {
         if (VisualEnvironmentCompiler.Compiler.ErrorsList.Count > 0)
             text += string.Format(" [{0} errors]", VisualEnvironmentCompiler.Compiler.ErrorsList.Count);
         text += string.Format(" [{0}ms]", (int)(DateTime.Now - dt).TotalMilliseconds);
         if (sender == VisualEnvironmentCompiler.RemoteCompiler)
             text += string.Format(Environment.NewLine+"WorkingSet {0}", VisualEnvironmentCompiler.RemoteCompiler.RemoteCompilerWorkingSet/1024/1024);
         NoSavePCU.Checked = !VisualEnvironmentCompiler.Compiler.InternalDebug.PCUGenerate;
         NoSemantic.Checked = !VisualEnvironmentCompiler.Compiler.InternalDebug.SemanticAnalysis;
         NoCodeGeneration.Checked = !VisualEnvironmentCompiler.Compiler.InternalDebug.CodeGeneration;
         NoAddStandartUnits.Checked = !VisualEnvironmentCompiler.Compiler.InternalDebug.AddStandartUnits;
         NoSkipPCUErrors.Checked = !VisualEnvironmentCompiler.Compiler.InternalDebug.SkipPCUErrors;
         NoSkipInternalErrorsIfSyntaxTreeIsCorrupt.Checked = !VisualEnvironmentCompiler.Compiler.InternalDebug.SkipInternalErrorsIfSyntaxTreeIsCorrupt;
         NoIncludeDebugInfoInPCU.Checked = !VisualEnvironmentCompiler.Compiler.InternalDebug.IncludeDebugInfoInPCU;
         cbUseStandarParserForInellisense.Checked = VisualEnvironmentCompiler.Compiler.InternalDebug.UseStandarParserForIntellisense;
         //OnRebuld.Checked = VisualEnvironmentCompiler.Compiler.CompilerOptions.Rebuild;
     }
     text += Environment.NewLine;
     if (sender.CompilerType == PascalABCCompiler.CompilerType.Remote)
         text = "[remote]" + text;
     CompilerConsole.AppendText(text);
     CompilerConsole.SelectionStart = CompilerConsole.Text.Length;
     CompilerConsole.ScrollToCaret();
 }