protected void AddMatchedLine(System.Text.RegularExpressions.Match match, Int16 severity)
        {
            if (match.Success)
            {
                CILGenerationOutputItem item = new CILGenerationOutputItem()
                {
                    Severity = severity
                };

                if (!string.IsNullOrEmpty(match.Groups["message"].Value))
                {
                    item.Message = match.Groups["message"].Value;
                }
                else
                {
                    item.Message = match.Groups[0].Value;
                }

                item.ElementName = match.Groups["object"].Value;

                item.MethodName = match.Groups["method"].Value;

                if (!string.IsNullOrEmpty(match.Groups["linenum"].Value))
                {
                    item.LineNumber = Int32.Parse(match.Groups["linenum"].Value);
                }

                output.Add(item);
            }
        }
        public void Parse(string filename)
        {
            output = new List <CILGenerationOutputItem>();

            using (StreamReader fileReader = new StreamReader(filename))
            {
                while (!fileReader.EndOfStream)
                {
                    String line = fileReader.ReadLine();

                    if (!TestLine(line, knownErrorExpressions, 0))                 // Check for known errors
                    {
                        if (!TestLine(line, knownWarningExpressions, 1))           // Check for known warnings
                        {
                            if (!TestLine(line, genericErrorExpressions, 0))       // Try generic errors
                            {
                                if (!TestLine(line, genericWarningExpressions, 1)) // Try generic warnings
                                {
                                    // Otherwise add line as "other"
                                    CILGenerationOutputItem item = new CILGenerationOutputItem()
                                    {
                                        Severity = 4,
                                        Message  = line
                                    };

                                    output.Add(item);
                                }
                            }
                        }
                    }
                }
            }
        }