This commit is contained in:
Robin Jadoul 2016-12-18 17:24:57 +01:00
parent f765196417
commit 83b982015a
1 changed files with 11 additions and 0 deletions

View File

@ -1,10 +1,21 @@
#include "Parsodus/lrtables/LR0Itemset.h"
#include <iostream> ///TODO remove me
namespace pds {
namespace lr {
void LR0Itemset::print() const {
for (auto& item : m_items) {
std::cout << item.rule->head << " -> ";
for (std::size_t i = 0; i < item.rule->tail.size(); i++) {
if (i == item.dotIdx)
std::cout << " ·";
std::cout << " " << item.rule->tail[i];
}
if (item.dotIdx == item.rule->tail.size())
std::cout << " ·";
std::cout << std::endl;
}
}