From f3060db03f822573175e3d6bc1fa541217e16f65 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 12 Jun 2007 18:42:05 +0000 Subject: [PATCH] Add error.h Update svn:ignore --- source/error.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 source/error.h diff --git a/source/error.h b/source/error.h new file mode 100644 index 0000000..f8f7abd --- /dev/null +++ b/source/error.h @@ -0,0 +1,30 @@ +#ifndef MSP_PARSER_ERROR_H_ +#define MSP_PARSER_ERROR_H_ + +#include + +namespace Msp { +namespace Parser { + +class TypeError: public Exception +{ +public: + TypeError(const std::string &w_): Exception(w_) { } +}; + +class ParseError: public Exception +{ +public: + ParseError(const std::string &w_, const std::string &s, unsigned l): Exception(w_), source(s), line(l) { } + const std::string &get_source() const { return source; } + unsigned get_line() const { return line; } + ~ParseError() throw() { } +private: + std::string source; + unsigned line; +}; + +} // namespace Parser +} // namespace Msp + +#endif -- 2.43.0