summaryrefslogtreecommitdiff
path: root/src/core/parser
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-03-02 15:52:13 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-03-02 15:52:13 +0100
commit5d6ee07995c7f59e66e0df558c8ebe7d2a8d1f68 (patch)
tree4e52145bb12ba25082a4c149efaa7f8c24d51728 /src/core/parser
parent88afbcc2a4c4cb9956e4459cf1c5aa08e349835e (diff)
refactored SyntaxDescriptor to Token.hpp and added TokenDescriptor class.
Diffstat (limited to 'src/core/parser')
-rw-r--r--src/core/parser/stack/Callbacks.hpp3
-rw-r--r--src/core/parser/stack/Handler.cpp2
-rw-r--r--src/core/parser/stack/Handler.hpp3
-rw-r--r--src/core/parser/stack/TokenStack.cpp4
-rw-r--r--src/core/parser/stack/TokenStack.hpp5
5 files changed, 10 insertions, 7 deletions
diff --git a/src/core/parser/stack/Callbacks.hpp b/src/core/parser/stack/Callbacks.hpp
index d7b2547..e471881 100644
--- a/src/core/parser/stack/Callbacks.hpp
+++ b/src/core/parser/stack/Callbacks.hpp
@@ -34,6 +34,7 @@
#include <core/common/Whitespace.hpp>
#include <core/common/Token.hpp>
+#include <core/model/Syntax.hpp>
namespace ousia {
@@ -96,7 +97,7 @@ public:
* @param tokens is a list of TokenSyntaxDescriptor instances that should be
* stored on the stack.
*/
- void pushTokens(const std::vector<TokenSyntaxDescriptor> &tokens);
+ void pushTokens(const std::vector<SyntaxDescriptor> &tokens);
/**
* Removes the previously pushed list of tokens from the stack.
diff --git a/src/core/parser/stack/Handler.cpp b/src/core/parser/stack/Handler.cpp
index 734976a..12df0fd 100644
--- a/src/core/parser/stack/Handler.cpp
+++ b/src/core/parser/stack/Handler.cpp
@@ -74,7 +74,7 @@ Variant Handler::readData()
return handlerData.callbacks.readData();
}
-void Handler::pushTokens(const std::vector<TokenSyntaxDescriptor> &tokens)
+void Handler::pushTokens(const std::vector<SyntaxDescriptor> &tokens)
{
handlerData.callbacks.pushTokens(tokens);
}
diff --git a/src/core/parser/stack/Handler.hpp b/src/core/parser/stack/Handler.hpp
index 848d395..19660d0 100644
--- a/src/core/parser/stack/Handler.hpp
+++ b/src/core/parser/stack/Handler.hpp
@@ -24,6 +24,7 @@
#include <core/common/Location.hpp>
#include <core/common/Variant.hpp>
#include <core/common/Whitespace.hpp>
+#include <core/model/Syntax.hpp>
namespace ousia {
@@ -200,7 +201,7 @@ protected:
* @param tokens is a list of TokenSyntaxDescriptor instances that should be
* stored on the stack.
*/
- void pushTokens(const std::vector<TokenSyntaxDescriptor> &tokens);
+ void pushTokens(const std::vector<SyntaxDescriptor> &tokens);
/**
* Calls the corresponding function in the HandlerCallbacks instance.
diff --git a/src/core/parser/stack/TokenStack.cpp b/src/core/parser/stack/TokenStack.cpp
index 6afeaed..ac1d94e 100644
--- a/src/core/parser/stack/TokenStack.cpp
+++ b/src/core/parser/stack/TokenStack.cpp
@@ -21,7 +21,7 @@
namespace ousia {
namespace parser_stack {
-void TokenStack::pushTokens(const std::vector<TokenSyntaxDescriptor> &tokens)
+void TokenStack::pushTokens(const std::vector<SyntaxDescriptor> &tokens)
{
stack.push_back(tokens);
}
@@ -35,7 +35,7 @@ TokenSet TokenStack::tokens() const
}
TokenSet res;
- for (const TokenSyntaxDescriptor &descr : stack.back()) {
+ for (const SyntaxDescriptor &descr : stack.back()) {
descr.insertIntoTokenSet(res);
}
return res;
diff --git a/src/core/parser/stack/TokenStack.hpp b/src/core/parser/stack/TokenStack.hpp
index 9669f50..af734bb 100644
--- a/src/core/parser/stack/TokenStack.hpp
+++ b/src/core/parser/stack/TokenStack.hpp
@@ -32,6 +32,7 @@
#include <vector>
#include <core/common/Token.hpp>
+#include <core/model/Syntax.hpp>
namespace ousia {
namespace parser_stack {
@@ -52,7 +53,7 @@ private:
* Stack containing vectors of TokenSyntaxDescriptor instances as given by
* the user.
*/
- std::vector<std::vector<TokenSyntaxDescriptor>> stack;
+ std::vector<std::vector<SyntaxDescriptor>> stack;
/**
* Constructor of the TokenStack class.
@@ -86,7 +87,7 @@ public:
* @param tokens is a list of TokenSyntaxDescriptor instances that should be
* stored on the stack.
*/
- void pushTokens(const std::vector<TokenSyntaxDescriptor> &tokens);
+ void pushTokens(const std::vector<SyntaxDescriptor> &tokens);
/**
* Removes the previously pushed list of tokens from the stack.