From 22c9d5b5504c81902ccbfae386cf69351d7d0209 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 15 Feb 2015 00:14:12 +0100 Subject: Commented out Callbacks in Handler, this is not implemented yet --- src/core/parser/stack/Handler.hpp | 41 ++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) (limited to 'src/core/parser/stack/Handler.hpp') diff --git a/src/core/parser/stack/Handler.hpp b/src/core/parser/stack/Handler.hpp index 8c3d8c4..eeaf555 100644 --- a/src/core/parser/stack/Handler.hpp +++ b/src/core/parser/stack/Handler.hpp @@ -23,10 +23,12 @@ #include #include +#include namespace ousia { // Forward declarations +class ParserScope; class ParserContext; class Logger; @@ -53,7 +55,7 @@ public: * modifying the behaviour of the parser (like registering tokens, setting * the data type or changing the whitespace handling mode). */ - Callbacks &callbacks; + // Callbacks &callbacks; /** * Contains the name of the command that is being handled. @@ -80,7 +82,8 @@ public: * @param state is the state this handler was called for. * @param location is the location at which the handler is created. */ - HandlerData(ParserContext &ctx, Callbacks &callbacks, std::string name, + HandlerData(ParserContext &ctx, + /*Callbacks &callbacks,*/ const std::string &name, const State &state, const SourceLocation &location); }; @@ -96,6 +99,12 @@ private: */ const HandlerData handlerData; + /** + * Reference at the current logger. If not nullptr, this will override the + * logger from the ParserContext specified in the handlerData. + */ + Logger *internalLogger; + protected: /** * Constructor of the Handler class. @@ -135,11 +144,12 @@ protected: Logger &logger(); /** - * Returns the current location in the source file. + * Returns the location of the element in the source file, for which this + * Handler was created. * - * @return the current location in the source file. + * @return the location of the Handler in the source file. */ - SourceLocation location(); + const SourceLocation &location() const; public: /** @@ -190,6 +200,27 @@ public: */ const State &getState() const; + /** + * Sets the internal logger to the given logger instance. + * + * @param logger is the Logger instance to which the logger should be set. + */ + void setLogger(Logger &logger); + + /** + * Resets the logger instance to the logger instance provided in the + * ParserContext. + */ + void resetLogger(); + + /** + * Returns the location of the element in the source file, for which this + * Handler was created. + * + * @return the location of the Handler in the source file. + */ + const SourceLocation &getLocation() const; + /** * Called when the command that was specified in the constructor is * instanciated. -- cgit v1.2.3