lilypond-1.3.67
[lilypond.git] / lily / translator-ctors.cc
blob53dee7207dc6a3ab9fbe6acadd68a9db840abc2e
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 "proto.hh"
10 #include "translator.hh"
11 #include "dictionary.hh"
12 #include "debug.hh"
15 should delete these after exit.
19 UGH. Dictionary is deprecated
21 Dictionary<Translator*> *global_translator_dict_p=0;
23 void
24 add_translator (Translator *t)
26 if (!global_translator_dict_p)
27 global_translator_dict_p = new Dictionary<Translator*>;
29 (*global_translator_dict_p)[classname (t)] = t;
32 Translator*
33 get_translator_l (String s)
35 if (global_translator_dict_p->elem_b (s))
37 // return (*global_translator_dict_p)[s];
38 Translator* t = (*global_translator_dict_p)[s];
39 return t;
42 error (_f ("unknown translator: `%s'", s));
43 return 0;