- const ComponentList &comps = comp.pkg.get_components();
- for(ComponentList::const_iterator i=comps.begin(); i!=comps.end(); ++i)
- if(i->get_name()==n)
- {
- if(i->get_type()!=PROGRAM || !i->is_modular())
- throw Exception("Module host must be a modular program");
- comp.module_host = &*i;
- return;
- }
-
- throw KeyError("Unknown component", n);