예제 #1
0
        public static SpecializedCppError GetSpecializedCppError(CppError error)
        {
            //   error C2440: '=' : cannot convert from 'void *' to 'Parse *'
            //   error C2440: '=' : cannot convert from 'ExprList::ExprList_item *' to 'resolveCompoundOrderBy::ExprList_item *'
            //   error C2440: 'initializing' : cannot convert from 'void *' to 'FileChunk *'
            //   error C2664: 'int sqlite3VdbeAddOp4(Vdbe *,int,int,int,int,const char *,int)' : cannot convert argument 6 from 'void *' to 'const char *'
            Match  match = __cppErrorCode.Match(error.message);
            string code  = null;

            if (match.Success)
            {
                string function    = null;
                string argument    = null;
                string conversion  = null;
                string convertFrom = null;
                string convertTo   = null;
                code = match.Groups[1].Value;
                switch (code)
                {
                case "C2440":
                    match = __cppErrorC2440.Match(error.message);
                    if (match.Success)
                    {
                        conversion  = match.Groups[1].Value;
                        convertFrom = match.Groups[2].Value;
                        convertTo   = match.Groups[3].Value;
                    }
                    return(new SpecializedCppError_C2440 {
                        error = error, code = code, conversion = conversion, convertFrom = convertFrom, convertTo = convertTo
                    });

                case "C2664":
                    match = __cppErrorC2664Function.Match(error.message);
                    if (match.Success)
                    {
                        function = match.Groups[1].Value;
                    }
                    match = __cppErrorC2664ArgumentConvertFromTo.Match(error.message);
                    if (match.Success)
                    {
                        argument    = match.Groups[1].Value;
                        convertFrom = match.Groups[2].Value;
                        convertTo   = match.Groups[3].Value;
                    }
                    return(new SpecializedCppError_C2664 {
                        error = error, code = code, function = function, argument = argument, convertFrom = convertFrom, convertTo = convertTo
                    });
                }
            }
            return(new SpecializedCppError {
                error = error, code = code
            });
        }
예제 #2
0
        public static CppError GetCppError(string line)
        {
            CppError error = new CppError();

            string[] values = line.Split('\t');
            int      l      = values.Length;
            int      i      = 0;

            if (l > i && values[i++] == "Error")
            {
                error.error = true;
            }
            if (l > i)
            {
                int j;
                if (int.TryParse(values[i++], out j))
                {
                    error.index = j;
                }
            }
            if (l > i)
            {
                error.message = values[i++];
            }
            if (l > i)
            {
                error.source = values[i++];
            }
            if (l > i)
            {
                int j;
                if (int.TryParse(values[i++], out j))
                {
                    error.line = j;
                }
            }
            if (l > i)
            {
                int j;
                if (int.TryParse(values[i++], out j))
                {
                    error.column = j;
                }
            }
            if (l > i)
            {
                error.project = values[i++];
            }
            return(error);
        }
예제 #3
0
 public static CppError GetCppError(string line)
 {
     CppError error = new CppError();
     string[] values = line.Split('\t');
     int l = values.Length;
     int i = 0;
     if (l > i && values[i++] == "Error")
         error.error = true;
     if (l > i)
     {
         int j;
         if (int.TryParse(values[i++], out j))
             error.index = j;
     }
     if (l > i)
         error.message = values[i++];
     if (l > i)
         error.source = values[i++];
     if (l > i)
     {
         int j;
         if (int.TryParse(values[i++], out j))
             error.line = j;
     }
     if (l > i)
     {
         int j;
         if (int.TryParse(values[i++], out j))
             error.column = j;
     }
     if (l > i)
         error.project = values[i++];
     return error;
 }
예제 #4
0
        public static SpecializedCppError GetSpecializedCppError(CppError error)
        {
            //   error C2440: '=' : cannot convert from 'void *' to 'Parse *'
            //   error C2440: '=' : cannot convert from 'ExprList::ExprList_item *' to 'resolveCompoundOrderBy::ExprList_item *'
            //   error C2440: 'initializing' : cannot convert from 'void *' to 'FileChunk *'
            //   error C2664: 'int sqlite3VdbeAddOp4(Vdbe *,int,int,int,int,const char *,int)' : cannot convert argument 6 from 'void *' to 'const char *'
            Match match = __cppErrorCode.Match(error.message);
            string code = null;
            if (match.Success)
            {
                string function = null;
                string argument = null;
                string conversion = null;
                string convertFrom = null;
                string convertTo = null;
                code = match.Groups[1].Value;
                switch (code)
                {
                    case "C2440":
                        match = __cppErrorC2440.Match(error.message);
                        if (match.Success)
                        {
                            conversion = match.Groups[1].Value;
                            convertFrom = match.Groups[2].Value;
                            convertTo = match.Groups[3].Value;
                        }
                        return new SpecializedCppError_C2440 { error = error, code = code, conversion = conversion, convertFrom = convertFrom, convertTo = convertTo };
                    case "C2664":
                        match = __cppErrorC2664Function.Match(error.message);
                        if (match.Success)
                            function = match.Groups[1].Value;
                        match = __cppErrorC2664ArgumentConvertFromTo.Match(error.message);
                        if (match.Success)
                        {
                            argument = match.Groups[1].Value;
                            convertFrom = match.Groups[2].Value;
                            convertTo = match.Groups[3].Value;
                        }
                        return new SpecializedCppError_C2664 { error = error, code = code, function = function, argument = argument, convertFrom = convertFrom, convertTo = convertTo };
                }

            }
            return new SpecializedCppError { error = error, code = code };
        }