aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/cru/parse/Grammar.hpp0
-rw-r--r--include/cru/parse/Nonterminal.hpp0
-rw-r--r--include/cru/parse/Production.hpp0
-rw-r--r--include/cru/parse/Symbol.hpp0
-rw-r--r--include/cru/parse/Terminal.hpp0
-rw-r--r--include/cru/parse/Token.hpp0
-rw-r--r--include/cru/parse/TokenType.hpp22
-rw-r--r--src/parse/CMakeLists.txt10
-rw-r--r--src/parse/Grammar.cpp0
-rw-r--r--src/parse/Nonterminal.cpp0
-rw-r--r--src/parse/Production.cpp0
-rw-r--r--src/parse/Symbol.cpp0
-rw-r--r--src/parse/Terminal.cpp0
-rw-r--r--src/parse/Token.cpp0
-rw-r--r--src/parse/TokenType.cpp5
15 files changed, 37 insertions, 0 deletions
diff --git a/include/cru/parse/Grammar.hpp b/include/cru/parse/Grammar.hpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/include/cru/parse/Grammar.hpp
diff --git a/include/cru/parse/Nonterminal.hpp b/include/cru/parse/Nonterminal.hpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/include/cru/parse/Nonterminal.hpp
diff --git a/include/cru/parse/Production.hpp b/include/cru/parse/Production.hpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/include/cru/parse/Production.hpp
diff --git a/include/cru/parse/Symbol.hpp b/include/cru/parse/Symbol.hpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/include/cru/parse/Symbol.hpp
diff --git a/include/cru/parse/Terminal.hpp b/include/cru/parse/Terminal.hpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/include/cru/parse/Terminal.hpp
diff --git a/include/cru/parse/Token.hpp b/include/cru/parse/Token.hpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/include/cru/parse/Token.hpp
diff --git a/include/cru/parse/TokenType.hpp b/include/cru/parse/TokenType.hpp
new file mode 100644
index 00000000..54bdf712
--- /dev/null
+++ b/include/cru/parse/TokenType.hpp
@@ -0,0 +1,22 @@
+#pragma once
+#include "cru/common/Base.hpp"
+#include "cru/common/String.hpp"
+
+namespace cru::parse {
+class TokenType : public Object {
+ public:
+ explicit TokenType(String name);
+
+ CRU_DELETE_COPY(TokenType)
+ CRU_DELETE_MOVE(TokenType)
+
+ ~TokenType() override;
+
+ public:
+ String GetName() const { return name_; }
+ void SetName(String name) { name_ = std::move(name); }
+
+ private:
+ String name_;
+};
+} // namespace cru::parse
diff --git a/src/parse/CMakeLists.txt b/src/parse/CMakeLists.txt
index e69de29b..de096c08 100644
--- a/src/parse/CMakeLists.txt
+++ b/src/parse/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_library(cru_parse SHARED
+ Grammar.cpp
+ Nonterminal.cpp
+ Production.cpp
+ Symbol.cpp
+ Terminal.cpp
+ Token.cpp
+ TokenType.cpp
+)
+target_link_libraries(cru_parse PUBLIC cru_common)
diff --git a/src/parse/Grammar.cpp b/src/parse/Grammar.cpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/parse/Grammar.cpp
diff --git a/src/parse/Nonterminal.cpp b/src/parse/Nonterminal.cpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/parse/Nonterminal.cpp
diff --git a/src/parse/Production.cpp b/src/parse/Production.cpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/parse/Production.cpp
diff --git a/src/parse/Symbol.cpp b/src/parse/Symbol.cpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/parse/Symbol.cpp
diff --git a/src/parse/Terminal.cpp b/src/parse/Terminal.cpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/parse/Terminal.cpp
diff --git a/src/parse/Token.cpp b/src/parse/Token.cpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/parse/Token.cpp
diff --git a/src/parse/TokenType.cpp b/src/parse/TokenType.cpp
new file mode 100644
index 00000000..2819a4de
--- /dev/null
+++ b/src/parse/TokenType.cpp
@@ -0,0 +1,5 @@
+#include "cru/parse/TokenType.hpp"
+
+namespace cru::parse {
+TokenType::TokenType(String name) : name_(std::move(name)) {}
+} // namespace cru::parse