mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
LR0: Diagnostics only in debug mode
This commit is contained in:
parent
eac94e99bf
commit
88e932ea2e
1 changed files with 4 additions and 3 deletions
|
@ -76,11 +76,13 @@ void LR0::initialize (const Grammar& grammar)
|
||||||
States states;
|
States states;
|
||||||
initializeFirstState (states);
|
initializeFirstState (states);
|
||||||
closeState (states, 0);
|
closeState (states, 0);
|
||||||
std::cout << states.dump () << "\n";
|
if (_debug)
|
||||||
|
std::cout << states.dump () << "\n";
|
||||||
|
|
||||||
// Construct the parser tables.
|
// Construct the parser tables.
|
||||||
createParseTable (states);
|
createParseTable (states);
|
||||||
std::cout << dump () << "\n";;
|
if (_debug)
|
||||||
|
std::cout << dump () << "\n";;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -296,7 +298,6 @@ std::string LR0::States::dump () const
|
||||||
for (unsigned int state = 0; state < this->size (); ++state)
|
for (unsigned int state = 0; state < this->size (); ++state)
|
||||||
{
|
{
|
||||||
out << " State " << state << "\n";
|
out << " State " << state << "\n";
|
||||||
|
|
||||||
for (auto& item : (*this)[state])
|
for (auto& item : (*this)[state])
|
||||||
out << " " << item.dump () << "\n";
|
out << " " << item.dump () << "\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue