Esempio n. 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);
        }
Esempio n. 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());
        }
Esempio n. 3
0
 public static string[] GetExtensions(LanguageFlags languages)
 {
     return(languages.GetLanguages().SelectMany(lang => GetExtensions(lang)).ToArray());
 }