修正并完善代码;
This commit is contained in:
parent
f7355e63e2
commit
da2a2f7cc8
10
main.cpp
10
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user