상속: ContainerSymbol
예제 #1
0
 public NamespaceBinder(SharedBinderState sharedBinderState, Binder parent, NamespaceSymbol namespaceSymbol)
     : base(sharedBinderState, parent)
 {
     NamespaceSymbol = namespaceSymbol;
 }
예제 #2
0
        private BoundNode BindNamespace(NamespaceSyntax declaration)
        {
            var enclosingNamespace = LookupEnclosingNamespace();
            var namespaceSymbol = new NamespaceSymbol(declaration, enclosingNamespace);

            AddSymbol(namespaceSymbol, declaration.Name.Span);

            var namespaceBinder = new NamespaceBinder(_sharedBinderState, this, namespaceSymbol);
            namespaceSymbol.Binder = namespaceBinder;

            var boundDeclarations = namespaceBinder.BindTopLevelDeclarations(declaration.Declarations, namespaceSymbol);

            foreach (var member in namespaceBinder.LocalSymbols.Values.SelectMany(x => x))
                namespaceSymbol.AddMember(member);

            return new BoundNamespace(namespaceSymbol, boundDeclarations);
        }
예제 #3
0
 public BoundNamespace(NamespaceSymbol namespaceSymbol, ImmutableArray<BoundNode> declarations)
     : base(BoundNodeKind.Namespace)
 {
     NamespaceSymbol = namespaceSymbol;
     Declarations = declarations;
 }