diff options
author | crupest <crupest@outlook.com> | 2022-02-08 16:53:51 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-08 16:53:51 +0800 |
commit | 74bb9cd27242b9320f99ff4d2b50c3051576cc14 (patch) | |
tree | 744bac5799c593d1d6f81e7b09581bea626f2cde /include/cru/parse/Production.hpp | |
parent | b90c398de829d1ba5329651d75bae82f5e4085fe (diff) | |
download | cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.tar.gz cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.tar.bz2 cru-74bb9cd27242b9320f99ff4d2b50c3051576cc14.zip |
...
Diffstat (limited to 'include/cru/parse/Production.hpp')
-rw-r--r-- | include/cru/parse/Production.hpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/include/cru/parse/Production.hpp b/include/cru/parse/Production.hpp deleted file mode 100644 index cb3c79c0..00000000 --- a/include/cru/parse/Production.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once -#include "cru/common/String.hpp" - -#include "Nonterminal.hpp" -#include "Terminal.hpp" - -#include <vector> - -namespace cru::parse { -class CRU_PARSE_API Production : public Object { - public: - Production(Grammar* grammar, String name, Nonterminal* left, - std::vector<Symbol*> right); - - CRU_DELETE_COPY(Production) - CRU_DELETE_MOVE(Production) - - ~Production() override; - - public: - Grammar* GetGrammar() const { return grammar_; } - - String GetName() const { return name_; } - void SetName(String name) { name_ = std::move(name); } - - Nonterminal* GetLeft() const { return left_; } - void SetLeft(Nonterminal* left); - - const std::vector<Symbol*>& GetRight() const { return right_; } - void SetRight(std::vector<Symbol*> right); - - bool IsLeftRecursion() const { - return !right_.empty() && left_ == right_.front(); - } - - private: - Grammar* grammar_; - String name_; - - Nonterminal* left_; - std::vector<Symbol*> right_; -}; -} // namespace cru::parse |