summaryrefslogtreecommitdiff
path: root/src/core/parser
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2014-12-05 12:18:02 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2014-12-05 12:18:02 +0100
commitd98fc013878ab28cb062a4f25a45199b9ee9574a (patch)
treedb0654002efbc005641771a57191ac65d1cb8912 /src/core/parser
parentf122527f6a080a099ecd64ec069e21331491f0dc (diff)
Made the CSSParser a valid subclass of Parser.
Diffstat (limited to 'src/core/parser')
-rw-r--r--src/core/parser/Parser.hpp14
-rw-r--r--src/core/parser/Scope.hpp7
2 files changed, 12 insertions, 9 deletions
diff --git a/src/core/parser/Parser.hpp b/src/core/parser/Parser.hpp
index fa5dd49..5dac956 100644
--- a/src/core/parser/Parser.hpp
+++ b/src/core/parser/Parser.hpp
@@ -70,6 +70,10 @@ struct ParserContext {
* Reference to the Logger the parser should log any messages to.
*/
Logger &logger;
+ /**
+ * Reference to the Manager the parser should append nodes to.
+ */
+ Manager &manager;
/**
* Constructor of the ParserContext class.
@@ -81,9 +85,12 @@ struct ParserContext {
* implementations.
* @param logger is a reference to the Logger instance that should be used
* to log error messages and warnings that occur while parsing the document.
+ * @param manager is a Reference to the Manager the parser should append
+ *nodes to.
*/
- ParserContext(Scope &scope, Registry &registry, Logger &logger)
- : scope(scope), registry(registry), logger(logger){};
+ ParserContext(Scope &scope, Registry &registry, Logger &logger,
+ Manager &manager)
+ : scope(scope), registry(registry), logger(logger), manager(manager){};
};
struct StandaloneParserContext : public ParserContext {
@@ -91,10 +98,11 @@ private:
Logger logger;
Scope scope;
Registry registry;
+ Manager manager;
public:
StandaloneParserContext()
- : ParserContext(scope, registry, logger),
+ : ParserContext(scope, registry, logger, manager),
scope(nullptr),
registry(logger){};
};
diff --git a/src/core/parser/Scope.hpp b/src/core/parser/Scope.hpp
index 9c5504f..5b19b3d 100644
--- a/src/core/parser/Scope.hpp
+++ b/src/core/parser/Scope.hpp
@@ -55,7 +55,7 @@ public:
* Creates a new ScopedScope instance.
*
* @param scope is the backing Scope instance.
- * @param node is the Node instance that should be poped onto the stack of
+ * @param node is the Node instance that should be pushed onto the stack of
* the Scope instance.
*/
ScopedScope(Scope *scope, Handle<Node> node);
@@ -108,11 +108,6 @@ public:
Scope(Handle<Node> rootNode) { nodes.push_back(rootNode); }
/**
- * Returns a reference at the Manager instance all nodes belong to.
- */
- Manager &getManager() { return getRoot()->getManager(); }
-
- /**
* Pushes a new node onto the scope.
*
* @param node is the node that should be used for local lookup.