+class parse_error: public runtime_error
+{
+public:
+ parse_error(const std::string &t):
+ runtime_error(t.empty() ? "at end of input" : format("after '%s'", t))
+ { }
+
+ virtual ~parse_error() throw() { }
+};
+
+
+class syntax_error: public runtime_error
+{
+public:
+ syntax_error(const std::string &t):
+ runtime_error(t.empty() ? "at end of input" : format("at '%s'", t))
+ { }
+
+ virtual ~syntax_error() throw() { }
+};
+
+