mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
LR0: Implemented ::expand
This commit is contained in:
parent
ecb161131c
commit
f4bff57b09
1 changed files with 4 additions and 0 deletions
|
@ -130,9 +130,13 @@ std::set <std::string> LR0::getExpected (const Closure& closure) const
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Add all items to the result set matching the production rule for symbol.
|
||||
LR0::Closure LR0::expand (const std::string& symbol) const
|
||||
{
|
||||
LR0::Closure result;
|
||||
for (auto& rule : _augmented)
|
||||
if (rule[0] == symbol)
|
||||
result.push_back (Item (rule));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue