From 5f2233fb632dc19678d0faac354857979b154f15 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Fri, 11 Jan 2013 21:30:53 +0100 Subject: Included previously missing exceptions header --- src/exceptions.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/exceptions.h (limited to 'src') diff --git a/src/exceptions.h b/src/exceptions.h new file mode 100644 index 0000000..cd76368 --- /dev/null +++ b/src/exceptions.h @@ -0,0 +1,29 @@ +#ifndef PARSER_SRC_EXCEPTIONS_H_ +#define PARSER_SRC_EXCEPTIONS_H_ + +#include + +namespace SimpleParser { + +class parenthese_exception: public std::exception { + virtual const char* what() const throw() { + return "Invalid parenthesized expression - check your input term."; + } +}; + +class operator_exception: public std::exception { + virtual const char* what() const throw() { + return "Unexpected operator placement - check your input term."; + } +}; + +class divide_exception: public std::exception { + virtual const char* what() const throw() + { + return "A divison through zero had to be prevented by the parser - check your input term."; + } +}; + +} + +#endif // PARSER_SRC_EXCEPTIONS_H_ -- cgit v1.2.3