/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
v2.0.3-alpha
src/ScriptEngine/Machine/StackRuntimeModule.cs
67 строк
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 System.Collections.Generic; using OneScript.Contexts; using OneScript.Sources; using OneScript.Values; using ScriptEngine.Machine.Contexts; namespace ScriptEngine.Machine { public class StackRuntimeModule : IExecutableModule { public StackRuntimeModule(Type ownerType) { ClassType = ownerType; } public StackRuntimeModule() : this(typeof(UserScriptContextInstance)) { } public Type ClassType { get; } public int LoadAddress { get; set; } = -1; public int EntryMethodIndex { get; set; } = -1; public List<BslPrimitiveValue> Constants { get; } = new List<BslPrimitiveValue>(); public IList<SymbolBinding> VariableRefs { get; } = new List<SymbolBinding>(); public IList<SymbolBinding> MethodRefs { get; } = new List<SymbolBinding>(); #region IExecutableModule members public BslMethodInfo ModuleBody { get { if (EntryMethodIndex == -1) return null; return Methods[MethodRefs[EntryMethodIndex].CodeIndex]; } } public IList<BslAnnotationAttribute> ModuleAttributes { get; } = new List<BslAnnotationAttribute>(); public IList<BslFieldInfo> Fields { get; } = new List<BslFieldInfo>(); public IList<BslPropertyInfo> Properties { get; } = new List<BslPropertyInfo>(); public IList<BslMethodInfo> Methods { get; } = new List<BslMethodInfo>(); public IList<Command> Code { get; } = new List<Command>(512); public SourceCode Source { get; set; } #endregion } }