source file of the GNU LilyPond music typesetter
- (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "music-output-def.hh"
#include "debug.hh"
#include "pcursor.hh"
#include "rational.hh"
+#include "dictionary-iter.hh"
Translator_group::Translator_group (Translator_group const&s)
: Translator(s)
consists_str_arr_ = s.consists_str_arr_;
accepts_str_arr_ = s.accepts_str_arr_;
iterator_count_ =0;
+ properties_dict_ = s.properties_dict_;
+
}
Translator_group::~Translator_group ()
void
Translator_group::terminate_translator (Translator*r_l)
{
- DOUT << "Removing " << classname (r_l) << " at " << now_moment () << '\n';
+ DOUT << "Removing " << classname (r_l) << " at " << now_mom () << '\n';
r_l->removal_processing();
Translator * trans_p =remove_translator_p (r_l);
#ifndef NPRINT
if (!check_debug)
return ;
+ for (Dictionary_iter<Scalar> i (properties_dict_); i.ok (); i++)
+ {
+ DOUT << i.key () << "=" << i.val () << '\n';
+ }
if (status == ORPHAN)
{
DOUT << "consists of: ";
add_translator (t->clone ());
}
}
+
+Scalar
+Translator_group::get_property (String id,
+ Translator_group **where_l) const
+{
+ if (properties_dict_.elem_b (id))
+ {
+ if (where_l)
+ *where_l = this;
+ return properties_dict_[id];
+ }
+
+ if (daddy_trans_l_)
+ return daddy_trans_l_->get_property (id, where_l);
+
+ if (where_l)
+ *where_l = 0;
+ return "";
+}
+
+void
+Translator_group::set_property (String id, Scalar val)
+{
+ properties_dict_[id] = val;
+}