aboutsummaryrefslogtreecommitdiff
path: root/include/cru/parse
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-12-14 21:34:59 +0800
committercrupest <crupest@outlook.com>2021-12-14 21:34:59 +0800
commitfa3794469430b4ddfe0b0ca62850e9911c99b558 (patch)
tree2cd038280f9fa21ae5c64b82730624d801208292 /include/cru/parse
parent72abeb9c86d768a5c6a9a2d28dab037b145b7390 (diff)
downloadcru-fa3794469430b4ddfe0b0ca62850e9911c99b558.tar.gz
cru-fa3794469430b4ddfe0b0ca62850e9911c99b558.tar.bz2
cru-fa3794469430b4ddfe0b0ca62850e9911c99b558.zip
...
Diffstat (limited to 'include/cru/parse')
-rw-r--r--include/cru/parse/Grammar.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/cru/parse/Grammar.hpp b/include/cru/parse/Grammar.hpp
index 659c4302..606fcc33 100644
--- a/include/cru/parse/Grammar.hpp
+++ b/include/cru/parse/Grammar.hpp
@@ -49,8 +49,11 @@ class Grammar : public Object {
// Algorithm 4.21
void LeftFactor();
+ public:
+ String ProductionsToString() const;
+
private:
- Nonterminal* start_symbol_;
+ Nonterminal* start_symbol_ = nullptr;
std::vector<Terminal*> terminals_;
std::vector<Nonterminal*> nonterminals_;
std::vector<Symbol*> symbols_;