pascalabcnet/NETGenerator/CodeGenerator.cs
AlexanderZemlyak 0626885b5f
Рефакторинг в Intellisense (#3328)
* Migrate from HashTable to Dictionary<string, string> (StandartDirectories variable)

* Add check to register files for parsing only if they have supported extension

* Delete legacy code in CodeCompletion.cs

* Delete unnecessary fields in CodeCompletionController

* Refactor compiling dependencies code in DomSyntaxTreeVisitor

* Fix AddStandardNetNamespacesToUserScope check

* Comment out uses *some type* support in Intellisense

* Delete unused SemanticOptions in DomSyntaxTreeVisitor

* Comment out unused NamespaceTypeScope
2025-10-01 11:47:05 +03:00

40 lines
1.4 KiB
C#

// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
/***************************************************************************
*
* Интерфейс доступа к кодогенераторам для Compiler
* Зависит от SemanticTree
*
***************************************************************************/
using System.Collections.Generic;
using PascalABCCompiler.NetHelper;
namespace PascalABCCompiler.CodeGenerators
{
/*public class CodeGeneratorOptions
{
public NETGenerator.TargetType TargetType;
}*/
public class Controller
{
private NETGenerator.ILConverter il_converter;//=new NETGenerator.ILConverter();
public void GenerateILCodeAndSaveAssembly(SemanticTree.IProgramNode ProgramTree,string TargetFileName,string SourceFileName ,
NETGenerator.CompilerOptions options, Dictionary<string, string> StandartDirectories, string[] ResourceFiles)
{
il_converter = new NETGenerator.ILConverter(StandartDirectories);
il_converter.ConvertFromTree(ProgramTree, TargetFileName, SourceFileName, options, ResourceFiles);
}
public void EmitAssemblyRedirects(AssemblyResolveScope resolveScope, string outputFileName) =>
il_converter.EmitAssemblyRedirects(resolveScope, outputFileName);
public void Reset()
{
il_converter = null;
}
}
}