+void Loader::add_auxiliary_loader(Loader &ldr)
+{
+ aux_loaders.push_back(&ldr);
+}
+
+bool Loader::has_action(const StatementKey &key) const
+{
+ if(!actions)
+ return false;
+
+ auto i = actions->lower_bound(StatementKey(key.keyword, string()));
+ for(; (i!=actions->end() && i->first.keyword==key.keyword); ++i)
+ if(signature_match(key.signature, i->first.signature))
+ return true;
+ return false;
+}
+
+LoaderAction *Loader::find_action(const StatementKey &key) const
+{
+ if(!actions)
+ return 0;
+
+ auto begin = actions->lower_bound(StatementKey(key.keyword, string()));
+ auto end = actions->upper_bound(StatementKey(key.keyword, "~"));
+
+ if(begin==end)
+ throw unknown_keyword(key.keyword);
+
+ LoaderAction *act = 0;
+ int match = 0;
+ for(auto i=begin; i!=end; ++i)
+ {
+ int m = signature_match(key.signature, i->first.signature);
+ if(m>match)
+ {
+ act = i->second;
+ match = m;
+ }
+ }
+
+ if(!match)
+ throw invalid_signature(key.keyword, key.signature);
+
+ return act;
+}
+
+const string &Loader::get_source() const
+{
+ if(!cur_st)
+ throw logic_error("no current statement");
+ return cur_st->source;
+}
+
+const string &Loader::get_keyword() const
+{
+ if(!cur_st)
+ throw logic_error("no current statement");
+ return cur_st->keyword;
+}
+
+
+Loader::ActionMap::~ActionMap()