54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
#ifndef PARSEREXCEPTIONS_H_
|
|
#define PARSEREXCEPTIONS_H_
|
|
|
|
//#include <exception>
|
|
#include <stdexcept>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace bts {
|
|
namespace expression {
|
|
|
|
struct ParserException : public std::logic_error {
|
|
ParserException(const char *what);
|
|
ParserException(const std::string &what);
|
|
ParserException(const ParserException &other);
|
|
ParserException &operator=(const ParserException &other);
|
|
virtual ~ParserException() throw();
|
|
|
|
const char *what() const throw();
|
|
|
|
protected:
|
|
std::string _what;
|
|
};
|
|
|
|
struct ParseFailedException : public ParserException {
|
|
ParseFailedException(const std::string &context, size_t at);
|
|
~ParseFailedException() throw() {}
|
|
std::string context;
|
|
};
|
|
|
|
struct InvalidPropertyException : public ParserException {
|
|
InvalidPropertyException(const std::string &prop_name);
|
|
~InvalidPropertyException() throw() {}
|
|
};
|
|
|
|
struct InsuficientArgumentsException : public ParserException {
|
|
InsuficientArgumentsException(
|
|
const std::string &oper, const std::string &expression, size_t expected);
|
|
~InsuficientArgumentsException() throw() {}
|
|
|
|
size_t expected_argument_count;
|
|
std::string expression;
|
|
};
|
|
|
|
struct RecursivePropertyGetException : public ParserException {
|
|
RecursivePropertyGetException(
|
|
const std::string &property, const std::vector<std::string> &stack);
|
|
~RecursivePropertyGetException() throw() {}
|
|
};
|
|
|
|
} // namespace expression
|
|
} // namespace bts
|
|
#endif
|