From e05610d1d7e93f53e0d4625b3fb69922d9adf9df Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 20 Apr 2014 10:12:24 -0400 Subject: [PATCH] A3t - Implemented ::findModifications to identify nodes that comprise the task modifications. --- src/A3t.cpp | 21 +++++++++++++++++++++ src/A3t.h | 1 + 2 files changed, 22 insertions(+) diff --git a/src/A3t.cpp b/src/A3t.cpp index 646ee0ed3..c31a0b80e 100644 --- a/src/A3t.cpp +++ b/src/A3t.cpp @@ -135,6 +135,7 @@ Tree* A3t::parse () findAttributeModifier (); findOperator (); findFilter (); + findModifications (); validate (); @@ -949,6 +950,26 @@ void A3t::findFilter () } } +//////////////////////////////////////////////////////////////////////////////// +void A3t::findModifications () +{ + bool after_writecmd = false; + std::vector ::iterator i; + for (i = _tree->_branches.begin (); i != _tree->_branches.end (); ++i) + { + if ((*i)->hasTag ("WRITECMD")) + after_writecmd = true; + + if (after_writecmd && + ! (*i)->hasTag ("CMD") && + ! (*i)->hasTag ("TERMINATOR") && + ! (*i)->hasTag ("BINARY") && + ! (*i)->hasTag ("RC") && + ! (*i)->hasTag ("CONFIG")) + (*i)->tag ("MODIFICATION"); + } +} + //////////////////////////////////////////////////////////////////////////////// // Validate the parse tree. void A3t::validate () diff --git a/src/A3t.h b/src/A3t.h index d9266c57f..200ea585f 100644 --- a/src/A3t.h +++ b/src/A3t.h @@ -65,6 +65,7 @@ private: void findAttributeModifier (); void findOperator (); void findFilter (); + void findModifications (); void validate (); // TODO Resolve aliases