- Implemented ::findPlainArgs, for locating words that can be promoted to
  patterns.
This commit is contained in:
Paul Beckingham 2014-05-06 21:26:30 -04:00
parent 07a1f9d6b5
commit fa2af30857
2 changed files with 20 additions and 0 deletions

View file

@ -148,6 +148,8 @@ Tree* A3t::parse ()
findFilter ();
findModifications ();
findPlainArgs ();
validate ();
return _tree;
@ -1184,6 +1186,23 @@ void A3t::findModifications ()
}
}
////////////////////////////////////////////////////////////////////////////////
// This is a called after parsing. The intention is to find plain arguments that
// are not otherwise recognized, and potentially promote them to patterns.
void A3t::findPlainArgs ()
{
std::vector <Tree*>::iterator i;
for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i)
{
if ((*i)->hasTag ("FILTER") &&
(*i)->hasTag ("ORIGINAL") && // TODO Wrong, can come in through alias/filter
(*i)->countTags () == 2)
{
std::cout << "# plain arg '" << (*i)->attribute ("raw") << "'\n";
}
}
}
////////////////////////////////////////////////////////////////////////////////
// Validate the parse tree.
void A3t::validate ()

View file

@ -71,6 +71,7 @@ private:
void findOperator ();
void findFilter ();
void findModifications ();
void findPlainArgs ();
void validate ();
private: