# Class Compiler Namespace: [PascalABCCompiler](PascalABCCompiler.md) Assembly: Compiler.dll ```csharp public class Compiler : MarshalByRefObject, ICompiler ``` #### Inheritance [object](https://learn.microsoft.com/dotnet/api/system.object) ← [MarshalByRefObject](https://learn.microsoft.com/dotnet/api/system.marshalbyrefobject) ← [Compiler](PascalABCCompiler.Compiler.md) #### Implements [ICompiler](PascalABCCompiler.ICompiler.md) #### Inherited Members [MarshalByRefObject.MemberwiseClone\(bool\)](https://learn.microsoft.com/dotnet/api/system.marshalbyrefobject.memberwiseclone), [MarshalByRefObject.GetLifetimeService\(\)](https://learn.microsoft.com/dotnet/api/system.marshalbyrefobject.getlifetimeservice), [MarshalByRefObject.InitializeLifetimeService\(\)](https://learn.microsoft.com/dotnet/api/system.marshalbyrefobject.initializelifetimeservice), [MarshalByRefObject.CreateObjRef\(Type\)](https://learn.microsoft.com/dotnet/api/system.marshalbyrefobject.createobjref), [object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), [object.Equals\(object\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), [object.Equals\(object, object\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), [object.ReferenceEquals\(object, object\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) ## Constructors ### Compiler\(\) ```csharp private static Compiler() ``` ### Compiler\(\) ```csharp public Compiler() ``` ### Compiler\(ICompiler, SourceFilesProviderDelegate, ChangeCompilerStateEventDelegate\) ```csharp public Compiler(ICompiler comp, SourceFilesProviderDelegate SourceFilesProvider, ChangeCompilerStateEventDelegate ChangeCompilerState) ``` #### Parameters `comp` [ICompiler](PascalABCCompiler.ICompiler.md) `SourceFilesProvider` SourceFilesProviderDelegate `ChangeCompilerState` [ChangeCompilerStateEventDelegate](PascalABCCompiler.ChangeCompilerStateEventDelegate.md) ### Compiler\(SourceFilesProviderDelegate, ChangeCompilerStateEventDelegate\) ```csharp public Compiler(SourceFilesProviderDelegate SourceFilesProvider, ChangeCompilerStateEventDelegate ChangeCompilerState) ``` #### Parameters `SourceFilesProvider` SourceFilesProviderDelegate `ChangeCompilerState` [ChangeCompilerStateEventDelegate](PascalABCCompiler.ChangeCompilerStateEventDelegate.md) ## Fields ### BadNodesInSyntaxTree ```csharp private Hashtable BadNodesInSyntaxTree ``` #### Field Value [Hashtable](https://learn.microsoft.com/dotnet/api/system.collections.hashtable) ### CodeGeneratorsController ```csharp public Controller CodeGeneratorsController ``` #### Field Value Controller ### CompiledVariables ```csharp public List CompiledVariables ``` #### Field Value [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ### DLLCache ```csharp private Dictionary DLLCache ``` #### Field Value [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [CompilationUnit](PascalABCCompiler.CompilationUnit.md)\> ### PCUReadersAndWritersClosed ```csharp private bool PCUReadersAndWritersClosed ``` #### Field Value [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### RecompileList ```csharp public Hashtable RecompileList ``` #### Field Value [Hashtable](https://learn.microsoft.com/dotnet/api/system.collections.hashtable) ### StandardModules ```csharp private List StandardModules ``` #### Field Value [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\> ### SyntaxTreeToSemanticTreeConverter ```csharp public SyntaxTreeToSemanticTreeConverter SyntaxTreeToSemanticTreeConverter ``` #### Field Value [SyntaxTreeToSemanticTreeConverter](PascalABCCompiler.TreeConverter.SyntaxTreeToSemanticTreeConverter.md) ### UnitsToCompileDelayedList список отложенной компиляции реализации (она будет откомпилирована в Compile, а не в СompileUnit) ```csharp private List UnitsToCompileDelayedList ``` #### Field Value [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)<[CompilationUnit](PascalABCCompiler.CompilationUnit.md)\> ### UnitsTopologicallySortedList ```csharp public List UnitsTopologicallySortedList ``` #### Field Value [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)<[CompilationUnit](PascalABCCompiler.CompilationUnit.md)\> ### \_clear\_after\_compilation ```csharp private bool _clear_after_compilation ``` #### Field Value [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### assemblyResolveScope ```csharp private AssemblyResolveScope assemblyResolveScope ``` #### Field Value AssemblyResolveScope ### beginOffset Начало основной программы ```csharp public int beginOffset ``` #### Field Value [int](https://learn.microsoft.com/dotnet/api/system.int32) ### currentCompilationUnit ```csharp private CompilationUnit currentCompilationUnit ``` #### Field Value [CompilationUnit](PascalABCCompiler.CompilationUnit.md) ### errorsList ```csharp private List errorsList ``` #### Field Value [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ### firstCompilationUnit ```csharp private CompilationUnit firstCompilationUnit ``` #### Field Value [CompilationUnit](PascalABCCompiler.CompilationUnit.md) ### internalDebug ```csharp private CompilerInternalDebug internalDebug ``` #### Field Value [CompilerInternalDebug](PascalABCCompiler.CompilerInternalDebug.md) ### linesCompiled ```csharp private uint linesCompiled ``` #### Field Value [uint](https://learn.microsoft.com/dotnet/api/system.uint32) ### pABCCodeHealth ```csharp private int pABCCodeHealth ``` #### Field Value [int](https://learn.microsoft.com/dotnet/api/system.int32) ### pcuCompilationUnits ```csharp private static Dictionary pcuCompilationUnits ``` #### Field Value [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [CompilationUnit](PascalABCCompiler.CompilationUnit.md)\> ### project ```csharp private ProjectInfo project ``` #### Field Value [ProjectInfo](PascalABCCompiler.ProjectInfo.md) ### semanticTree ```csharp private program_node semanticTree ``` #### Field Value program\_node ### semanticTreeConvertersController ```csharp private SemanticTreeConvertersController semanticTreeConvertersController ``` #### Field Value [SemanticTreeConvertersController](PascalABCCompiler.SemanticTreeConverters.SemanticTreeConvertersController.md) ### sourceFilesProvider ```csharp private SourceFilesProviderDelegate sourceFilesProvider ``` #### Field Value SourceFilesProviderDelegate ### standartAssemblyPath ```csharp private static string standartAssemblyPath ``` #### Field Value [string](https://learn.microsoft.com/dotnet/api/system.string) ### standart\_assembly\_dict ```csharp public static Dictionary standart_assembly_dict ``` #### Field Value [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [string](https://learn.microsoft.com/dotnet/api/system.string)\> ### state ```csharp private CompilerState state ``` #### Field Value [CompilerState](PascalABCCompiler.CompilerState.md) ### supportedProjectFiles ```csharp private SupportedSourceFile[] supportedProjectFiles ``` #### Field Value [SupportedSourceFile](PascalABCCompiler.SupportedSourceFile.md)\[\] ### supportedSourceFiles ```csharp private SupportedSourceFile[] supportedSourceFiles ``` #### Field Value [SupportedSourceFile](PascalABCCompiler.SupportedSourceFile.md)\[\] ### unitTable ```csharp private CompilationUnitHashTable unitTable ``` #### Field Value [CompilationUnitHashTable](PascalABCCompiler.CompilationUnitHashTable.md) ### varBeginOffset Положение первых переменных в пространстве имен основной программы ```csharp public int varBeginOffset ``` #### Field Value [int](https://learn.microsoft.com/dotnet/api/system.int32) ### warnings ```csharp private List warnings ``` #### Field Value [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ## Properties ### Banner ```csharp public static string Banner { get; } ``` #### Property Value [string](https://learn.microsoft.com/dotnet/api/system.string) ### BeginOffset ```csharp public int BeginOffset { get; } ``` #### Property Value [int](https://learn.microsoft.com/dotnet/api/system.int32) ### ClearAfterCompilation ```csharp public bool ClearAfterCompilation { get; set; } ``` #### Property Value [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### CompilerOptions ```csharp public CompilerOptions CompilerOptions { get; set; } ``` #### Property Value [CompilerOptions](PascalABCCompiler.CompilerOptions.md) ### CompilerType ```csharp public CompilerType CompilerType { get; } ``` #### Property Value [CompilerType](PascalABCCompiler.CompilerType.md) ### ErrorsList ```csharp public List ErrorsList { get; } ``` #### Property Value [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ### GetUnitFileNameCache ```csharp public Dictionary, string> GetUnitFileNameCache { get; } ``` #### Property Value [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[Tuple](https://learn.microsoft.com/dotnet/api/system.tuple\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [string](https://learn.microsoft.com/dotnet/api/system.string)\>, [string](https://learn.microsoft.com/dotnet/api/system.string)\> ### InternalDebug ```csharp public CompilerInternalDebug InternalDebug { get; set; } ``` #### Property Value [CompilerInternalDebug](PascalABCCompiler.CompilerInternalDebug.md) ### LanguageProvider ```csharp private LanguageProvider LanguageProvider { get; } ``` #### Property Value LanguageProvider ### LinesCompiled ```csharp public uint LinesCompiled { get; } ``` #### Property Value [uint](https://learn.microsoft.com/dotnet/api/system.uint32) ### PABCCodeHealth Здоровье кода на всякий случай выносим в интерфейс компилятора Реально оно будет использоваться только при запуске из под оболочки (Remote Compiler) ```csharp public int PABCCodeHealth { get; } ``` #### Property Value [int](https://learn.microsoft.com/dotnet/api/system.int32) ### PCUFileNamesDictionary ```csharp public Dictionary, Tuple> PCUFileNamesDictionary { get; } ``` #### Property Value [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[Tuple](https://learn.microsoft.com/dotnet/api/system.tuple\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [string](https://learn.microsoft.com/dotnet/api/system.string)\>, [Tuple](https://learn.microsoft.com/dotnet/api/system.tuple\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [int](https://learn.microsoft.com/dotnet/api/system.int32)\>\> ### SemanticTree ```csharp public IProgramNode SemanticTree { get; } ``` #### Property Value IProgramNode ### SemanticTreeConvertersController ```csharp public SemanticTreeConvertersController SemanticTreeConvertersController { get; } ``` #### Property Value [SemanticTreeConvertersController](PascalABCCompiler.SemanticTreeConverters.SemanticTreeConvertersController.md) ### ShortVersion ```csharp public static string ShortVersion { get; } ``` #### Property Value [string](https://learn.microsoft.com/dotnet/api/system.string) ### SourceFileNamesDictionary ```csharp public Dictionary, Tuple> SourceFileNamesDictionary { get; } ``` #### Property Value [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[Tuple](https://learn.microsoft.com/dotnet/api/system.tuple\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [string](https://learn.microsoft.com/dotnet/api/system.string)\>, [Tuple](https://learn.microsoft.com/dotnet/api/system.tuple\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [int](https://learn.microsoft.com/dotnet/api/system.int32)\>\> ### SourceFilesProvider ```csharp public SourceFilesProviderDelegate SourceFilesProvider { get; } ``` #### Property Value SourceFilesProviderDelegate ### State ```csharp public CompilerState State { get; } ``` #### Property Value [CompilerState](PascalABCCompiler.CompilerState.md) ### SupportedProjectFiles ```csharp public SupportedSourceFile[] SupportedProjectFiles { get; } ``` #### Property Value [SupportedSourceFile](PascalABCCompiler.SupportedSourceFile.md)\[\] ### SupportedSourceFiles ```csharp public SupportedSourceFile[] SupportedSourceFiles { get; set; } ``` #### Property Value [SupportedSourceFile](PascalABCCompiler.SupportedSourceFile.md)\[\] ### UnitTable ```csharp public CompilationUnitHashTable UnitTable { get; } ``` #### Property Value [CompilationUnitHashTable](PascalABCCompiler.CompilationUnitHashTable.md) ### VarBeginOffset ```csharp public int VarBeginOffset { get; } ``` #### Property Value [int](https://learn.microsoft.com/dotnet/api/system.int32) ### Version ```csharp public static string Version { get; } ``` #### Property Value [string](https://learn.microsoft.com/dotnet/api/system.string) ### VersionDateTime ```csharp public static DateTime VersionDateTime { get; } ``` #### Property Value [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) ### Warnings ```csharp public List Warnings { get; } ``` #### Property Value [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ## Methods ### AddCodeGenerationErrorToErrorList\(Exception\) ```csharp private void AddCodeGenerationErrorToErrorList(Exception err) ``` #### Parameters `err` [Exception](https://learn.microsoft.com/dotnet/api/system.exception) ### AddCurrentUnitAndItsReferencesToUsesLists\(unit\_node\_list, Dictionary, unit\_or\_namespace, CompilationUnit, unit\_node\_list\) ```csharp private void AddCurrentUnitAndItsReferencesToUsesLists(unit_node_list unitsFromUsesSection, Dictionary directUnitsFromUsesSection, unit_or_namespace currentUnitNode, CompilationUnit currentUnit, unit_node_list references) ``` #### Parameters `unitsFromUsesSection` unit\_node\_list `directUnitsFromUsesSection` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2) `currentUnitNode` unit\_or\_namespace `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `references` unit\_node\_list ### AddDeclarationsAndReferencedUnitsToNamespaces\(List, string, unit\_module, syntax\_namespace\_node\) ```csharp private void AddDeclarationsAndReferencedUnitsToNamespaces(List namespace_modules, string file, unit_module unitModule, syntax_namespace_node namespaceNode) ``` #### Parameters `namespace_modules` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) `file` [string](https://learn.microsoft.com/dotnet/api/system.string) `unitModule` unit\_module `namespaceNode` syntax\_namespace\_node ### AddDocumentationToNodes\(CompilationUnit, string\) ```csharp private Dictionary AddDocumentationToNodes(CompilationUnit currentUnit, string text) ``` #### Parameters `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `text` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2) ### AddErrorToErrorListConsideringPosition\(Error\) ```csharp private void AddErrorToErrorListConsideringPosition(Error err) ``` #### Parameters `err` Error ### AddInternalErrorToErrorList\(CompilerInternalError\) ```csharp private void AddInternalErrorToErrorList(CompilerInternalError internalError) ``` #### Parameters `internalError` CompilerInternalError ### AddNamespacesToMainDefinitions\(unit\_module, program\_module, Dictionary\) ```csharp private void AddNamespacesToMainDefinitions(unit_module mainLibrary, program_module main_program, Dictionary namespaces) ``` #### Parameters `mainLibrary` unit\_module `main_program` program\_module `namespaces` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), syntax\_namespace\_node\> ### AddNamespacesToMainUsesList\(unit\_module, program\_module, List\) ```csharp private void AddNamespacesToMainUsesList(unit_module mainLibrary, program_module main_program, List namespaceModules) ``` #### Parameters `mainLibrary` unit\_module `main_program` program\_module `namespaceModules` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ### AddNamespacesToUsingList\(using\_namespace\_list, List, bool, Dictionary\) ```csharp public void AddNamespacesToUsingList(using_namespace_list usingList, List possibleNamespaces, bool mightContainUnits, Dictionary namespaces) ``` #### Parameters `usingList` using\_namespace\_list `possibleNamespaces` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) `mightContainUnits` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) `namespaces` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), syntax\_namespace\_node\> ### AddNamespacesToUsingList\(using\_namespace\_list, using\_list\) ```csharp public void AddNamespacesToUsingList(using_namespace_list using_list, using_list ul) ``` #### Parameters `using_list` using\_namespace\_list `ul` using\_list ### AddReferencesToNetSystemLibraries\(CompilationUnit, List\) Добавляет ссылки на стандартные системные dll .NET - версия с директивами уровня семантики ```csharp private void AddReferencesToNetSystemLibraries(CompilationUnit compilationUnit, List directives) ``` #### Parameters `compilationUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `directives` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ### AddReferencesToNetSystemLibraries\(CompilationUnit, List\) Добавляет ссылки на стандартные системные dll .NET - версия с директивами уровня синтаксиса ```csharp private void AddReferencesToNetSystemLibraries(CompilationUnit compilationUnit, List directives) ``` #### Parameters `compilationUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `directives` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ### AddStandardUnitsToInterfaceUsesSection\(CompilationUnit\) ```csharp public void AddStandardUnitsToInterfaceUsesSection(CompilationUnit currentUnit) ``` #### Parameters `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) ### AddWarnings\(List\) ```csharp public void AddWarnings(List WarningList) ``` #### Parameters `WarningList` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ### AsyncClosePCUWriters\(\) ```csharp private void AsyncClosePCUWriters() ``` ### CalculateLinesCompiled\(List, compilation\_unit\) ```csharp private void CalculateLinesCompiled(List errorList, compilation_unit unitSyntaxTree) ``` #### Parameters `errorList` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) `unitSyntaxTree` compilation\_unit ### CalculatePascalProgramHealth\(compilation\_unit\) ```csharp private void CalculatePascalProgramHealth(compilation_unit unitSyntaxTree) ``` #### Parameters `unitSyntaxTree` compilation\_unit ### ChangeCompilerStateEvent\(ICompiler, CompilerState, string\) ```csharp private void ChangeCompilerStateEvent(ICompiler sender, CompilerState State, string FileName) ``` #### Parameters `sender` [ICompiler](PascalABCCompiler.ICompiler.md) `State` [CompilerState](PascalABCCompiler.CompilerState.md) `FileName` [string](https://learn.microsoft.com/dotnet/api/system.string) ### CheckErrorsAndThrowTheFirstOne\(\) ```csharp private void CheckErrorsAndThrowTheFirstOne() ``` ### CheckForDuplicatesInUsesSection\(List\) Бросает ошибку если находит дупликаты в секции uses ```csharp private void CheckForDuplicatesInUsesSection(List usesList) ``` #### Parameters `usesList` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ### CheckForRTLErrorsAndClearAllErrorsIfFound\(\) ```csharp private bool CheckForRTLErrorsAndClearAllErrorsIfFound() ``` #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### CheckPathValid\(string\) ```csharp public static bool CheckPathValid(string path) ``` #### Parameters `path` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### ClearAll\(bool\) ```csharp public void ClearAll(bool close_pcu = true) ``` #### Parameters `close_pcu` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### ClosePCUReadersAndWriters\(\) ```csharp private void ClosePCUReadersAndWriters() ``` ### ClosePCUWriters\(\) ```csharp private void ClosePCUWriters() ``` ### CombinePathsRelatively\(string, string\) ```csharp public static string CombinePathsRelatively(string path1, string path2) ``` #### Parameters `path1` [string](https://learn.microsoft.com/dotnet/api/system.string) `path2` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### Compile\(CompilerOptions\) ```csharp public string Compile(CompilerOptions CompilerOptions) ``` #### Parameters `CompilerOptions` [CompilerOptions](PascalABCCompiler.CompilerOptions.md) #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### Compile\(\) ```csharp public string Compile() ``` #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### CompileCS\(\) ```csharp public string CompileCS() ``` #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### CompileCurrentUnitImplementation\(string, CompilationUnit, Dictionary\) ```csharp private void CompileCurrentUnitImplementation(string UnitFileName, CompilationUnit currentUnit, Dictionary docs) ``` #### Parameters `UnitFileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `docs` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2) ### CompileCurrentUnitInterface\(string, CompilationUnit, Dictionary\) ```csharp private void CompileCurrentUnitInterface(string UnitFileName, CompilationUnit currentUnit, Dictionary docs) ``` #### Parameters `UnitFileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `docs` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2) ### CompileImplementationDependencies\(string, CompilationUnit, List, Dictionary, common\_unit\_node, out bool\) Компилирует модули из секции uses текущего модуля реализации рекурсивно ```csharp private void CompileImplementationDependencies(string currentPath, CompilationUnit currentUnit, List implementationUsesList, Dictionary namespaces, common_unit_node commonUnitNode, out bool shouldReturnCurrentUnit) ``` #### Parameters `currentPath` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `implementationUsesList` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) `namespaces` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), syntax\_namespace\_node\> `commonUnitNode` common\_unit\_node `shouldReturnCurrentUnit` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### CompileInterfaceDependencies\(unit\_node\_list, Dictionary, unit\_or\_namespace, string, string, CompilationUnit, List, unit\_node\_list, Dictionary, out bool\) Компилирует модули из секции uses интерфейса текущего модуля рекурсивно ```csharp private void CompileInterfaceDependencies(unit_node_list unitsFromUsesSection, Dictionary directUnitsFromUsesSection, unit_or_namespace currentUnitNode, string unitFileName, string currentPath, CompilationUnit currentUnit, List interfaceUsesList, unit_node_list references, Dictionary namespaces, out bool shouldReturnCurrentUnit) ``` #### Parameters `unitsFromUsesSection` unit\_node\_list `directUnitsFromUsesSection` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2) `currentUnitNode` unit\_or\_namespace `unitFileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentPath` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `interfaceUsesList` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) `references` unit\_node\_list `namespaces` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), syntax\_namespace\_node\> `shouldReturnCurrentUnit` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) #### Exceptions [CycleUnitReference](PascalABCCompiler.Errors.CycleUnitReference.md) ### CompileReference\(unit\_node\_list, compiler\_directive\) ```csharp private CompilationUnit CompileReference(unit_node_list dlls, compiler_directive reference) ``` #### Parameters `dlls` unit\_node\_list `reference` compiler\_directive #### Returns [CompilationUnit](PascalABCCompiler.CompilationUnit.md) ### CompileUnit\(unit\_node\_list, Dictionary, unit\_or\_namespace, string\) Компилирует основную программу и все используемые ей юниты рекурсивно ```csharp public CompilationUnit CompileUnit(unit_node_list unitsFromUsesSection, Dictionary directUnitsFromUsesSection, unit_or_namespace currentUnitNode, string previousPath) ``` #### Parameters `unitsFromUsesSection` unit\_node\_list Вспомогательная переменная для заполнения CompilationUnit.interfaceUsedUnits и CompilationUnit.implementationUsedUnits (здесь могут содержаться юниты и dll) `directUnitsFromUsesSection` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2) Вспомогательная переменная для заполнения CompilationUnit.interfaceUsedDirectUnits и CompilationUnit.implementationUsedDirectUnits `currentUnitNode` unit\_or\_namespace Синтаксический узел текущего модуля (или пространства имен) `previousPath` [string](https://learn.microsoft.com/dotnet/api/system.string) Директория родительского модуля #### Returns [CompilationUnit](PascalABCCompiler.CompilationUnit.md) Скомпилированный юнит ### CompileUnitsFromDelayedList\(\) ```csharp private void CompileUnitsFromDelayedList() ``` ### ConstructMainSemanticTree\(CompilerOptions\) ```csharp private program_node ConstructMainSemanticTree(CompilerOptions compilerOptions) ``` #### Parameters `compilerOptions` CompilerOptions #### Returns program\_node ### ConstructSyntaxTree\(string, CompilationUnit, string\) ```csharp private compilation_unit ConstructSyntaxTree(string unitFileName, CompilationUnit currentUnit, string sourceText) ``` #### Parameters `unitFileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `sourceText` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns compilation\_unit ### ConstructSyntaxTreeAndRunSugarConversions\(string, CompilationUnit, out Dictionary\) Строит синтаксическое дерево, бросает первую из найденных ошибок (если они есть) и запускает сахарные преобразования ```csharp private void ConstructSyntaxTreeAndRunSugarConversions(string unitFileName, CompilationUnit currentUnit, out Dictionary docs) ``` #### Parameters `unitFileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `docs` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2) ### ConvertSyntaxTree\(compilation\_unit, List\) ```csharp private compilation_unit ConvertSyntaxTree(compilation_unit syntaxTree, List converters) ``` #### Parameters `syntaxTree` compilation\_unit `converters` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) #### Returns compilation\_unit ### CreateDependencyListsForCurrentUnit\(CompilationUnit, string, out List, out unit\_node\_list, out Dictionary\) ```csharp private void CreateDependencyListsForCurrentUnit(CompilationUnit currentUnit, string currentDirectory, out List interfaceUsesList, out unit_node_list references, out Dictionary namespaces) ``` #### Parameters `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `currentDirectory` [string](https://learn.microsoft.com/dotnet/api/system.string) `interfaceUsesList` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) `references` unit\_node\_list `namespaces` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), syntax\_namespace\_node\> ### CurrentUnitIsNotMainProgram\(\) Возвращает true, если текущий компилируемый модуль не является основной программой (program_module) ```csharp private bool CurrentUnitIsNotMainProgram() ``` #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### DebugOutputFileCreationUsingPDB\(\) ```csharp private void DebugOutputFileCreationUsingPDB() ``` ### DisablePABCRtlIfUsingDotnet5\(List\) ```csharp private void DisablePABCRtlIfUsingDotnet5(List directives) ``` #### Parameters `directives` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ### FillNetCompilerOptionsFromCompilerDirectives\(CompilerOptions, Dictionary\>\) ```csharp private void FillNetCompilerOptionsFromCompilerDirectives(CompilerOptions netCompilerOptions, Dictionary> compilerDirectives) ``` #### Parameters `netCompilerOptions` CompilerOptions `compilerDirectives` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)\> ### FillNetCompilerOptionsFromProject\(CompilerOptions\) ```csharp private void FillNetCompilerOptionsFromProject(CompilerOptions netCompilerOptions) ``` #### Parameters `netCompilerOptions` CompilerOptions ### FindFileWithExtensionInDirs\(string, out int, params string\[\]\) ```csharp private string FindFileWithExtensionInDirs(string fileName, out int foundDirIndex, params string[] dirs) ``` #### Parameters `fileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `foundDirIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32) `dirs` [string](https://learn.microsoft.com/dotnet/api/system.string)\[\] #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### FindPCUFileName\(string, string, out int\) ```csharp public string FindPCUFileName(string fileName, string currentPath, out int folderPriority) ``` #### Parameters `fileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentPath` [string](https://learn.microsoft.com/dotnet/api/system.string) `folderPriority` [int](https://learn.microsoft.com/dotnet/api/system.int32) #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### FindPositionForSemanticErrorInTheErrorList\(Error\) ```csharp private int FindPositionForSemanticErrorInTheErrorList(Error err) ``` #### Parameters `err` Error #### Returns [int](https://learn.microsoft.com/dotnet/api/system.int32) ### FindSourceFileName\(string, string, out int\) ```csharp public string FindSourceFileName(string fileName, string currentPath, out int folderPriority) ``` #### Parameters `fileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentPath` [string](https://learn.microsoft.com/dotnet/api/system.string) `folderPriority` [int](https://learn.microsoft.com/dotnet/api/system.int32) #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### FindSourceFileNameInDirs\(string, out int, params string\[\]\) ```csharp public string FindSourceFileNameInDirs(string fileName, out int foundDirIndex, params string[] Dirs) ``` #### Parameters `fileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `foundDirIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32) `Dirs` [string](https://learn.microsoft.com/dotnet/api/system.string)\[\] #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### Free\(\) ```csharp public void Free() ``` ### GenUnitDocumentation\(CompilationUnit, string\) ```csharp private Dictionary GenUnitDocumentation(CompilationUnit currentUnit, string SourceText) ``` #### Parameters `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `SourceText` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2) ### GenerateILCode\(program\_node, CompilerOptions, List\) ```csharp private void GenerateILCode(program_node programNode, CompilerOptions compilerOptions, List resourceFiles) ``` #### Parameters `programNode` program\_node `compilerOptions` CompilerOptions `resourceFiles` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\> ### GetCompilerDirectives\(List\) Формирует словарь директив компилятора, собирая их из всех переданных модулей ```csharp private Dictionary> GetCompilerDirectives(List Units) ``` #### Parameters `Units` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)<[CompilationUnit](PascalABCCompiler.CompilationUnit.md)\> #### Returns [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)\> #### Exceptions [DuplicateDirective](PascalABCCompiler.Errors.DuplicateDirective.md) ### GetDirectivesAsSemanticNodes\(List, string\) преобразует в директивы семантического уровня | в syntax_tree_visitor такая же функция EVA ```csharp private List GetDirectivesAsSemanticNodes(List compilerDirectives, string unitFileName) ``` #### Parameters `compilerDirectives` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) `unitFileName` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ### GetImplementationSyntaxUsingList\(compilation\_unit\) получение списка using - legacy code !!! ```csharp private using_list GetImplementationSyntaxUsingList(compilation_unit cu) ``` #### Parameters `cu` compilation\_unit #### Returns using\_list ### GetImplementationUsesSection\(compilation\_unit\) ```csharp private List GetImplementationUsesSection(compilation_unit unitSyntaxTree) ``` #### Parameters `unitSyntaxTree` compilation\_unit #### Returns [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ### GetIncludedFilesFromDirectives\(CompilationUnit, List\) ```csharp private static List GetIncludedFilesFromDirectives(CompilationUnit compilationUnit, List directives) ``` #### Parameters `compilationUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `directives` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) #### Returns [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\> ### GetInterfaceUsesSection\(compilation\_unit\) Возвращает список зависимостей из интерфейсной части модуля (или основной программы) ```csharp public List GetInterfaceUsesSection(compilation_unit unitSyntaxTree) ``` #### Parameters `unitSyntaxTree` compilation\_unit #### Returns [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) ### GetInterfaceUsingList\(compilation\_unit\) получение списка using - legacy code !!! ```csharp public using_list GetInterfaceUsingList(compilation_unit cu) ``` #### Parameters `cu` compilation\_unit #### Returns using\_list ### GetLocationFromTreenode\(syntax\_tree\_node, string\) ```csharp private location GetLocationFromTreenode(syntax_tree_node tn, string FileName) ``` #### Parameters `tn` syntax\_tree\_node `FileName` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns location ### GetNamespace\(unit\_or\_namespace\) ```csharp public using_namespace GetNamespace(unit_or_namespace _name_space) ``` #### Parameters `_name_space` unit\_or\_namespace #### Returns using\_namespace ### GetNamespace\(using\_namespace\_list, string, unit\_or\_namespace, bool, Dictionary\) Формирует узел семантического дерева, соответствующий пространству имен (.NET или пользовательскому) ```csharp private using_namespace GetNamespace(using_namespace_list usingList, string fullNamespaceName, unit_or_namespace name_space, bool mightBeUnit, Dictionary namespaces) ``` #### Parameters `usingList` using\_namespace\_list `fullNamespaceName` [string](https://learn.microsoft.com/dotnet/api/system.string) `name_space` unit\_or\_namespace `mightBeUnit` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) `namespaces` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), syntax\_namespace\_node\> #### Returns using\_namespace #### Exceptions [UnitNotFound](PascalABCCompiler.Errors.UnitNotFound.md) NamespaceNotFound ### GetNamespaceSyntaxTree\(string\) ```csharp private compilation_unit GetNamespaceSyntaxTree(string fileName) ``` #### Parameters `fileName` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns compilation\_unit ### GetReferenceFileName\(string, string\) ```csharp public static string GetReferenceFileName(string FileName, string curr_path = null) ``` #### Parameters `FileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `curr_path` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### GetReferenceFileName\(string, SourceContext, string, bool\) ```csharp private string GetReferenceFileName(string FileName, SourceContext sc, string curr_path, bool overwrite) ``` #### Parameters `FileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `sc` SourceContext `curr_path` [string](https://learn.microsoft.com/dotnet/api/system.string) `overwrite` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### GetReferences\(CompilationUnit\) ```csharp public unit_node_list GetReferences(CompilationUnit compilationUnit) ``` #### Parameters `compilationUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) #### Returns unit\_node\_list ### GetResourceFilesFromCompilerDirectives\(Dictionary\>\) ```csharp private List GetResourceFilesFromCompilerDirectives(Dictionary> compilerDirectives) ``` #### Parameters `compilerDirectives` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)\> #### Returns [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\> ### GetSourceCode\(string, CompilationUnit\) ```csharp private string GetSourceCode(string UnitFileName, CompilationUnit currentUnit) ``` #### Parameters `UnitFileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### GetSourceContext\(compiler\_directive\) ```csharp private SourceContext GetSourceContext(compiler_directive directive) ``` #### Parameters `directive` compiler\_directive #### Returns SourceContext ### GetSourceFileText\(string\) ```csharp public string GetSourceFileText(string FileName) ``` #### Parameters `FileName` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### GetUnitFileName\(unit\_or\_namespace, string\) ```csharp public string GetUnitFileName(unit_or_namespace unitNode, string currentPath) ``` #### Parameters `unitNode` unit\_or\_namespace `currentPath` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### GetUnitFileName\(string, string, string, SourceContext\) ```csharp public string GetUnitFileName(string unitName, string usesPath, string currentPath, SourceContext sourceContext) ``` #### Parameters `unitName` [string](https://learn.microsoft.com/dotnet/api/system.string) `usesPath` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentPath` [string](https://learn.microsoft.com/dotnet/api/system.string) `sourceContext` SourceContext #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### GetUnitPath\(CompilationUnit, CompilationUnit\) ```csharp public static string GetUnitPath(CompilationUnit u1, CompilationUnit u2) ``` #### Parameters `u1` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `u2` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### HasIncludeNamespaceDirective\(CompilationUnit\) ```csharp private bool HasIncludeNamespaceDirective(CompilationUnit unit) ``` #### Parameters `unit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### HasOnlySyntaxErrors\(List\) ```csharp private bool HasOnlySyntaxErrors(List errors) ``` #### Parameters `errors` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### InitializeCompilerOptionsRelatedToStandardUnits\(compilation\_unit\) Устанавливает значения опций DisableStandardUnits и UseDllForSystemUnits ```csharp private void InitializeCompilerOptionsRelatedToStandardUnits(compilation_unit unitSyntaxTree) ``` #### Parameters `unitSyntaxTree` compilation\_unit ### InitializeNewUnit\(string, string, ref CompilationUnit, out Dictionary\) Получение исходного кода модуля, заполнение документации, генерация синтаксического дерева, обработка синтаксических ошибок ```csharp private void InitializeNewUnit(string unitFileName, string UnitId, ref CompilationUnit currentUnit, out Dictionary docs) ``` #### Parameters `unitFileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `UnitId` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `docs` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2) ### InitializeProjectInfoAndFillCompilerOptionsFromIt\(\) ```csharp private void InitializeProjectInfoAndFillCompilerOptionsFromIt() ``` ### InternalParseText\(ILanguage, string, string, List, List, List, bool\) ```csharp private compilation_unit InternalParseText(ILanguage language, string fileName, string text, List errorList, List warnings, List definesList = null, bool calculateHealth = true) ``` #### Parameters `language` ILanguage `fileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `text` [string](https://learn.microsoft.com/dotnet/api/system.string) `errorList` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) `warnings` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) `definesList` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\> `calculateHealth` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) #### Returns compilation\_unit ### IsDll\(compilation\_unit\) Проверяет, является ли модуль dll по соответствующей директиве ```csharp public static bool IsDll(compilation_unit unitSyntaxTree) ``` #### Parameters `unitSyntaxTree` compilation\_unit #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### IsDll\(compilation\_unit, out compiler\_directive\) Проверяет, является ли модуль dll по соответствующей директиве и возвращает эту директиву выходным параметром ```csharp public static bool IsDll(compilation_unit unitSyntaxTree, out compiler_directive dllDirective) ``` #### Parameters `unitSyntaxTree` compilation\_unit `dllDirective` compiler\_directive #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### IsDocumentationNeeded\(compilation\_unit\) ```csharp private bool IsDocumentationNeeded(compilation_unit unitSyntaxTree) ``` #### Parameters `unitSyntaxTree` compilation\_unit #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### IsPossibleNetNamespaceOrStandardPasFile\(unit\_or\_namespace, bool, string\) ```csharp private bool IsPossibleNetNamespaceOrStandardPasFile(unit_or_namespace name_space, bool addToStandardModules, string currentPath) ``` #### Parameters `name_space` unit\_or\_namespace `addToStandardModules` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) `currentPath` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### MatchSyntaxErrorsToBadNodes\(CompilationUnit\) ```csharp private void MatchSyntaxErrorsToBadNodes(CompilationUnit currentUnit) ``` #### Parameters `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) ### NeedRecompiled\(string, string\[\], PCUReader\) ```csharp public bool NeedRecompiled(string pcu_name, string[] included, PCUReader pr) ``` #### Parameters `pcu_name` [string](https://learn.microsoft.com/dotnet/api/system.string) `included` [string](https://learn.microsoft.com/dotnet/api/system.string)\[\] `pr` [PCUReader](PascalABCCompiler.PCU.PCUReader.md) #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### ParseText\(string, string, List, List\) ```csharp public compilation_unit ParseText(string fileName, string text, List errorList, List warnings) ``` #### Parameters `fileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `text` [string](https://learn.microsoft.com/dotnet/api/system.string) `errorList` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) `warnings` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) #### Returns compilation\_unit ### PrebuildMainSemanticTreeActions\(out CompilerOptions, out List\) Сохраняет документацию для модулей; Выясняет тип выходного файла, целевой фреймворк, платформу; Заполняет опции .NET компиляции согласно директивам и/или информации из проекта; Находит ресурсные файлы из директив ```csharp private void PrebuildMainSemanticTreeActions(out CompilerOptions netCompilerOptions, out List resourceFiles) ``` #### Parameters `netCompilerOptions` CompilerOptions `resourceFiles` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\> ### PreloadReference\(compiler\_directive\) ```csharp private Assembly PreloadReference(compiler_directive reference) ``` #### Parameters `reference` compiler\_directive #### Returns [Assembly](https://learn.microsoft.com/dotnet/api/system.reflection.assembly) ### PrepareFinalMainFunctionForExe\(program\_node\) ```csharp public void PrepareFinalMainFunctionForExe(program_node mainSemanticTree) ``` #### Parameters `mainSemanticTree` program\_node ### PrepareUserNamespacesUsedInTheCurrentUnit\(CompilationUnit\) ```csharp private Dictionary PrepareUserNamespacesUsedInTheCurrentUnit(CompilationUnit compilationUnit) ``` #### Parameters `compilationUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) #### Returns [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), syntax\_namespace\_node\> ### ReadDLL\(string, SourceContext\) ```csharp public CompilationUnit ReadDLL(string FileName, SourceContext sc = null) ``` #### Parameters `FileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `sc` SourceContext #### Returns [CompilationUnit](PascalABCCompiler.CompilationUnit.md) ### ReadPCU\(string\) ```csharp public CompilationUnit ReadPCU(string FileName) ``` #### Parameters `FileName` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [CompilationUnit](PascalABCCompiler.CompilationUnit.md) ### Reload\(\) ```csharp public void Reload() ``` ### Reset\(\) ```csharp private void Reset() ``` ### RunSemanticChecks\(string, CompilationUnit\) Семантические проверки по директивам и по типу файла ```csharp private void RunSemanticChecks(string unitFileName, CompilationUnit currentUnit) ``` #### Parameters `unitFileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) ### SaveDocumentationsForUnits\(\) ```csharp private void SaveDocumentationsForUnits() ``` ### SavePCU\(CompilationUnit\) ```csharp public void SavePCU(CompilationUnit Unit) ``` #### Parameters `Unit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) ### SaveUnitCheckInParsers\(\) Передаем парсерам возможность проверить, компилируется ли в данный момент модуль (нужно, если нет ключевого слова unit или подобного в языке) ```csharp private void SaveUnitCheckInParsers() ``` ### SemanticCheckCurrentUnitMustBeUnitModule\(string, CompilationUnit, bool\) ```csharp private void SemanticCheckCurrentUnitMustBeUnitModule(string UnitFileName, CompilationUnit currentUnit, bool isDll) ``` #### Parameters `UnitFileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `isDll` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### SemanticCheckDLLDirectiveOnlyForLibraries\(compilation\_unit, bool, compiler\_directive\) Проверка, что директива dll только в Library - требует передачи директивы dll ```csharp private void SemanticCheckDLLDirectiveOnlyForLibraries(compilation_unit unitSyntaxTree, bool isDll, compiler_directive dllDirective) ``` #### Parameters `unitSyntaxTree` compilation\_unit `isDll` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) `dllDirective` compiler\_directive ### SemanticCheckDisableStandardUnitsDirectiveInUnit\(compilation\_unit\) Ошибка указания директивы DisableStandardUnits в подключенном модулей ```csharp private void SemanticCheckDisableStandardUnitsDirectiveInUnit(compilation_unit unitSyntaxTree) ``` #### Parameters `unitSyntaxTree` compilation\_unit ### SemanticCheckIsUserNamespace\(compilation\_unit\) ```csharp private void SemanticCheckIsUserNamespace(compilation_unit unitSyntaxTree) ``` #### Parameters `unitSyntaxTree` compilation\_unit ### SemanticCheckNamespacesOnlyInProjects\(CompilationUnit\) ```csharp private void SemanticCheckNamespacesOnlyInProjects(CompilationUnit currentUnit) ``` #### Parameters `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) ### SemanticCheckNoIncludeNamespaceDirectivesInUnit\(CompilationUnit\) ```csharp private void SemanticCheckNoIncludeNamespaceDirectivesInUnit(CompilationUnit currentUnit) ``` #### Parameters `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) ### SemanticCheckNoLoopDependenciesOfInterfaces\(CompilationUnit, string, unit\_or\_namespace, string\) ```csharp private void SemanticCheckNoLoopDependenciesOfInterfaces(CompilationUnit currentUnit, string unitFileName, unit_or_namespace usedUnitNode, string currentPath) ``` #### Parameters `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) `unitFileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `usedUnitNode` unit\_or\_namespace `currentPath` [string](https://learn.microsoft.com/dotnet/api/system.string) ### SemanticCheckUsesInIsNotNamespace\(unit\_or\_namespace, CompilationUnit\) ```csharp private void SemanticCheckUsesInIsNotNamespace(unit_or_namespace currentUnitNode, CompilationUnit currentUnit) ``` #### Parameters `currentUnitNode` unit\_or\_namespace `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) ### SetOutputFileTypeOption\(Dictionary\>\) ```csharp private void SetOutputFileTypeOption(Dictionary> compilerDirectives) ``` #### Parameters `compilerDirectives` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)\> ### SetOutputPlatformOption\(CompilerOptions, Dictionary\>\) ```csharp private void SetOutputPlatformOption(CompilerOptions netCompilerOptions, Dictionary> compilerDirectives) ``` #### Parameters `netCompilerOptions` CompilerOptions `compilerDirectives` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1)\> ### SetSupportedProjectFiles\(\) ```csharp private void SetSupportedProjectFiles() ``` ### SetSupportedSourceFiles\(\) ```csharp private void SetSupportedSourceFiles() ``` ### SetTargetTypeOption\(CompilerOptions\) ```csharp private void SetTargetTypeOption(CompilerOptions netCompilerOptions) ``` #### Parameters `netCompilerOptions` CompilerOptions ### SetUseDLLForSystemUnits\(string, List, int\) Если в программе в секции uses есть не про-во имен и не стандартный модуль, то использование PABCRtl.dll отменяется ```csharp private void SetUseDLLForSystemUnits(string currentDirectory, List usesList, int lastUnitIndex) ``` #### Parameters `currentDirectory` [string](https://learn.microsoft.com/dotnet/api/system.string) `usesList` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list\-1) `lastUnitIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32) ### SourceFileExists\(string\) ```csharp private bool SourceFileExists(string FileName) ``` #### Parameters `FileName` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### SourceFileGetLastWriteTime\(string\) ```csharp private DateTime SourceFileGetLastWriteTime(string FileName) ``` #### Parameters `FileName` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) ### StartCompile\(\) ```csharp public void StartCompile() ``` ### ToString\(\) ```csharp public override string ToString() ``` #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### TryThrowInvalidPath\(string, SourceContext\) ```csharp public static void TryThrowInvalidPath(string path, SourceContext loc) ``` #### Parameters `path` [string](https://learn.microsoft.com/dotnet/api/system.string) `loc` SourceContext ### UnitHasPCU\(unit\_node\_list, Dictionary, unit\_or\_namespace, ref string, ref CompilationUnit\) ```csharp private bool UnitHasPCU(unit_node_list unitsFromUsesSection, Dictionary directUnitsFromUsesSection, unit_or_namespace currentUnitNode, ref string UnitFileName, ref CompilationUnit currentUnit) ``` #### Parameters `unitsFromUsesSection` unit\_node\_list `directUnitsFromUsesSection` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary\-2) `currentUnitNode` unit\_or\_namespace `UnitFileName` [string](https://learn.microsoft.com/dotnet/api/system.string) `currentUnit` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) #### Returns [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### WaitCallback\_ClosePCUWriters\(object\) ```csharp private void WaitCallback_ClosePCUWriters(object state) ``` #### Parameters `state` [object](https://learn.microsoft.com/dotnet/api/system.object) ### buildImplementationUsesList\(CompilationUnit\) ```csharp private unit_node_list buildImplementationUsesList(CompilationUnit cu) ``` #### Parameters `cu` [CompilationUnit](PascalABCCompiler.CompilationUnit.md) #### Returns unit\_node\_list ### get\_assembly\_path\(string, bool\) ```csharp public static string get_assembly_path(string name, bool search_for_intellisense) ``` #### Parameters `name` [string](https://learn.microsoft.com/dotnet/api/system.string) `search_for_intellisense` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### get\_standart\_assembly\_path\(string\) ```csharp public static string get_standart_assembly_path(string name) ``` #### Parameters `name` [string](https://learn.microsoft.com/dotnet/api/system.string) #### Returns [string](https://learn.microsoft.com/dotnet/api/system.string) ### pr\_ChangeState\(object, PCUReaderWriterState, object\) ```csharp private void pr_ChangeState(object Sender, PCUReaderWriterState State, object obj) ``` #### Parameters `Sender` [object](https://learn.microsoft.com/dotnet/api/system.object) `State` [PCUReaderWriterState](PascalABCCompiler.PCU.PCUReaderWriterState.md) `obj` [object](https://learn.microsoft.com/dotnet/api/system.object) ### semanticTreeConvertersController\_ChangeState\(State, ISemanticTreeConverter\) ```csharp private void semanticTreeConvertersController_ChangeState(SemanticTreeConvertersController.State State, ISemanticTreeConverter SemanticTreeConverter) ``` #### Parameters `State` [SemanticTreeConvertersController](PascalABCCompiler.SemanticTreeConverters.SemanticTreeConvertersController.md).[State](PascalABCCompiler.SemanticTreeConverters.SemanticTreeConvertersController.State.md) `SemanticTreeConverter` [ISemanticTreeConverter](PascalABCCompiler.SemanticTreeConverters.ISemanticTreeConverter.md) ### OnChangeCompilerState ```csharp public event ChangeCompilerStateEventDelegate OnChangeCompilerState ``` #### Event Type [ChangeCompilerStateEventDelegate](PascalABCCompiler.ChangeCompilerStateEventDelegate.md)