|
@@ -79,11 +79,22 @@ public:
|
|
|
{}
|
|
|
};
|
|
|
|
|
|
+ /// \brief Exception thrown when we fail to read from the input
|
|
|
+ /// stream or file.
|
|
|
+ struct ReadError : public Unexpected {
|
|
|
+ ReadError(const char* file, size_t line, const char* what) :
|
|
|
+ Unexpected(file, line, what)
|
|
|
+ {}
|
|
|
+ };
|
|
|
+
|
|
|
/// \brief Returned by getChar() when end of stream is reached.
|
|
|
static const int END_OF_STREAM;
|
|
|
|
|
|
/// \brief Returns a single character from the input source. If end
|
|
|
/// of file is reached, \c END_OF_STREAM is returned.
|
|
|
+ ///
|
|
|
+ /// \throws ReadError when reading from the input stream or file
|
|
|
+ /// fails.
|
|
|
int getChar();
|
|
|
|
|
|
/// \brief Skips backward a single character in the input
|