diff options
author | Steve Huston <shuston@riverace.com> | 2009-08-05 23:35:46 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2009-08-05 23:35:46 +0000 |
commit | e12aa74c39e3c91f9313a9d8733e17c25a1aff91 (patch) | |
tree | f10de4e8a434e1b6a8c4c9c28dde54aad93c1986 /ACE/ace/Parse_Node.cpp | |
parent | 508289734dbd6044c81db23c356c239d82a97996 (diff) | |
download | ATCD-e12aa74c39e3c91f9313a9d8733e17c25a1aff91.tar.gz |
ChangeLogTag:Wed Aug 5 23:28:43 UTC 2009 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/ace/Parse_Node.cpp')
-rw-r--r-- | ACE/ace/Parse_Node.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ACE/ace/Parse_Node.cpp b/ACE/ace/Parse_Node.cpp index bcd9cb7229e..6ede4e2bb89 100644 --- a/ACE/ace/Parse_Node.cpp +++ b/ACE/ace/Parse_Node.cpp @@ -11,6 +11,8 @@ #include "ace/OS_NS_string.h" #include "ace/ARGV.h" +#include <list> + ACE_RCSID (ace, Parse_Node, "$Id$") @@ -45,10 +47,21 @@ ACE_Stream_Node::apply (ACE_Service_Gestalt *config, int &yyerrno) ACE_Stream_Type *st = dynamic_cast<ACE_Stream_Type *> (const_cast<ACE_Service_Type_Impl *> (sst->type ())); - for (const ACE_Static_Node *module = dynamic_cast<const ACE_Static_Node*> (this->mods_); + // The modules were linked as popped off the yacc stack, so they're in + // reverse order from the way they should be pushed onto the stream. + // So traverse mods_ and and reverse the list, then iterate over it to push + // the modules in the stream in the correct order. + std::list<const ACE_Static_Node *> mod_list; + const ACE_Static_Node *module; + for (module = dynamic_cast<const ACE_Static_Node*> (this->mods_); module != 0; module = dynamic_cast<ACE_Static_Node*> (module->link())) + mod_list.push_front (module); + + std::list<const ACE_Static_Node *>::const_iterator iter; + for (iter = mod_list.begin (); iter != mod_list.end (); ++iter) { + module = *iter; ACE_ARGV args (module->parameters ()); const ACE_Service_Type *mst = module->record (config); @@ -64,6 +77,7 @@ ACE_Stream_Node::apply (ACE_Service_Gestalt *config, int &yyerrno) module->name ())); } ++yyerrno; + continue; // Don't try anything else with this one } ACE_Module_Type const * const mt1 = |