mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
LR0: Added ::getExpected to ::closure
This commit is contained in:
parent
679f094f16
commit
f658c5d35c
1 changed files with 12 additions and 2 deletions
14
src/LR0.cpp
14
src/LR0.cpp
|
@ -97,10 +97,20 @@ void LR0::initialize (const Grammar& grammar)
|
|||
LR0::Closure LR0::getClosure (const Closure& items)
|
||||
{
|
||||
LR0::Closure closure;
|
||||
|
||||
for (auto & item : items)
|
||||
for (auto& item : items)
|
||||
{
|
||||
// closure(I) includes I.
|
||||
closure.push_back (item);
|
||||
|
||||
// Obtain all the expected symbols.
|
||||
auto expected = getExpectations (items);
|
||||
for (auto& exp : expected)
|
||||
{
|
||||
std::cout << "# Expecting " << exp << "\n";
|
||||
std::cout << "# Add expansion of " << exp << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
return closure;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue