lilypond-1.3.130
[lilypond.git] / lily / translator-ctors.cc
blob44183101866f159c30edc28a3797dc9c72d3aa1e
1 /*
2 translator-ctors.cc -- implement Translator construction
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
9 #include "translator.hh"
10 #include "dictionary.hh"
11 #include "debug.hh"
14 should delete these after exit.
18 UGH. Dictionary is deprecated
20 Dictionary<Translator*> *global_translator_dict_p=0;
22 void
23 add_translator (Translator *t)
25 if (!global_translator_dict_p)
26 global_translator_dict_p = new Dictionary<Translator*>;
28 (*global_translator_dict_p)[classname (t)] = t;
31 Translator*
32 get_translator_l (String s)
34 if (global_translator_dict_p->elem_b (s))
36 Translator* t = (*global_translator_dict_p)[s];
37 return t;
40 error (_f ("unknown translator: `%s'", s));
41 return 0;