Пример #1
0
        // Group: Functions
        // __________________________________________________________________________


        /* Constructor: TextFileParser
         */
        public TextFileParser()
        {
            yesRegex   = new Regex.Config.Yes();
            noRegex    = new Regex.Config.No();
            startRegex = new Regex.CommentTypes.ScopeStart();
            endRegex   = new Regex.CommentTypes.ScopeEnd();

            nonASCIILettersRegex = new Regex.NonASCIILetters();

            ignoreKeywordsRegex              = new Regex.CommentTypes.IgnoreKeywords();
            commentTypeRegex                 = new Regex.CommentTypes.CommentType();
            alterCommentTypeRegex            = new Regex.CommentTypes.AlterCommentType();
            displayNameRegex                 = new Regex.CommentTypes.DisplayName();
            pluralDisplayNameRegex           = new Regex.CommentTypes.PluralDisplayName();
            displayNameFromLocaleRegex       = new Regex.CommentTypes.DisplayNameFromLocale();
            pluralDisplayNameFromLocaleRegex = new Regex.CommentTypes.PluralDisplayNameFromLocale();
            flagsRegex             = new Regex.CommentTypes.Flags();
            documentationRegex     = new Regex.CommentTypes.Documentation();
            variableTypeRegex      = new Regex.CommentTypes.VariableType();
            classHierarchyRegex    = new Regex.CommentTypes.ClassHierarchy();
            databaseHierarchyRegex = new Regex.CommentTypes.DatabaseHierarchy();
            enumRegex       = new Regex.CommentTypes.Enum();
            breakListsRegex = new Regex.CommentTypes.BreakLists();
            keywordsRegex   = new Regex.CommentTypes.Keywords();
            languageSpecificKeywordsRegex = new Regex.CommentTypes.LanguageSpecificKeywords();
            commaSeparatorRegex           = new Regex.CondensedWhitespaceCommaSeparator();
            alwaysGlobalRegex             = new Regex.CommentTypes.ScopeAlwaysGlobal();
            tagsRegex = new Regex.CommentTypes.Tags();
        }
Пример #2
0
        /* Function: OnlyAToZ
         * Converts the passed string to a version that only contains the letters A to Z.  All other characters are stripped or
         * replaced with related characters.  If there are no ASCII characters available it returns null.
         */
        public static string OnlyAToZ(this string input)
        {
            // Use a compatibility decomposition to increase the chances of finding ASCII letters.  Hopefully some accented
            // Latin characters will be separated into ASCII characters and combining characters.
            string result = input.Normalize(System.Text.NormalizationForm.FormKD);

            Regex.NonASCIILetters nonASCIILettersRegex = new Regex.NonASCIILetters();
            result = nonASCIILettersRegex.Replace(result, "");

            if (String.IsNullOrEmpty(result))
            {
                result = null;
            }

            return(result);
        }
Пример #3
0
        // Group: Functions
        // __________________________________________________________________________


        /* Constructor: Languages_txt
         */
        public Languages_txt()
        {
            yesRegex = new Regex.Config.Yes();
            noRegex  = new Regex.Config.No();

            nonASCIILettersRegex = new Regex.NonASCIILetters();

            addReplaceAliasesRegex        = new Regex.Languages.AddReplaceAliases();
            addReplaceExtensionsRegex     = new Regex.Languages.AddReplaceExtensions();
            addReplaceShebangStringsRegex = new Regex.Languages.AddReplaceShebangStrings();
            aliasesRegex          = new Regex.Languages.Aliases();
            alterLanguageRegex    = new Regex.Languages.AlterLanguage();
            blockCommentsRegex    = new Regex.Languages.BlockComments();
            enumValuesRegex       = new Regex.Languages.EnumValues();
            extensionsRegex       = new Regex.Languages.Extensions();
            ignorePrefixesRegex   = new Regex.Languages.IgnorePrefixes();
            ignoreExtensionsRegex = new Regex.Languages.IgnoreExtensions();
            lineCommentsRegex     = new Regex.Languages.LineComments();
            prototypeEndersRegex  = new Regex.Languages.PrototypeEnders();
            shebangStringsRegex   = new Regex.Languages.ShebangStrings();
            memberOperatorRegex   = new Regex.Languages.MemberOperator();
            caseSensitiveRegex    = new Regex.Languages.CaseSensitive();
        }