00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef JDLPARSER_UTILS_HPP_
00019 #define JDLPARSER_UTILS_HPP_
00020
00021 #include "defs.hpp"
00022
00023 namespace jdl{
00024
00025 class semantic_error: public logic_error{
00026 public:
00027 semantic_error(string message): logic_error(message), where(NULL){};
00028 semantic_error(string message, char const *end): logic_error(message), where(end){};
00029 char const *where;
00030 };
00031
00032 class parse_error: public logic_error{
00033 public:
00034 parse_error(string message_, int row_, int col_): logic_error(message_), row(row_), col(col_){}
00035 const int row;
00036 const int col;
00037 };
00038
00039 void indent(int n, ostream &out);
00040
00041 string open_file(string const& jdl_file);
00042
00043 std::pair<int, int> iter2RowCol(string const& str, string const& where);
00044
00045 }
00046
00047 #endif