Parser
- Implemented ::getCommand.
This commit is contained in:
@@ -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 ()
|
||||||
|
|||||||
@@ -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 ();
|
||||||
|
|||||||
Reference in New Issue
Block a user