Antlr4.Runtime.Misc.RuleDependencyChecker.CheckDependencies C# (CSharp) Method

CheckDependencies() public static method

public static CheckDependencies ( Assembly assembly ) : void
assembly System.Reflection.Assembly
return void
        public static void CheckDependencies(Assembly assembly)
        {
            if (IsChecked(assembly))
            {
                return;
            }

            IEnumerable<TypeInfo> typesToCheck = GetTypesToCheck(assembly);
            List<Tuple<RuleDependencyAttribute, ICustomAttributeProvider>> dependencies = new List<Tuple<RuleDependencyAttribute, ICustomAttributeProvider>>();
            foreach (TypeInfo clazz in typesToCheck)
            {
                dependencies.AddRange(GetDependencies(clazz));
            }

            if (dependencies.Count > 0)
            {
                IDictionary<TypeInfo, IList<Tuple<RuleDependencyAttribute, ICustomAttributeProvider>>> recognizerDependencies = new Dictionary<TypeInfo, IList<Tuple<RuleDependencyAttribute, ICustomAttributeProvider>>>();
                foreach (Tuple<RuleDependencyAttribute, ICustomAttributeProvider> dependency in dependencies)
                {
                    TypeInfo recognizerType = dependency.Item1.Recognizer.GetTypeInfo();
                    IList<Tuple<RuleDependencyAttribute, ICustomAttributeProvider>> list;
                    if (!recognizerDependencies.TryGetValue(recognizerType, out list))
                    {
                        list = new List<Tuple<RuleDependencyAttribute, ICustomAttributeProvider>>();
                        recognizerDependencies[recognizerType] = list;
                    }
                    list.Add(dependency);
                }

                foreach (KeyValuePair<TypeInfo, IList<Tuple<RuleDependencyAttribute, ICustomAttributeProvider>>> entry in recognizerDependencies)
                {
                    //processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, String.format("ANTLR 4: Validating {0} dependencies on rules in {1}.", entry.getValue().size(), entry.getKey().toString()));
                    CheckDependencies(entry.Value, entry.Key);
                }
            }

            MarkChecked(assembly);
        }

Same methods

RuleDependencyChecker::CheckDependencies ( ICustomAttributeProvider>.IList dependencies, Type recognizerType ) : void
RuleDependencyChecker::CheckDependencies ( ICustomAttributeProvider>.IList dependencies, TypeInfo recognizerType ) : void