public void Build(PackageBinder packageBinder)
        {
            var imports = compilationUnit.UsingDirectives.SelectMany(u => GatherImportedSymbols(u, packageBinder));
            var scope = new CompilationUnitBinder(packageBinder, compilationUnit, imports);

            foreach(var declaration in compilationUnit.Declarations)
                Build(declaration, scope);
        }
        public IReadOnlyDictionary<SyntaxNode, Binder> Build(DiagnosticsBuilder diagnostics)
        {
            var binders = new Dictionary<SyntaxNode, Binder>();
            // The package binder doesn't go in the binders collection, it just serves as the root binder
            var packageBinder = new PackageBinder(package);
            foreach(var compilationUnit in package.Syntax.CompilationUnits)
                new CompilationUnitBindersBuilder(binders, package, compilationUnit, diagnostics).Build(packageBinder);

            return binders;
        }
        public void Build(PackageBinder packageBinder)
        {
            var imports = compilationUnit.UsingDirectives.SelectMany(u => GatherImportedSymbols(u, packageBinder));
            var scope   = new CompilationUnitBinder(packageBinder, compilationUnit, imports);

            foreach (var declaration in compilationUnit.Declarations)
            {
                Build(declaration, scope);
            }
        }
        public IReadOnlyDictionary <SyntaxNode, Binder> Build(DiagnosticsBuilder diagnostics)
        {
            var binders = new Dictionary <SyntaxNode, Binder>();
            // The package binder doesn't go in the binders collection, it just serves as the root binder
            var packageBinder = new PackageBinder(package);

            foreach (var compilationUnit in package.Syntax.CompilationUnits)
            {
                new CompilationUnitBindersBuilder(binders, package, compilationUnit, diagnostics).Build(packageBinder);
            }

            return(binders);
        }
 public CompilationUnitBinder(PackageBinder containingScope, CompilationUnitSyntax compilationUnit, IEnumerable<ImportedSymbol> imports)
     : base(containingScope, null, imports)
 {
     this.compilationUnit = compilationUnit;
 }
Exemple #6
0
 public CompilationUnitBinder(PackageBinder containingScope, CompilationUnitSyntax compilationUnit, IEnumerable <ImportedSymbol> imports)
     : base(containingScope, null, imports)
 {
     this.compilationUnit = compilationUnit;
 }