/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
v2.0.3-alpha
src/ScriptEngine/ICompilerService.cs
46 строк
2 KB
EvilBeaver
Разделение типов рантайма по модулям
22 ноя 2021, 23:43
22 ноя 2021, 23:43
c528ba4
Код
Авторство
О чём код?
/*---------------------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ----------------------------------------------------------*/ using System; using OneScript.Contexts; using ScriptEngine.Compiler; using ScriptEngine.Machine; using OneScript.Sources; namespace ScriptEngine { /// <summary> /// Сервис компиляции единичного модуля. /// </summary> public interface ICompilerService { CodeGenerationFlags ProduceExtraCode { get; set; } int DefineVariable(string name, string alias, SymbolType type); int DefineMethod(BslMethodInfo methodSignature); void DefinePreprocessorValue(string name); IExecutableModule Compile(SourceCode source, Type classType = null); IExecutableModule CompileExpression(SourceCode source); IExecutableModule CompileBatch(SourceCode source); } /// <summary> /// Заглушка на стадии рефакторинга инфраструктуры компилятора /// </summary> public static class StackCompilerExtension { public static StackRuntimeModule CompileStack(this ICompilerService compiler, SourceCode source, Type classType = null) { return (StackRuntimeModule)compiler.Compile(source, classType); } } }