Example #1
0
 public CMethodIterator GetMethodIterator(
     CSemanticChecker pChecker, SymbolLoader pSymLoader, CType pObject, CType pQualifyingType, Declaration pContext, bool allowBogusAndInaccessible, bool allowExtensionMethods, int arity, EXPRFLAG flags, symbmask_t mask)
 {
     Debug.Assert(pSymLoader != null);
     CMethodIterator iterator = new CMethodIterator(pChecker, pSymLoader, _pName, ContainingTypes, pObject, pQualifyingType, pContext, allowBogusAndInaccessible, allowExtensionMethods, arity, flags, mask);
     return iterator;
 }
Example #2
0
 public CMethodIterator(CSemanticChecker checker, SymbolLoader symLoader, Name name, TypeArray containingTypes, CType @object, CType qualifyingType, Declaration context, bool allowBogusAndInaccessible, bool allowExtensionMethods, int arity, EXPRFLAG flags, symbmask_t mask)
 {
     Debug.Assert(name != null);
     Debug.Assert(symLoader != null);
     Debug.Assert(checker != null);
     Debug.Assert(containingTypes != null);
     _pSemanticChecker = checker;
     _pSymbolLoader = symLoader;
     _pCurrentType = null;
     _pCurrentSym = null;
     _pName = name;
     _pContainingTypes = containingTypes;
     _pQualifyingType = qualifyingType;
     _pContext = context;
     _bAllowBogusAndInaccessible = allowBogusAndInaccessible;
     _bAllowExtensionMethods = allowExtensionMethods;
     _nArity = arity;
     _flags = flags;
     _mask = mask;
     _nCurrentTypeCount = 0;
     _bIsCheckingInstanceMethods = true;
     _bAtEnd = false;
     _bCurrentSymIsBogus = false;
     _bCurrentSymIsInaccessible = false;
     _bcanIncludeExtensionsInResults = _bAllowExtensionMethods;
     _bEndIterationAtCurrentExtensionList = false;
 }
Example #3
0
        public AggregateDeclaration CreateAggregateDecl(AggregateSymbol agg, Declaration declOuter)
        {
            Debug.Assert(agg != null);
            //Debug.Assert(declOuter == null || declOuter.Bag() == agg.Parent);

            // DECLSYMs are not parented like named symbols.
            AggregateDeclaration sym = newBasicSym(SYMKIND.SK_AggregateDeclaration, agg.name, null).AsAggregateDeclaration();

            if (declOuter != null)
            {
                declOuter.AddToChildList(sym);
            }
            agg.AddDecl(sym);

            Debug.Assert(sym != null);
            return (sym);
        }
        // Compare to ParentSymbol::AddToChildList
        public void AddDecl(Declaration decl)
        {
            Debug.Assert(decl != null);
            Debug.Assert(this.IsNamespaceSymbol() || this.IsAggregateSymbol());
            Debug.Assert(decl.IsNamespaceDeclaration() || decl.IsAggregateDeclaration());
            Debug.Assert(!this.IsNamespaceSymbol() == !decl.IsNamespaceDeclaration());

            // If parent is set it should be set to us!
            Debug.Assert(decl.bag == null || decl.bag == this);
            // There shouldn't be a declNext.
            Debug.Assert(decl.declNext == null);

            if (_declLast == null)
            {
                Debug.Assert(_declFirst == null);
                _declFirst = _declLast = decl;
            }
            else
            {
                _declLast.declNext = decl;
                _declLast = decl;

#if DEBUG
                // Validate our chain.
                Declaration pdecl;
                for (pdecl = _declFirst; pdecl != null && pdecl.declNext != null; pdecl = pdecl.declNext)
                { }
                Debug.Assert(pdecl == null || (pdecl == _declLast && pdecl.declNext == null));
#endif
            }

            decl.declNext = null;
            decl.bag = this;

            if (decl.IsNamespaceDeclaration())
                decl.AsNamespaceDeclaration().Bag().DeclAdded(decl.AsNamespaceDeclaration());
        }
Example #5
0
 public CMethodIterator(CSemanticChecker checker, SymbolLoader symLoader, Name name, TypeArray containingTypes, CType @object, CType qualifyingType, Declaration context, bool allowBogusAndInaccessible, bool allowExtensionMethods, int arity, EXPRFLAG flags, symbmask_t mask)
 {
     Debug.Assert(name != null);
     Debug.Assert(symLoader != null);
     Debug.Assert(checker != null);
     Debug.Assert(containingTypes != null);
     _pSemanticChecker           = checker;
     _pSymbolLoader              = symLoader;
     _pCurrentType               = null;
     _pCurrentSym                = null;
     _pName                      = name;
     _pContainingTypes           = containingTypes;
     _pQualifyingType            = qualifyingType;
     _pContext                   = context;
     _bAllowBogusAndInaccessible = allowBogusAndInaccessible;
     _bAllowExtensionMethods     = allowExtensionMethods;
     _nArity                     = arity;
     _flags                      = flags;
     _mask = mask;
     _nCurrentTypeCount          = 0;
     _bIsCheckingInstanceMethods = true;
     _bAtEnd                              = false;
     _bCurrentSymIsBogus                  = false;
     _bCurrentSymIsInaccessible           = false;
     _bcanIncludeExtensionsInResults      = _bAllowExtensionMethods;
     _bEndIterationAtCurrentExtensionList = false;
 }