A3t
- Added ::getLimit to find the 'limit:n' pseudo attribute.
This commit is contained in:
20
src/A3t.cpp
20
src/A3t.cpp
@@ -588,6 +588,26 @@ const std::vector <std::string> A3t::getWords () const
|
|||||||
return words;
|
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
|
// /pattern/ --> description ~ pattern
|
||||||
void A3t::findPattern ()
|
void A3t::findPattern ()
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ public:
|
|||||||
const std::vector <std::string> getWords () const;
|
const std::vector <std::string> getWords () const;
|
||||||
// TODO Extract modifications
|
// TODO Extract modifications
|
||||||
|
|
||||||
|
std::string getLimit () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void findTerminator ();
|
void findTerminator ();
|
||||||
void findPattern ();
|
void findPattern ();
|
||||||
|
|||||||
Reference in New Issue
Block a user