try
{
+ if(!aux_loaders.empty() && !has_keyword(st.keyword))
+ {
+ for(list<Loader *>::const_iterator i=aux_loaders.begin(); i!=aux_loaders.end(); ++i)
+ if((*i)->has_keyword(st.keyword))
+ return (*i)->load_statement(st);
+ }
+
LoaderAction *act = find_action(ActionKey(st.keyword, st.get_signature()));
if(act)
{
actions[key] = act;
}
+void Loader::add_auxiliary_loader(Loader &ldr)
+{
+ aux_loaders.push_back(&ldr);
+}
+
+bool Loader::has_keyword(const string &kwd) const
+{
+ ActionMap::const_iterator i = actions.lower_bound(ActionKey(kwd, string()));
+ return i!=actions.end() && i->first.keyword==kwd;
+}
+
LoaderAction *Loader::find_action(const ActionKey &key) const
{
ActionMap::const_iterator begin = actions.lower_bound(ActionKey(key.keyword, string()));
ActionMap actions;
const Statement *cur_st;
bool sub_loaded;
+ std::list<Loader *> aux_loaders;
protected:
bool check_sub_loads;
private:
void add(const std::string &, LoaderAction *);
+protected:
+ void add_auxiliary_loader(Loader &);
+
+private:
+ bool has_keyword(const std::string &) const;
LoaderAction *find_action(const ActionKey &) const;
protected: