]> git.donarmstrong.com Git - lilypond.git/blob - lily/translator.cc
(main): don't identify binary.
[lilypond.git] / lily / translator.cc
1 /*
2   translator.cc -- implement Translator
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #include "translator.hh"
11 #include "warn.hh"
12 #include "translator-group.hh"
13 #include "translator-def.hh"
14
15 #include "moment.hh"
16 #include "ly-smobs.icc"
17
18
19 Translator::~Translator ()
20 {
21 }
22
23 void
24 Translator::init ()
25 {
26   simple_trans_list_ = SCM_EOL;
27   trans_group_list_ = SCM_EOL;
28   properties_scm_ = SCM_EOL;
29   definition_ = SCM_EOL;
30   daddy_trans_ =0;
31 }
32
33 Translator::Translator ()
34 {
35   self_scm_ = SCM_EOL;
36   init ();
37   output_def_ = 0;
38   smobify_self ();
39 }
40
41 Translator::Translator (Translator const &s)
42 {
43   self_scm_ = SCM_EOL;
44   init ();
45   output_def_ = s.output_def_;
46
47   smobify_self ();
48 }
49
50 bool
51 Translator::is_alias_b (SCM sym) const
52 {
53   Translator_def * td = unsmob_translator_def (definition_);
54   bool b  = (sym == td->type_name_);
55
56   for (SCM a = td->type_aliases_; !b && gh_pair_p (a); a = ly_cdr (a))
57     b = b || sym == ly_car (a);
58
59   return b;
60 }
61
62 bool
63 Translator::try_music (Music *)
64 {
65   return false;
66 }
67                             
68
69 Moment
70 Translator::now_mom () const
71 {
72   return daddy_trans_->now_mom ();
73 }
74
75 void
76 Translator::removal_processing ()
77 {
78   finalize ();
79 }
80
81 void
82 Translator::do_announces ()
83 {
84 }
85
86 Music_output_def *
87 Translator::get_output_def () const
88 {
89   return output_def_;
90 }
91
92 SCM
93 Translator::internal_get_property (SCM sym) const
94 {
95   return daddy_trans_->internal_get_property (sym);
96 }
97
98 void
99 Translator:: stop_translation_timestep ()
100 {
101 }
102
103 void
104 Translator::start_translation_timestep ()
105 {
106 }
107
108 void
109 Translator::initialize ()
110 {
111 }
112
113 void
114 Translator::finalize ()
115 {
116 }
117
118
119 /*
120
121   SMOBS
122
123 */
124 SCM
125 Translator::mark_smob (SCM sm)
126 {
127   Translator * me = (Translator*) SCM_CELL_WORD_1 (sm);
128   scm_gc_mark (me->simple_trans_list_);
129   scm_gc_mark (me->trans_group_list_);
130   scm_gc_mark (me->definition_);  
131   scm_gc_mark (me->properties_scm_);  
132
133   return me->properties_scm_;
134 }
135
136 SCM
137 Translator::translator_description () const
138 {
139   return SCM_EOL;
140 }
141
142 SCM
143 Translator::static_translator_description ()const
144 {
145   return SCM_EOL;
146 }
147
148
149 IMPLEMENT_SMOBS (Translator);
150 IMPLEMENT_DEFAULT_EQUAL_P (Translator);
151 IMPLEMENT_TYPE_P(Translator,"ly:translator?");
152