LR0: Diagnostics only in debug mode

This commit is contained in:
Paul Beckingham 2016-01-05 11:58:42 -05:00
parent eac94e99bf
commit 88e932ea2e

View file

@ -76,10 +76,12 @@ void LR0::initialize (const Grammar& grammar)
States states;
initializeFirstState (states);
closeState (states, 0);
if (_debug)
std::cout << states.dump () << "\n";
// Construct the parser tables.
createParseTable (states);
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)
{
out << " State " << state << "\n";
for (auto& item : (*this)[state])
out << " " << item.dump () << "\n";
}