public void AddParserMessage(ParserErrorLevel level, SourceLocation location, string message, params object[] args) {
if (CurrentParseTree == null) return;
if (CurrentParseTree.ParserMessages.Count >= MaxErrors) return;
if (args != null && args.Length > 0)
message = string.Format(message, args);
CurrentParseTree.ParserMessages.Add(new ParserMessage(level, location, message, CurrentParserState));
if (OptionIsSet(ParseOptions.TraceParser))
ParserTrace.Add( new ParserTraceEntry(CurrentParserState, ParserStack.Top, CurrentParserInput, message, true));
}