LR0: Expansion of non-terminals also needs a reference to the augmented grammar

This commit is contained in:
Paul Beckingham 2015-12-27 10:08:47 -05:00
parent b56e8fb226
commit 08457be4a0
2 changed files with 5 additions and 5 deletions

View file

@ -60,16 +60,16 @@ void LR0::createParseTables (const Grammar& grammar)
items.push_back (std::pair <int, int> (i, 0));
// TODO Add new states.
while (expandNonTerminals (items))
while (expandNonTerminals (augmented, items))
;
}
////////////////////////////////////////////////////////////////////////////////
bool LR0::expandNonTerminals (std::vector <std::pair <int, int>>& items)
bool LR0::expandNonTerminals (
std::vector <std::vector <std::string>>& augmented,
std::vector <std::pair <int, int>>& items)
{
return false;
}

View file

@ -41,7 +41,7 @@ public:
std::string dump () const;
private:
bool expandNonTerminals (std::vector <std::pair <int, int>>&);
bool expandNonTerminals (std::vector <std::vector <std::string>>&, std::vector <std::pair <int, int>>&);
private:
// state column result