summaryrefslogtreecommitdiff
path: root/src/plugins/css
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-23 15:47:59 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-01-23 15:47:59 +0100
commit18d3637ca02ab69f1ee744fa94c43c243de0f571 (patch)
tree42c859f014ab7dbb7d31a747e0ef3839c77c60fa /src/plugins/css
parent85d72823ef18711fe7a29f5b23cc37b318766332 (diff)
parentaa817d3bfd90aa39b6fd8a915bc78a8bb210cd3d (diff)
Merge branch 'master' of somweyr.de:ousia
Diffstat (limited to 'src/plugins/css')
-rw-r--r--src/plugins/css/CSSParser.cpp8
-rw-r--r--src/plugins/css/CSSParser.hpp20
2 files changed, 6 insertions, 22 deletions
diff --git a/src/plugins/css/CSSParser.cpp b/src/plugins/css/CSSParser.cpp
index 40486cc..8cb41ea 100644
--- a/src/plugins/css/CSSParser.cpp
+++ b/src/plugins/css/CSSParser.cpp
@@ -19,10 +19,9 @@
#include "CSSParser.hpp"
#include <core/common/VariantReader.hpp>
+#include <core/parser/ParserContext.hpp>
namespace ousia {
-namespace parser {
-namespace css {
// CSS code tokens
static const int CURLY_OPEN = 1;
@@ -75,7 +74,7 @@ static const std::map<int, CodeTokenDescriptor> CSS_DESCRIPTORS = {
{ESCAPE, {CodeTokenMode::ESCAPE, ESCAPE}},
{LINEBREAK, {CodeTokenMode::LINEBREAK, LINEBREAK}}};
-Rooted<Node> CSSParser::parse(CharReader &reader, ParserContext &ctx)
+Rooted<Node> CSSParser::doParse(CharReader &reader, ParserContext &ctx)
{
CodeTokenizer tokenizer{reader, CSS_ROOT, CSS_DESCRIPTORS};
tokenizer.ignoreComments = true;
@@ -362,5 +361,4 @@ bool CSSParser::expect(int expectedType, CodeTokenizer &tokenizer, Token &t,
return true;
}
}
-}
-}
+
diff --git a/src/plugins/css/CSSParser.hpp b/src/plugins/css/CSSParser.hpp
index 1ec54f5..c6594f6 100644
--- a/src/plugins/css/CSSParser.hpp
+++ b/src/plugins/css/CSSParser.hpp
@@ -24,6 +24,7 @@
*
* @author Benjamin Paassen - bpaassen@techfak.uni-bielefeld.de
*/
+
#ifndef _OUSIA_CSS_PARSER_HPP_
#define _OUSIA_CSS_PARSER_HPP_
@@ -36,8 +37,6 @@
#include <core/parser/Parser.hpp>
namespace ousia {
-namespace parser {
-namespace css {
/**
* This is a context free, recursive parser for a subset of the CSS3 language
@@ -139,7 +138,7 @@ private:
bool expect(int expectedType, CodeTokenizer &tokenizer, Token &t,
bool force, ParserContext &ctx);
-public:
+protected:
/**
* This parses the given input as CSS content as specified by the grammar
* seen above. The return value is a Rooted reference to the root of the
@@ -157,21 +156,8 @@ public:
* @return returns the root node of the resulting SelectorTree. For more
* information on the return conventions consult the Parser.hpp.
*/
- Rooted<Node> parse(CharReader &reader, ParserContext &ctx) override;
-
- using Parser::parse;
-
- /**
- * As befits a class called CSSParser, this Parser parses CSS.
- */
- std::set<std::string> mimetypes()
- {
- std::set<std::string> out{"text/css"};
- return out;
- }
+ Rooted<Node> doParse(CharReader &reader, ParserContext &ctx) override;
};
}
-}
-}
#endif