summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-02-02 02:00:36 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-02-02 02:00:36 +0100
commitc4b221e8b318fa612e8afcca59011f7b5e41b4bc (patch)
tree53e61850faf600502ea07c7216a725e3bf13ba23 /src
parentcbeffc5776c93a1b6380d9edfda231c8482f71f5 (diff)
Added function giving Handlers access to the ParserContext (for import, include)
Diffstat (limited to 'src')
-rw-r--r--src/core/parser/ParserStack.hpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/core/parser/ParserStack.hpp b/src/core/parser/ParserStack.hpp
index 9bb080e..7ad3da1 100644
--- a/src/core/parser/ParserStack.hpp
+++ b/src/core/parser/ParserStack.hpp
@@ -55,7 +55,7 @@ struct HandlerData {
* Reference to the ParserContext instance that should be used to resolve
* references to nodes in the Graph.
*/
- const ParserContext &ctx;
+ ParserContext &ctx;
/**
* Contains the name of the tag that is being handled.
@@ -86,8 +86,9 @@ struct HandlerData {
* @param parentState is the state of the parent command.
* @param location is the location at which the handler is created.
*/
- HandlerData(const ParserContext &ctx, std::string name, const ParserState &state,
- const ParserState &parentState, const SourceLocation location)
+ HandlerData(ParserContext &ctx, std::string name,
+ const ParserState &state, const ParserState &parentState,
+ const SourceLocation location)
: ctx(ctx),
name(std::move(name)),
state(state),
@@ -122,6 +123,13 @@ public:
virtual ~Handler(){};
/**
+ * Returns a reference at the ParserContext.
+ *
+ * @return a reference at the ParserContext.
+ */
+ ParserContext &context() { return handlerData.ctx; }
+
+ /**
* Returns the command name for which the handler was created.
*
* @return a const reference at the command name.
@@ -260,7 +268,7 @@ public:
* corresponding ParserState instances.
*/
ParserStack(ParserContext &ctx,
- const std::multimap<std::string, const ParserState*> &states);
+ const std::multimap<std::string, const ParserState *> &states);
/**
* Returns the state the ParserStack instance currently is in.