Exemplo n.º 1
0
        public static ResourceAncestorGraph Compute(SyntaxTree syntaxTree, IBinder binder)
        {
            var visitor = new ResourceAncestorVisitor(binder);

            visitor.Visit(syntaxTree.ProgramSyntax);
            return(new ResourceAncestorGraph(visitor.Ancestry));
        }
Exemplo n.º 2
0
        public static ResourceAncestorGraph Compute(SemanticModel semanticModel)
        {
            var visitor = new ResourceAncestorVisitor(semanticModel);

            visitor.Visit(semanticModel.SourceFile.ProgramSyntax);

            var ancestry = visitor.Ancestry.Keys
                           .ToImmutableDictionary(
                child => child,
                child => GetAncestorsYoungestToOldest(visitor.Ancestry, child).Reverse().ToImmutableArray());

            return(new ResourceAncestorGraph(ancestry));
        }
Exemplo n.º 3
0
        public static ResourceAncestorGraph Compute(SyntaxTree syntaxTree, IBinder binder)
        {
            var visitor = new ResourceAncestorVisitor(binder);

            visitor.Visit(syntaxTree.ProgramSyntax);

            var ancestry = visitor.Ancestry.Keys
                           .ToImmutableDictionary(
                child => child,
                child => GetAncestorsYoungestToOldest(visitor.Ancestry, child).Reverse().ToImmutableArray());

            return(new ResourceAncestorGraph(ancestry));
        }