- Added ::getLimit to find the 'limit:n' pseudo attribute.
This commit is contained in:
Paul Beckingham 2014-05-24 14:44:19 -04:00
parent 051a92bf91
commit 3799b5dc9c
2 changed files with 22 additions and 0 deletions

View file

@ -588,6 +588,26 @@ const std::vector <std::string> A3t::getWords () const
return words;
}
////////////////////////////////////////////////////////////////////////////////
std::string A3t::getLimit () const
{
std::vector <Tree*>::const_iterator i;
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
{
// Parser override operator.
if ((*i)->attribute ("raw") == "TERMINATED")
break;
if ((*i)->hasTag ("PSEUDO") &&
(*i)->attribute ("name") == "limit")
{
return (*i)->attribute ("raw");
}
}
return "0";
}
////////////////////////////////////////////////////////////////////////////////
// /pattern/ --> description ~ pattern
void A3t::findPattern ()

View file

@ -61,6 +61,8 @@ public:
const std::vector <std::string> getWords () const;
// TODO Extract modifications
std::string getLimit () const;
private:
void findTerminator ();
void findPattern ();