2
using System.Collections.Generic;
8
public class ParserException : Exception
10
private const string errorMessageInvalidSymbol =
11
"Expected one of the following symbol kinds: {0}.";
13
public ParserException(Token tokenRead, ICollection<SymbolKind> expectedSymbolKinds)
14
: this(tokenRead, string.Format(errorMessageInvalidSymbol,
15
string.Join(", ", expectedSymbolKinds.Select(tokenKind => tokenKind.ToString()).ToArray())))
19
public ParserException(Token tokenRead, string message)
20
: base(message + Environment.NewLine + string.Format("Token read: {0}", tokenRead))
22
this.TokenRead = tokenRead;
25
public Token TokenRead