summaryrefslogtreecommitdiff
path: root/src/core/parser
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-15 02:17:54 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-15 02:17:54 +0100
commit87942146e4d45c337cb76bc69b6f8be3cfae0601 (patch)
tree13bfdf22d684436daafe4a539224ae3fddb08c48 /src/core/parser
parentdfd02a6269870c0a2e4ac0549bc9cb07bf0ff104 (diff)
allow to retrieve writeable refrence to ParserContext
Diffstat (limited to 'src/core/parser')
-rw-r--r--src/core/parser/ParserStack.hpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/parser/ParserStack.hpp b/src/core/parser/ParserStack.hpp
index 7602139..d9de39e 100644
--- a/src/core/parser/ParserStack.hpp
+++ b/src/core/parser/ParserStack.hpp
@@ -260,7 +260,7 @@ private:
/**
* Reference at the parser context.
*/
- const ParserContext &ctx;
+ ParserContext &ctx;
/**
* User specified data that will be passed to all handlers.
@@ -293,10 +293,11 @@ public:
/**
* Creates a new instance of the ParserStack class.
*
+ * @param ctx is the parser context the parser stack is working on.
* @param handlers is a map containing the command names and the
* corresponding HandlerDescriptor instances.
*/
- ParserStack(const ParserContext &ctx,
+ ParserStack(ParserContext &ctx,
const std::multimap<std::string, HandlerDescriptor> &handlers)
: ctx(ctx), handlers(handlers){};
@@ -362,6 +363,14 @@ public:
* depends on the format that is being parsed).
*/
void data(const std::string &data, int field = 0);
+
+ /**
+ * Returns a reference to the parser context the parser stack is currently
+ * working on.
+ *
+ * @return a reference to the parser context.
+ */
+ ParserContext& getContext() {return ctx;}
};
}
}