LR0: Removed obsolete ::setTransition

This commit is contained in:
Paul Beckingham 2016-01-09 00:33:14 -05:00
parent 63d835b1cd
commit 6558f8422d
2 changed files with 0 additions and 17 deletions

View file

@ -132,14 +132,10 @@ void LR0::closeState (States& states, const int state) const
if (! item.done () &&
item.next () == expected)
{
Item advanced (item);
advanced.advance ();
closure.push_back (advanced);
if (! advanced.done ())
item.setTransition ((int)states.size ());
if (! advanced.done ())
{
auto nextSymbol = advanced.next ();
@ -306,7 +302,6 @@ LR0::Item::Item (const std::vector <std::string>& rule)
: _rule (rule)
, _cursor (2)
, _grammarRule (-1)
, _transitionsTo (-1)
{
if (_rule.size () == 3 && _rule[2] == "є")
_rule.pop_back ();
@ -315,7 +310,6 @@ LR0::Item::Item (const std::vector <std::string>& rule)
////////////////////////////////////////////////////////////////////////////////
bool LR0::Item::operator== (const Item& other)
{
// Deliberately ignores _transitionsTo.
if (_cursor != other._cursor ||
_grammarRule != other._grammarRule ||
_rule.size () != other._rule.size ())
@ -334,12 +328,6 @@ void LR0::Item::setGrammarRuleIndex (const int rule)
_grammarRule = rule;
}
////////////////////////////////////////////////////////////////////////////////
void LR0::Item::setTransition (const int state)
{
_transitionsTo = state;
}
////////////////////////////////////////////////////////////////////////////////
bool LR0::Item::advance ()
{
@ -384,9 +372,6 @@ std::string LR0::Item::dump () const
if (_grammarRule != -1)
out << " [g" << _grammarRule << "]";
if (_transitionsTo != -1)
out << " [s" << _transitionsTo << "]";
return out.str ();
}