lilypond-1.3.30
[lilypond.git] / lily / include / translator-group.hh
blob11df320ce8a7bc08cbf9eb105c8689f2d187bf55
1 /*
2 translator-group.hh -- declare Translator_group
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
10 #ifndef TRANSLATOR_GROUP_HH
11 #define TRANSLATOR_GROUP_HH
13 #include "string.hh"
14 #include "lily-proto.hh"
15 #include "virtual-methods.hh"
16 #include "translator.hh"
17 #include "cons.hh"
18 #include "parray.hh"
19 #include "scm-hash.hh"
22 // egcs
23 typedef void (Translator::*Method_pointer)(void);
24 typedef void (Translator::*Const_method_pointer)(void) const;
26 /** Make some kind of Elements from Requests. Elements are made by
27 hierarchically grouped Translators
29 class Translator_group : public virtual Translator {
30 Array<String> consists_str_arr_;
31 Array<String> accepts_str_arr_;
32 Array<String> consists_end_str_arr_;
33 Scheme_hash_table properties_dict_;
35 int iterator_count_;
36 friend class Interpretation_context_handle;
38 protected:
39 Cons_list<Translator> trans_p_list_;
41 public:
42 SCM get_property (SCM name_sym) const;
43 void set_property (String var_name, SCM value);
46 String id_str_;
47 void add_last_element (String s);
49 VIRTUAL_COPY_CONS(Translator);
51 void set_acceptor (String accepts, bool add);
52 void set_element (String elt, bool add);
54 Translator_group(Translator_group const &);
55 Translator_group();
56 void add_translator (Translator *trans_p);
58 /// Score_register = 0, Staff_registers = 1, etc)
59 Translator_group* ancestor_l (int l=1);
60 int depth_i() const;
61 bool is_bottom_translator_b () const;
62 bool removable_b() const;
63 void terminate_translator (Translator*r_l);
64 Translator *remove_translator_p (Translator*trans_l);
65 void check_removal ();
67 Translator *get_simple_translator (String) const;
68 Translator_group *find_existing_translator_l (String n, String id);
69 Translator_group *find_create_translator_l (String n, String id);
70 Link_array<Translator_group> path_to_acceptable_translator (String alias) const;
72 Translator_group*get_default_interpreter();
73 virtual ~Translator_group ();
75 protected:
76 bool try_music_on_nongroup_children (Music *m);
78 virtual void do_print () const;
79 virtual void do_process_requests ();
80 virtual void do_add_processing ();
81 virtual bool do_try_music (Music* req_l);
82 virtual void do_pre_move_processing();
83 virtual void do_post_move_processing();
84 virtual void do_creation_processing();
85 virtual void do_removal_processing();
86 virtual void each (Method_pointer);
87 virtual void each (Const_method_pointer) const;
90 #endif // TRANSLATOR_GROUP_HH