diff options
author | crupest <crupest@outlook.com> | 2021-09-09 22:20:55 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-09-09 22:20:55 +0800 |
commit | b1ae774594b46419879362735d4e25c4937c0a6c (patch) | |
tree | 8ef0d71d39a87e855c801585a2767e78c052c37b | |
parent | f4f7a0a795d55f104731d32d3d852ad3a715c7bf (diff) | |
download | cru-b1ae774594b46419879362735d4e25c4937c0a6c.tar.gz cru-b1ae774594b46419879362735d4e25c4937c0a6c.tar.bz2 cru-b1ae774594b46419879362735d4e25c4937c0a6c.zip |
...
-rw-r--r-- | include/cru/parse/Grammar.hpp | 0 | ||||
-rw-r--r-- | include/cru/parse/Nonterminal.hpp | 0 | ||||
-rw-r--r-- | include/cru/parse/Production.hpp | 0 | ||||
-rw-r--r-- | include/cru/parse/Symbol.hpp | 0 | ||||
-rw-r--r-- | include/cru/parse/Terminal.hpp | 0 | ||||
-rw-r--r-- | include/cru/parse/Token.hpp | 0 | ||||
-rw-r--r-- | include/cru/parse/TokenType.hpp | 22 | ||||
-rw-r--r-- | src/parse/CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/parse/Grammar.cpp | 0 | ||||
-rw-r--r-- | src/parse/Nonterminal.cpp | 0 | ||||
-rw-r--r-- | src/parse/Production.cpp | 0 | ||||
-rw-r--r-- | src/parse/Symbol.cpp | 0 | ||||
-rw-r--r-- | src/parse/Terminal.cpp | 0 | ||||
-rw-r--r-- | src/parse/Token.cpp | 0 | ||||
-rw-r--r-- | src/parse/TokenType.cpp | 5 |
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 |