public BuildMessage(string message)
: this(TraceLevel.Error, message, null, 0, 0)
{
try
{
Match match = BuildMessageFormat.Match(message);
if (match.Success)
{
FileName = match.Groups["FILE"].Length > 0 ? match.Groups["FILE"].Value : "";
LineNumber = match.Groups["LINE"].Length > 0 ? int.Parse(match.Groups["LINE"].Value) : 0;
ColumnNumber = match.Groups["COLUMN"].Length > 0 ? int.Parse(match.Groups["COLUMN"].Value) + 1 : 0;
switch (match.Groups["SEVERITY"].Value)
{
case "warning":
Severity = TraceLevel.Warning;
break;
case "error":
Severity = TraceLevel.Error;
break;
default:
Severity = TraceLevel.Info;
break;
}
int code = int.Parse(match.Groups["CODE"].Value);
Message = string.Format("AC{0:0000}: {1}", code, match.Groups["MESSAGE"].Value);
}
else
{
Message = message;
}
}
catch (Exception ex)
{
if (Antlr4ClassGenerationTask.IsFatalException(ex))
throw;
}
}