From d19ada0aa88aba1c7b439035c0028440ac860ec3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 12 Sep 2006 00:22:33 +0000 Subject: Build now builds, it has viewers, and dependancy checking, and everything works. Now we have to add cleaning, caching, and more viewer hooks / viewers. --- src/buildparser.cpp | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) (limited to 'src/buildparser.cpp') diff --git a/src/buildparser.cpp b/src/buildparser.cpp index f855990..6c3337f 100644 --- a/src/buildparser.cpp +++ b/src/buildparser.cpp @@ -121,7 +121,7 @@ void BuildParser::filterList() { StringList lTmp2; StringList lIn = buildToStringList( lTmp, StringList() ); - pTmpFunc->execute( lIn, lTmp2 ); + pTmpFunc->execute( NULL, lIn, lTmp2 ); lTmp.clear(); for( StringList::iterator i = lTmp2.begin(); i != lTmp2.end(); i++ ) { @@ -137,7 +137,7 @@ StringList BuildParser::buildToStringList( const BuildList &lSrc, const StringLi { if( (*i).second ) { - (*i).second->execute( lIn, lOut ); + (*i).second->execute( NULL, lIn, lOut ); } else { @@ -155,6 +155,7 @@ void BuildParser::addRule( const char *sName ) { lRuleTmp.push_back( RuleInfo() ); lRuleTmp.back().sName = sName; + lRuleTmp.back().pAggregate = NULL; } void BuildParser::addRuleMatches() @@ -188,6 +189,11 @@ void BuildParser::addRulePerform() lRuleTmp.back().lPerform.push_back( pTmpPerform ); } +void BuildParser::setRuleAggregate() +{ + lRuleTmp.back().pAggregate = pTmpFunc; +} + // // Perform functions // @@ -431,14 +437,35 @@ Build *BuildParser::genBuild() pRule->getPerformList().push_back( *j ); } - /*StringList lITmp = buildToStringList( - (*i).lProduces, StringList() - ); + for( BuildList::iterator j = (*i).lProduces.begin(); + j != (*i).lProduces.end(); j++ ) + { + if( (*j).second ) + { + throw BuildException( + "You cannot have functions in produces lists (rule %s).", + (*i).sName.c_str() ); + } + pRule->getProducesList().push_back( (*j).first ); + } - for( StringList::iterator i = lITmp.begin(); i != lITmp.end(); i++ ) + if( (*i).pAggregate ) { - get - }*/ + pRule->setAggregate( (*i).pAggregate ); + } + + for( BuildList::iterator j = (*i).lRequires.begin(); + j != (*i).lRequires.end(); j++ ) + { + if( (*j).second ) + { + pRule->getReqFuncList().push_back( (*j).second ); + } + else + { + pRule->getReqStrList().push_back( (*j).first ); + } + } bld->addRule( pRule ); } -- cgit v1.2.3