mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
LR0: Removed obsolete ::setTransition
This commit is contained in:
parent
63d835b1cd
commit
6558f8422d
2 changed files with 0 additions and 17 deletions
15
src/LR0.cpp
15
src/LR0.cpp
|
@ -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 ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue