]> git.donarmstrong.com Git - lilypond.git/blob - lily/translator-ctors.cc
patch::: 1.3.49.hwn1: deze dus
[lilypond.git] / lily / translator-ctors.cc
1 /*
2   translator-ctors.cc -- implement Translator construction
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "proto.hh"
10 #include "translator.hh"
11 #include "dictionary.hh"
12 #include "debug.hh"
13
14 /*
15   should delete these after exit.
16  */
17
18 /*
19   UGH. Dictionary is deprecated
20  */
21 Dictionary<Translator*> *global_translator_dict_p=0;
22
23 void
24 add_translator (Translator *t)
25 {
26   if (!global_translator_dict_p)
27     global_translator_dict_p = new Dictionary<Translator*>;
28
29   global_translator_dict_p->elem (classname (t)) = t;
30 }
31
32 Translator*
33 get_translator_l (String s)
34 {
35   if (global_translator_dict_p->elem_b (s))
36     {
37 //      return (*global_translator_dict_p)[s];
38         Translator* t = (*global_translator_dict_p)[s];
39         return t;
40     }
41
42   error (_f ("unknown translator: `%s'", s));
43   return 0;
44 }
45