2 input-engraver.cc -- implement Input_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
10 #include "engraver.hh"
11 #include "input-engraver.hh"
13 #include "input-engraver.hh"
14 #include "engraver-group.hh"
17 Input_engraver::is_name_b(String n
)
19 for (int i
=0; i
< alias_str_arr_
.size(); i
++)
20 if (alias_str_arr_
[i
] == n
)
26 Input_engraver::print() const
29 mtor
<< "type " << type_str_
;
30 mtor
<< "Consists of ";
31 for (int i
=0; i
< consists_str_arr_
.size(); i
++)
32 mtor
<< consists_str_arr_
[i
] << ',';
34 for (iter(contains_igrav_p_list_
.top(), i
); i
.ok(); i
++)
42 Input_engraver::recursive_find(String nm
)
47 Input_engraver
* r
=0;
48 iter(contains_igrav_p_list_
.top(), i
);
49 for (; !r
&&i
.ok(); i
++) {
50 if (i
->recursive_find(nm
))
58 Input_engraver::find_igrav_l(String nm
)
60 for (iter(contains_igrav_p_list_
.top(), i
); i
.ok(); i
++)
61 if (i
->is_name_b( nm
))
68 Engraver_group_engraver
*
69 Input_engraver::get_group_engraver_p()
71 Engraver_group_engraver
* grav_p
= (Engraver_group_engraver
*)
72 get_engraver_p(type_str_
);
74 for (int i
=0; i
< consists_str_arr_
.size(); i
++) {
75 grav_p
->add( get_engraver_p( consists_str_arr_
[i
]) );
77 grav_p
-> igrav_l_
= this;
83 Input_engraver::accept_req_b()
85 return ! contains_igrav_p_list_
.size();
89 Input_engraver::add(Input_engraver
*ip
)
91 contains_igrav_p_list_
.bottom().add(ip
);
95 Input_engraver::get_default_igrav_l()
97 if ( contains_igrav_p_list_
.size() )
98 return contains_igrav_p_list_
.top();
104 Input_engraver_list::Input_engraver_list(Input_engraver_list
const &s
)
106 for (PCursor
<Input_engraver
*> pc(s
); pc
.ok(); pc
++) {
107 Input_engraver
*q
= pc
;
108 Input_engraver
*p
=new Input_engraver(*q
) ;