From da2a2f7cc80f839df771724351594ff5e34d20e9 Mon Sep 17 00:00:00 2001 From: satunreric Date: Thu, 29 Apr 2021 21:46:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=B9=B6=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index e0b46bd..4f9c13d 100644 --- a/main.cpp +++ b/main.cpp @@ -628,11 +628,11 @@ public: wcout << pool->getSymbol(p_pdt->left)->name << L" -> " ; int i = 0; for(const auto &symbol : p_pdt->right) { - if(i++ == dot_index) wcout << L'*'; + if(i++ == dot_index) wcout << "·"; wcout << pool->getSymbol(symbol)->name; } - if(i++ == dot_index) wcout << L'*'; + if(i++ == dot_index) wcout << "·"; wcout << L',' << pool->getSymbol(item->get_terminator())->name << endl; } @@ -924,8 +924,10 @@ public: } } } else { - if(item->get_production()->left != pool->getStartSymbol()->index) { - this->add_action(ic->getIndex(), next_symbol, STATUTE, item->get_production()); + if(pool->getSymbol(next_symbol)->terminator) { + if (item->get_production()->left != pool->getStartSymbol()->index) { + this->add_action(ic->getIndex(), item->get_terminator(), STATUTE, item->get_production()); + } } } }