- Implemented ::getCommand.
This commit is contained in:
Paul Beckingham 2014-05-25 19:32:35 -04:00
parent f908e2ae02
commit ce7506f4fc
2 changed files with 18 additions and 1 deletions

View file

@ -608,6 +608,23 @@ std::string Parser::getLimit () const
return "0"; return "0";
} }
////////////////////////////////////////////////////////////////////////////////
std::string Parser::getCommand () const
{
std::vector <Tree*>::const_iterator i;
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
{
// Parser override operator.
if ((*i)->attribute ("canonical") == "TERMINATED")
break;
if ((*i)->hasTag ("CMD"))
return (*i)->attribute ("raw");
}
return "";
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// /pattern/ --> description ~ pattern // /pattern/ --> description ~ pattern
void Parser::findPattern () void Parser::findPattern ()

View file

@ -59,9 +59,9 @@ public:
const std::string getFilterExpression (); const std::string getFilterExpression ();
const std::vector <std::string> getWords () const; const std::vector <std::string> getWords () const;
// TODO Extract modifications
std::string getLimit () const; std::string getLimit () const;
std::string getCommand () const;
private: private:
void findTerminator (); void findTerminator ();