]> www.ginac.de Git - ginac.git/blobdiff - ginac/parser/parser.hpp
parser: improve error reporting a little bit.
[ginac.git] / ginac / parser / parser.hpp
index 81b7847694e43f1b437fbe1cdc8fef2b3503e420..3e10b8fc016bacc9a685918c969a89d36c451841 100644 (file)
@@ -9,6 +9,18 @@ namespace GiNaC
 
 class lexer;
 
+class parse_error : public std::invalid_argument
+{
+public:
+       const std::size_t line;
+       const std::size_t column;
+       parse_error(const std::string& what_,
+                   const std::size_t line_ = 0,
+                   const std::size_t column_ = 0) throw () :
+               std::invalid_argument(what_), line(line_), column(column_)
+       { }
+};
+
 /**
  * Recursive descent parser for GiNaC expressions.
  */