diff options
Diffstat (limited to 'include/exceptions.hpp')
-rw-r--r-- | include/exceptions.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/exceptions.hpp b/include/exceptions.hpp new file mode 100644 index 0000000..0469784 --- /dev/null +++ b/include/exceptions.hpp @@ -0,0 +1,23 @@ +#include <string> +#ifndef EXCEPTIONS_H +#define EXCEPTIONS_H + +class Exception{ +private: + std::string error_msg; +public: + Exception(const std::string &error_msg); + std::string showMsg(); +}; + +class LexerException: public Exception{ +public: + LexerException(const std::string &error_msg): Exception(error_msg){} +}; + +class ParserException: public Exception{ +public: + ParserException(const std::string &error_msg): Exception(error_msg){} +}; + +#endif /* EXCEPTIONS_H */ |