修正并完善代码;
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" -> " ;
|
wcout << pool->getSymbol(p_pdt->left)->name << L" -> " ;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(const auto &symbol : p_pdt->right) {
|
for(const auto &symbol : p_pdt->right) {
|
||||||
if(i++ == dot_index) wcout << L'*';
|
if(i++ == dot_index) wcout << "·";
|
||||||
wcout << pool->getSymbol(symbol)->name;
|
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;
|
wcout << L',' << pool->getSymbol(item->get_terminator())->name << endl;
|
||||||
}
|
}
|
||||||
@ -924,8 +924,10 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(item->get_production()->left != pool->getStartSymbol()->index) {
|
if(pool->getSymbol(next_symbol)->terminator) {
|
||||||
this->add_action(ic->getIndex(), next_symbol, STATUTE, item->get_production());
|
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