diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-03-01 13:52:34 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-03-01 13:52:34 +0100 |
commit | 4e199ad0d5c5d94955839da2a52967b4f0f34a43 (patch) | |
tree | 6571d7de3536911ad430ea0f9e1b0f05bb335d44 /src/formats/osml/OsmlStreamParser.hpp | |
parent | 31c83c05d257c9a7a336f12342c401f97d380674 (diff) |
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)
Diffstat (limited to 'src/formats/osml/OsmlStreamParser.hpp')
-rw-r--r-- | src/formats/osml/OsmlStreamParser.hpp | 11 |
1 files changed, 8 insertions, 3 deletions
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 <cstdint> #include <memory> +#include <core/parser/stack/Callbacks.hpp> + 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; }; } |