From e921e0965257e69221e67070d7eadd8a2aeaae76 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Wed, 1 Apr 2015 00:10:04 +0200 Subject: First implementation of user defined syntax, many features still missing and probably many bugs * Implement startToken and endToken in DocumentChildHandler * Implement pushScopeToken, which pushes tokens for the element that is currently on top of the Scope stack onto the token stack * Implement rollbackPath() method (was really needed once in the development process, but only used in one place for now) * Push and pop tokens from stack whenever a new explicit field or command is created/ended. Take advantage of the fact, that the tokens for transparent structures are always included in the token list * Remember pending close tokens in the HandlerInfo structure in StackImpl * Implement handleToken() in StackImpl * Implement readToken() method used by readData() and data() in StackImpl * Check whether there still is data available in handleData() * Plus many more changes in the affected files... --- src/core/parser/stack/DocumentHandler.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/core/parser/stack/DocumentHandler.hpp') diff --git a/src/core/parser/stack/DocumentHandler.hpp b/src/core/parser/stack/DocumentHandler.hpp index 5157709..0a32267 100644 --- a/src/core/parser/stack/DocumentHandler.hpp +++ b/src/core/parser/stack/DocumentHandler.hpp @@ -158,6 +158,12 @@ private: void createPath(const size_t &fieldIdx, const NodeVector &path, DocumentEntity *&parent); + /** + * Removes the transparent elements created by the createPath() method from + * the Scope. + */ + void rollbackPath(); + /** * Tries to convert the given data to the type that is specified in the * given primitive field. @@ -173,6 +179,17 @@ private: bool convertData(Handle field, Variant &data, Logger &logger); + /** + * Fetches the top-most non-transparent descriptor from the scope, gets the + * permitted tokens of this descriptor and filters them to those tokens + * which are actually possible, according to the current content of the + * ParserScope. + * + * @param fieldDescr is the field descriptor of which the tokens should be + * registered. + */ + void pushScopeTokens(); + /** * Pushes a new DocumentField onto the scope stack and registers all * premitted tokens in the parser. -- cgit v1.2.3