예제 #1
0
        /// <summary>
        /// Get the known types from the <see cref="AbstractSyntaxTree"/>.
        /// </summary>
        /// <param name="abstractSyntaxTree"></param>
        /// <returns></returns>
        public static List <KnownType> GetKnownTypes(AbstractSyntaxTree abstractSyntaxTree)
        {
            var harvester = new KnownTypesHarvester();

            harvester.Visit(abstractSyntaxTree);
            return(harvester._knownTypes);
        }
예제 #2
0
 public SemanticModel(AbstractSyntaxTree abstractSyntaxTree)
 {
     AbstractSyntaxTree = abstractSyntaxTree;
     _knownTypes        = new Lazy <IReadOnlyCollection <KnownType> >(
         () => KnownTypesHarvester.GetKnownTypes(abstractSyntaxTree));
 }