]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/translator-def.hh
release: 1.3.102
[lilypond.git] / lily / include / translator-def.hh
1 /*   
2   translator-def.hh -- declare Translator_def
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef TRANSLATOR_DEF_HH
11 #define TRANSLATOR_DEF_HH
12
13 #include "lily-proto.hh"
14 #include "smobs.hh"
15 #include "input.hh"
16
17 /*
18   The definition of a interpretation context as given in the
19   input. The lists are stored in order of definition.
20 */
21 struct Translator_def : public Input
22 {
23 private:
24   /*
25     these lists store the definition, in opposite order of entry
26   */
27   
28   SCM consists_name_list_;
29   SCM end_consists_name_list_;
30   SCM accepts_name_list_;
31   SCM property_ops_;
32 public:
33   SCM type_name_;
34   SCM translator_group_type_;
35
36   SCM modify_definition (SCM, SCM, bool);
37   SCM default_child_context_name ();
38   
39   void set_acceptor (SCM accepts, bool add);
40   void add_element (SCM name);
41   void remove_element (SCM name);
42   void add_last_element (SCM name);
43
44   void add_push_property (SCM,SCM,SCM);
45   void add_pop_property (SCM,SCM);
46   void add_property_assign (SCM, SCM);
47   Link_array<Translator_def> path_to_acceptable_translator (SCM type_str, Music_output_def* odef) const;
48   Translator_group * instantiate (Music_output_def*);
49
50   SCM to_alist () const;
51
52   static SCM make_scm () ;
53   static void apply_pushpop_property (Translator_group*, SCM syms, SCM eprop, SCM val);
54
55   SCM clone_scm ()const;
56   void apply_property_operations (Translator_group*);
57
58 private:
59   DECLARE_SMOBS(Translator_def,foo);
60   Translator_def ();
61   Translator_def (Translator_def const&);
62
63
64 };
65
66 Translator_def* unsmob_translator_def (SCM);
67
68
69 #endif /* TRANSLATOR_DEF_HH */
70