public void AddAndThrow(GrammarErrorLevel level, ParserState state, string message, params object[] args) { Add(level, state, message, args); var error = this[this.Count - 1]; var exc = new GrammarErrorException(error.Message, error); throw exc; }
public void Add(GrammarErrorLevel level, ParserState state, string message, params object[] args) { if (args != null && args.Length > 0) { message = String.Format(message, args); } base.Add(new GrammarError(level, state, message)); }
public static void ThrowGrammarErrorException(GrammarErrorLevel grammarErrorLevel, string message) { throw new GrammarErrorException(message, new GrammarError(grammarErrorLevel, null, message)); }
public readonly ParserState State; //can be null! public GrammarError(GrammarErrorLevel level, ParserState state, string message) { Level = level; State = state; Message = message; }
public static void ThrowGrammarErrorException(GrammarErrorLevel grammarErrorLevel, string format, params object[] args) { ThrowGrammarErrorException(grammarErrorLevel, string.Format(format, args)); }