#ifndef GINAC_PARSER_HPP_
+#define GINAC_PARSER_HPP_
#include "parse_context.hpp"
#include <stdexcept>
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.
*/
{
return syms;
}
+ /// read/write access to the symbol table
+ symtab& get_syms()
+ {
+ return syms;
+ }
-private:
/// If true, throw an exception if an unknown symbol is encountered.
- const bool strict;
+ bool strict;
+private:
/**
* Function/ctor table, maps a prototype (which is a name and number
* arguments) to a C++ function. Used for parsing identifier_expr's