public void CheckType(TokenType token) { if (Type == TokenType.Error) throw Error; if (Type != token) throw new LexerException(LexerException.Codes.TokenExpected, Enum.GetName(typeof(TokenType), token)); }