GetName() статический приватный Метод

static private GetName ( PredefinedType type ) : string
type PredefinedType
Результат string
        public bool Init(ErrorHandling errorContext, SymbolTable symtable)
        {
            _runtimeBinderSymbolTable = symtable;
            Debug.Assert(_pBSymmgr != null);

#if !CSEE
            Debug.Assert(_predefSyms == null);
#else // CSEE
            Debug.Assert(predefSyms == null || aidMsCorLib != KAID.kaidNil);
#endif // CSEE

            if (_aidMsCorLib == KAID.kaidNil)
            {
                // If we haven't found mscorlib yet, first look for System.Object. Then use its assembly as
                // the location for all other pre-defined types.
                AggregateSymbol aggObj = FindPredefinedType(errorContext, PredefinedTypeFacts.GetName(PredefinedType.PT_OBJECT), KAID.kaidGlobal, AggKindEnum.Class, 0, true);
                if (aggObj == null)
                {
                    return(false);
                }
                _aidMsCorLib = aggObj.GetAssemblyID();
            }

            _predefSyms = new AggregateSymbol[(int)PredefinedType.PT_COUNT];
            Debug.Assert(_predefSyms != null);

            return(true);
        }
Пример #2
0
        ////////////////////////////////////////////////////////////////////////////////
        // Build the data structures needed to make FPreLoad fast. Make sure the
        // namespaces are created. Compute and sort hashes of the NamespaceSymbol * value and type
        // name (sans arity indicator).

        private void InitPreLoad()
        {
            for (int i = 0; i < (int)PredefinedType.PT_COUNT; ++i)
            {
                NamespaceSymbol ns    = GetRootNS();
                string          name  = PredefinedTypeFacts.GetName((PredefinedType)i);
                int             start = 0;
                while (start < name.Length)
                {
                    int iDot = name.IndexOf('.', start);
                    if (iDot == -1)
                    {
                        break;
                    }
                    string          sub = (iDot > start) ? name.Substring(start, iDot - start) : name.Substring(start);
                    Name            nm  = this.GetNameManager().Add(sub);
                    NamespaceSymbol sym = this.LookupGlobalSymCore(nm, ns, symbmask_t.MASK_NamespaceSymbol).AsNamespaceSymbol();
                    if (sym == null)
                    {
                        ns = _symFactory.CreateNamespace(nm, ns);
                    }
                    else
                    {
                        ns = sym;
                    }
                    start += sub.Length + 1;
                }
            }
        }
Пример #3
0
        public BSYMMGR()
        {
            this.tableGlobal = new SYMTBL();
            _symFactory      = new SymFactory(this.tableGlobal);

            this.tableTypeArrays = new Dictionary <TypeArrayKey, TypeArray>();
            _rootNS = _symFactory.CreateNamespace(NameManager.Lookup(""), null);

            ////////////////////////////////////////////////////////////////////////////////
            // Build the data structures needed to make FPreLoad fast. Make sure the
            // namespaces are created. Compute and sort hashes of the NamespaceSymbol * value and type
            // name (sans arity indicator).

            for (int i = 0; i < (int)PredefinedType.PT_COUNT; ++i)
            {
                NamespaceSymbol ns    = GetRootNS();
                string          name  = PredefinedTypeFacts.GetName((PredefinedType)i);
                int             start = 0;
                while (start < name.Length)
                {
                    int iDot = name.IndexOf('.', start);
                    if (iDot == -1)
                    {
                        break;
                    }
                    string sub = (iDot > start) ? name.Substring(start, iDot - start) : name.Substring(start);
                    Name   nm  = NameManager.Add(sub);
                    ns     = LookupGlobalSymCore(nm, ns, symbmask_t.MASK_NamespaceSymbol) as NamespaceSymbol ?? _symFactory.CreateNamespace(nm, ns);
                    start += sub.Length + 1;
                }
            }
        }
        public void ReportMissingPredefTypeError(ErrorHandling errorContext, PredefinedType pt)
        {
            Debug.Assert(_pBSymmgr != null);
            Debug.Assert(_predefSyms != null);
            Debug.Assert((PredefinedType)0 <= pt && pt < PredefinedType.PT_COUNT && _predefSyms[(int)pt] == null);

            // We do not assert that !predefTypeInfo[pt].isRequired because if the user is defining
            // their own MSCorLib and is defining a required PredefType, they'll run into this error
            // and we need to allow it to go through.

            errorContext.Error(ErrorCode.ERR_PredefinedTypeNotFound, PredefinedTypeFacts.GetName(pt));
        }
 public static string GetFullName(PredefinedType pt)
 {
     return(PredefinedTypeFacts.GetName(pt));
 }
Пример #6
0
 public static string GetFullName(PredefinedType pt) => PredefinedTypeFacts.GetName(pt);