mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
LR0: Renamed ::expand to ::getClosure
This commit is contained in:
parent
a0d9df5edd
commit
40b7357b71
2 changed files with 3 additions and 3 deletions
|
@ -75,7 +75,7 @@ void LR0::initialize (const Grammar& grammar)
|
||||||
Closure items;
|
Closure items;
|
||||||
items.push_back (item0);
|
items.push_back (item0);
|
||||||
for (auto& expected : getExpectedSymbols (items))
|
for (auto& expected : getExpectedSymbols (items))
|
||||||
for (auto& item : expand (expected))
|
for (auto& item : getClosure (expected))
|
||||||
items.push_back (item);
|
items.push_back (item);
|
||||||
|
|
||||||
States states;
|
States states;
|
||||||
|
@ -99,7 +99,7 @@ std::set <std::string> LR0::getExpectedSymbols (const Closure& closure) const
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Add all items to the result set matching the production rule for symbol.
|
// Add all items to the result set matching the production rule for symbol.
|
||||||
LR0::Closure LR0::expand (const std::string& symbol) const
|
LR0::Closure LR0::getClosure (const std::string& symbol) const
|
||||||
{
|
{
|
||||||
std::set <std::string> seen;
|
std::set <std::string> seen;
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::set <std::string> getExpectedSymbols (const Closure&) const;
|
std::set <std::string> getExpectedSymbols (const Closure&) const;
|
||||||
Closure expand (const std::string&) const;
|
Closure getClosure (const std::string&) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Copy of the augmented grammar.
|
// Copy of the augmented grammar.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue