Exemple #1
0
        public static Dictionary <Language, ParserConverterSet> GetParserConverterSets(LanguageFlags languageFlags)
        {
            var languages = new List <Language>();

            languages.AddRange(languageFlags.GetLanguages());
            languages.AddRange(languageFlags.GetImpactLanguages());
            Dictionary <Language, ParserConverterSet> result = new Dictionary <Language, ParserConverterSet>();

            foreach (var language in languages)
            {
                result[language] = GetParserConverterSet(language);
                result[language].Converter.ConvertedLanguages &= languageFlags;
            }
            return(result);
        }
Exemple #2
0
        public static Language[] GetImpactLanguages(this LanguageFlags value)
        {
            var languages = value.GetLanguages();
            var result    = new List <Language>();

            foreach (Language language in languages)
            {
                var impactLanguageInfo = LanguageInfos.FirstOrDefault(languageInfo => languageInfo.Value.DependentLanguages.Is(language));
                if (!impactLanguageInfo.Equals(default(KeyValuePair <Language, LanguageInfo>)))
                {
                    if (!result.Contains(impactLanguageInfo.Key))
                    {
                        result.Add(impactLanguageInfo.Key);
                    }
                }
            }

            return(result.ToArray());
        }
Exemple #3
0
 public static string[] GetExtensions(LanguageFlags languages)
 {
     return(languages.GetLanguages().SelectMany(lang => GetExtensions(lang)).ToArray());
 }