From 4e199ad0d5c5d94955839da2a52967b4f0f34a43 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 1 Mar 2015 13:52:34 +0100 Subject: Implemented registration of user-defined tokens, fixed comment handling (do not issue multiple data events if a comment occurs, just skip the comment data like in TeX) --- src/formats/osml/OsmlStreamParser.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/formats/osml/OsmlStreamParser.hpp') diff --git a/src/formats/osml/OsmlStreamParser.hpp b/src/formats/osml/OsmlStreamParser.hpp index 10d5296..b7e64f7 100644 --- a/src/formats/osml/OsmlStreamParser.hpp +++ b/src/formats/osml/OsmlStreamParser.hpp @@ -32,6 +32,8 @@ #include #include +#include + namespace ousia { // Forward declarations @@ -50,10 +52,10 @@ class Variant; * syntactically valid and tries to recorver from most errors. If an error is * irrecoverable (this is the case for errors with wrong nesting of commands or * fields, as this would lead to too many consecutive errors) a - * LoggableException is thrown. The OsmlStreamParser can be compared to a SAX - * parser for XML. + * LoggableException is thrown. In short, the OsmlStreamParser can be described + * as a SAX parser for OSML. */ -class OsmlStreamParser { +class OsmlStreamParser: public parser_stack::ParserCallbacks { public: /** * Enum used to indicate which state the OsmlStreamParser class is in @@ -204,6 +206,9 @@ public: * "{!" syntax). */ bool inDefaultField() const; + + TokenId registerToken(const std::string &token) override; + void unregisterToken(TokenId token) override; }; } -- cgit v1.2.3