Пример #1
0
        public static Symbol GetSymbol(string typeName, SymbolProviders.Module module)
        {
            Symbol[] symbols;

            if (deduplicatedSymbols.TryGetValue(typeName, out symbols))
            {
                return(symbols[0]);
            }
            return(module.GetSymbol(typeName));
        }
Пример #2
0
        /// <summary>
        /// Gets the pointer type to this symbol.
        /// </summary>
        protected override Symbol GetPointerType()
        {
            uint pointerTypeId = EngineModuleProvider.GetTypePointerToTypeId(Id);

            if (pointerTypeId != int.MaxValue)
            {
                return(Module.GetSymbol(pointerTypeId));
            }
            return(base.GetPointerType());
        }
Пример #3
0
        /// <summary>
        /// Gets user type base classes.
        /// </summary>
        protected override IEnumerable <Symbol> GetBaseClasses()
        {
            foreach (Tuple <uint, int> baseClass in EngineModuleProvider.GetTypeDirectBaseClasses(Id).Values)
            {
                Symbol baseClassTypeSymbol = Module.GetSymbol(baseClass.Item1);
                Symbol baseClassSymbol     = new EngineSymbolProviderSymbol(Module, baseClass.Item1, baseClass.Item2, CodeTypeTag.BaseClass);

                baseClassTypeSymbol.LinkSymbols(baseClassSymbol);
                yield return(baseClassSymbol);
            }
        }
Пример #4
0
        /// <summary>
        /// Gets user type fields.
        /// </summary>
        protected override IEnumerable <SymbolField> GetFields()
        {
            // Non-static fields
            foreach (string fieldName in EngineModuleProvider.GetTypeFieldNames(Id))
            {
                Tuple <uint, int> fieldTypeAndOffset = EngineModuleProvider.GetTypeFieldTypeAndOffset(Id, fieldName);
                Symbol            fieldType          = Module.GetSymbol(fieldTypeAndOffset.Item1);

                yield return(new EngineSymbolProviderSymbolField(this, fieldName, fieldType, fieldTypeAndOffset.Item2));
            }

            // Static fields
            foreach (string fieldName in EngineModuleProvider.GetTypeStaticFieldNames(Id))
            {
                Tuple <uint, ulong> fieldTypeAndAddress = EngineModuleProvider.GetTypeStaticFieldTypeAndAddress(Id, fieldName);
                Symbol fieldType = Module.GetSymbol(fieldTypeAndAddress.Item1);

                yield return(new EngineSymbolProviderSymbolField(this, fieldName, fieldType, int.MinValue));
            }
        }
Пример #5
0
        /// <summary>
        /// Gets the element type (if symbol is array or pointer).
        /// </summary>
        protected override Symbol GetElementType()
        {
            uint elementTypeId = EngineModuleProvider.GetTypeElementTypeId(Id);

            return(Module.GetSymbol(elementTypeId));
        }