/*---------------------------------------------------------- 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 System.Dynamic; using System.Linq; using System.Text; using ScriptEngine.Machine; using ScriptEngine.Environment; namespace ScriptEngine { [Serializable] public class ModuleImage { public ModuleImage() { EntryMethodIndex = -1; Code = new List(); VariableRefs = new List(); MethodRefs = new List(); Methods = new List(); Constants = new List(); ExportedProperties = new List(); ExportedMethods = new List(); Variables = new VariablesFrame(); } public VariablesFrame Variables { get; } public int EntryMethodIndex { get; set; } public IList Code { get; set; } public IList VariableRefs { get; set; } public IList MethodRefs { get; set; } public IList Methods { get; set; } public IList Constants { get; set; } public IList ExportedProperties { get; set; } public IList ExportedMethods { get; set; } public int LoadAddress { get; set; } // Привязка к исходному коду для отладочной информации в RuntimeException [NonSerialized] private ModuleInformation _source; public ModuleInformation ModuleInfo { get { return _source; } set { _source = value; } } private static ModuleImage _emptyInstance; static ModuleImage() { } public static ModuleImage EmptyModule { get { if (_emptyInstance == null) { _emptyInstance = new ModuleImage(); } return _emptyInstance; } } } [Serializable] public struct MethodDescriptor { public MethodInfo Signature; public VariablesFrame Variables; public int EntryPoint; } [Serializable] public struct ExportedSymbol { public string SymbolicName; public int Index; } }