Beispiel #1
0
        public ErrorType GetErrorType(
            Name nameText,
            TypeArray typeArgs)
        {
            Debug.Assert(nameText != null);
            if (typeArgs == null)
            {
                typeArgs = BSYMMGR.EmptyTypeArray();
            }

            Name name = _BSymmgr.GetNameFromPtrs(nameText, typeArgs);

            Debug.Assert(name != null);

            ErrorType pError = _typeTable.LookupError(name);

            if (pError == null)
            {
                // No existing error symbol. Create a new one.
                pError = _typeFactory.CreateError(name, nameText, typeArgs);
                pError.SetErrors(true);
                _typeTable.InsertError(name, pError);
            }
            else
            {
                Debug.Assert(pError.HasErrors());
                Debug.Assert(pError.nameText == nameText);
                Debug.Assert(pError.typeArgs == typeArgs);
            }

            return(pError);
        }
Beispiel #2
0
        public ErrorType GetErrorType(
            CType pParentType,
            AssemblyQualifiedNamespaceSymbol pParentNS,
            Name nameText,
            TypeArray typeArgs)
        {
            Debug.Assert(nameText != null);
            Debug.Assert(pParentType == null || pParentNS == null);
            if (pParentType == null && pParentNS == null)
            {
                // Use the root namespace as the parent.
                pParentNS = _BSymmgr.GetRootNsAid();
            }
            if (typeArgs == null)
            {
                typeArgs = BSYMMGR.EmptyTypeArray();
            }

            Name name = _BSymmgr.GetNameFromPtrs(nameText, typeArgs);

            Debug.Assert(name != null);

            ErrorType pError = null;

            if (pParentType != null)
            {
                pError = _typeTable.LookupError(name, pParentType);
            }
            else
            {
                Debug.Assert(pParentNS != null);
                pError = _typeTable.LookupError(name, pParentNS);
            }

            if (pError == null)
            {
                // No existing error symbol. Create a new one.
                pError = _typeFactory.CreateError(name, pParentType, pParentNS, nameText, typeArgs);
                pError.SetErrors(true);
                if (pParentType != null)
                {
                    _typeTable.InsertError(name, pParentType, pError);
                }
                else
                {
                    _typeTable.InsertError(name, pParentNS, pError);
                }
            }
            else
            {
                Debug.Assert(pError.HasErrors());
                Debug.Assert(pError.nameText == nameText);
                Debug.Assert(pError.typeArgs == typeArgs);
            }

            return(pError);
        }
Beispiel #3
0
        public ErrorType GetErrorType(Name nameText)
        {
            Debug.Assert(nameText != null);
            ErrorType pError = _typeTable.LookupError(nameText);

            if (pError == null)
            {
                // No existing error symbol. Create a new one.
                pError = _typeFactory.CreateError(nameText);
                pError.SetErrors(true);
                _typeTable.InsertError(nameText, pError);
            }
            else
            {
                Debug.Assert(pError.HasErrors());
                Debug.Assert(pError.nameText == nameText);
            }

            return(pError);
        }