LR0: Made more methods const

This commit is contained in:
Paul Beckingham 2016-01-02 14:42:39 -05:00
parent c0a7a203cf
commit 27f71d810f
2 changed files with 4 additions and 4 deletions

View file

@ -94,7 +94,7 @@ void LR0::initialize (const Grammar& grammar)
// until no more items can be added to J; // until no more items can be added to J;
// return J // return J
// end // end
LR0::Closure LR0::getClosure (const Closure& items) LR0::Closure LR0::getClosure (const Closure& items) const
{ {
LR0::Closure closure; LR0::Closure closure;
for (auto& item : items) 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. // Collect a unique set of expected symbols from the closure.
std::set <std::string> LR0::getExpected (const Closure& closure) std::set <std::string> LR0::getExpected (const Closure& closure) const
{ {
std::set <std::string> expected; std::set <std::string> expected;
for (auto& item : closure) for (auto& item : closure)

View file

@ -68,8 +68,8 @@ public:
}; };
private: private:
Closure getClosure (const Closure&); Closure getClosure (const Closure&) const;
std::set <std::string> getExpected (const Closure&); std::set <std::string> getExpected (const Closure&) const;
Closure expand (const Closure&) const; Closure expand (const Closure&) const;
private: private: