From 27f71d810f81c6e8fc59e0997585cb9cd9c46b11 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 2 Jan 2016 14:42:39 -0500 Subject: [PATCH] LR0: Made more methods const --- src/LR0.cpp | 4 ++-- src/LR0.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/LR0.cpp b/src/LR0.cpp index e13135b8..423ce100 100644 --- a/src/LR0.cpp +++ b/src/LR0.cpp @@ -94,7 +94,7 @@ void LR0::initialize (const Grammar& grammar) // until no more items can be added to J; // return J // end -LR0::Closure LR0::getClosure (const Closure& items) +LR0::Closure LR0::getClosure (const Closure& items) const { LR0::Closure closure; for (auto& item : items) @@ -116,7 +116,7 @@ LR0::Closure LR0::getClosure (const Closure& items) //////////////////////////////////////////////////////////////////////////////// // Collect a unique set of expected symbols from the closure. -std::set LR0::getExpected (const Closure& closure) +std::set LR0::getExpected (const Closure& closure) const { std::set expected; for (auto& item : closure) diff --git a/src/LR0.h b/src/LR0.h index f0566838..befb2c27 100644 --- a/src/LR0.h +++ b/src/LR0.h @@ -68,8 +68,8 @@ public: }; private: - Closure getClosure (const Closure&); - std::set getExpected (const Closure&); + Closure getClosure (const Closure&) const; + std::set getExpected (const Closure&) const; Closure expand (const Closure&) const; private: