From 83b982015af6a26eb2666793df3054b881317104 Mon Sep 17 00:00:00 2001 From: Robin Jadoul Date: Sun, 18 Dec 2016 17:24:57 +0100 Subject: [PATCH] Fix? --- src/lrtables/LR0Itemset.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; } }