Пример #1
0
        private static void ParseFieldText(string fieldText, bool isReadOnly, out string fieldName, out string fieldType, out string defaultValue)
        {
            Match match = fieldRegex.Match(fieldText);

            if (!match.Success)
            {
                match = fieldRegexFallback.Match(fieldText);
            }
            if (!match.Success)
            {
                match = fieldRegexFallback2.Match(fieldText);
            }

            if (match.Success)
            {
                fieldName    = match.Groups["FLD"].Value;
                fieldType    = GeneratorHelper.DetermineFieldTypeFromDocumentation(match.Groups["TYPE"].Value, fieldName, isReadOnly);
                defaultValue = match.Groups["DEFAULT"].Value;
            }
            else
            {
                fieldName    = "Unknown";
                fieldType    = "UNKNOWN /*" + fieldText + "*/";
                defaultValue = null;
            }
        }