blob: b17f42412ad74d141fafe1c7a9c9307db8f40db2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#ifndef PARSER_SRC_EXCEPTIONS_H_
#define PARSER_SRC_EXCEPTIONS_H_
#include <exception>
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.";
}
};
class identifier_exception: public std::exception {
virtual const char* what() const throw()
{
return "Identifier could not be correctly resolved.";
}
};
}
#endif // PARSER_SRC_EXCEPTIONS_H_
|