diff --git a/src/lrtables/LR0Itemset.cpp b/src/lrtables/LR0Itemset.cpp index f22dfdc..20e4dea 100644 --- a/src/lrtables/LR0Itemset.cpp +++ b/src/lrtables/LR0Itemset.cpp @@ -1,10 +1,21 @@ #include "Parsodus/lrtables/LR0Itemset.h" +#include ///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; } }