Translator_def::set_acceptor (SCM name, bool add)
{
if (add)
- this->accepts_name_list_ = gh_append2 (this->accepts_name_list_, gh_cons (name, SCM_EOL));
+ this->accepts_name_list_ = gh_cons (name, this->accepts_name_list_);
else
this->accepts_name_list_ = scm_delete_x (name, this->accepts_name_list_);
}
Translator_def::add_push_property (SCM props, SCM syms, SCM vals)
{
this->property_ops_ = gh_cons (gh_list (push_sym, props, syms, vals, SCM_UNDEFINED),
- this->property_ops_);
+ this->property_ops_);
}
void
Translator_def::add_pop_property (SCM props, SCM syms)
{
this->property_ops_ = gh_cons (gh_list (push_sym, props, syms, SCM_UNDEFINED),
- this->property_ops_);
+ this->property_ops_);
}
/*
accepted_arr.push (t);
}
-
Link_array<Translator_def> best_result;
for (int i=0; i < accepted_arr.size (); i++)
if (scm_equal_p (accepted_arr[i]->type_name_, type_str) == SCM_BOOL_T)
tg->output_def_l_ = md;
tg->definition_ = self_scm ();
tg->type_str_ = ly_scm2string (type_name_);
+ SCM l1 = trans_list (consists_name_list_, tg);
+ SCM l2 =trans_list (end_consists_name_list_,tg);
+ l1 = scm_reverse_x (l1, l2);
+
+ tg->simple_trans_list_ = l1;
+
+ return tg;
+}
+
+
+void
+Translator_def::apply_property_operations (Translator_group*tg)
+{
SCM correct_order = scm_reverse (property_ops_); // pity of the mem.
for (SCM s = correct_order; gh_pair_p (s); s = gh_cdr (s))
{
tg->set_property (gh_car(entry), gh_cadr (entry));
}
}
-
- SCM l1 = trans_list (consists_name_list_, tg);
- SCM l2 =trans_list (end_consists_name_list_,tg);
- l1 = scm_reverse_x (l1, l2);
-
- tg->simple_trans_list_ = l1;
-
- return tg;
}
SCM
this->property_ops_);
}
+/*
+ Default child context as a SCM string, or something else if there is
+ none.
+*/
+SCM
+Translator_def::default_child_context_name ()
+{
+ SCM d = accepts_name_list_;
+ return gh_pair_p (d) ? gh_car (scm_last_pair (d)) : SCM_EOL;
+}
+
+SCM
+Translator_def::to_alist ()const
+{
+ SCM l = SCM_EOL;
+
+ l = gh_cons (gh_cons (ly_symbol2scm ("consists"), consists_name_list_), l);
+ l = gh_cons (gh_cons (ly_symbol2scm ("end-consists"), end_consists_name_list_), l);
+ l = gh_cons (gh_cons (ly_symbol2scm ("accepts"), accepts_name_list_), l);
+ l = gh_cons (gh_cons (ly_symbol2scm ("property-ops"), property_ops_), l);
+ l = gh_cons (gh_cons (ly_symbol2scm ("type-name"), type_name_), l); // junkme.
+ l = gh_cons (gh_cons (ly_symbol2scm ("group-type"), translator_group_type_), l);
+
+ return l;
+}