diff --git a/include/Lexesis/driver.h b/include/Lexesis/driver.h index 6593801..766f39b 100644 --- a/include/Lexesis/driver.h +++ b/include/Lexesis/driver.h @@ -43,6 +43,19 @@ namespace lxs { std::string m_language; std::string m_lexername; }; + + /** + * Used to throw errors when the driver could generate a valid lexer name or find the backend for a language + */ + + class DriverException: public std::exception { + public: + DriverException(std::string what); + virtual const char* what() const throw(); + + private: + std::string m_what; + }; } #endif //LEXESIS_DRIVER_H diff --git a/include/Lexesis/inputparser.h b/include/Lexesis/inputparser.h index f9dbfda..35167e6 100644 --- a/include/Lexesis/inputparser.h +++ b/include/Lexesis/inputparser.h @@ -10,6 +10,7 @@ namespace lxs { struct DFA; struct ENFA; + /** * Used for parsing token rules */ @@ -30,6 +31,19 @@ namespace lxs { */ static std::vector linesToEnfa(std::vector > &input); }; + + /** + * Used to throw errors when the inputfile was not valid + */ + + class InputParserException: public std::exception { + public: + InputParserException(std::string what); + virtual const char* what() const throw(); + + private: + std::string m_what; + }; } #endif // INPUT_PARSER_H