]> git.donarmstrong.com Git - lilypond.git/blob - lily/parser.yy
GCC-3.1.1 fixes
[lilypond.git] / lily / parser.yy
1 %{ // -*-Fundamental-*-
2
3 /*
4   parser.yy -- Bison/C++ parser for lilypond
5
6   source file of the GNU LilyPond music typesetter
7
8   (c)  1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9            Jan Nieuwenhuizen <janneke@gnu.org>
10 */
11
12 /*
13   Two shift/reduce problems:
14     -
15     -
16  */
17
18 /*
19
20 the rules for who is protecting what are very shady. TODO: uniformise
21 this.
22
23
24 */
25
26 #include <ctype.h>
27
28 //#include <iostream>
29
30 #include "translator-def.hh"
31 #include "lily-guile.hh"
32 #include "change-iterator.hh"
33 #include "misc.hh"
34 #include "my-lily-lexer.hh"
35 #include "paper-def.hh"
36 #include "midi-def.hh"
37 #include "main.hh"
38 #include "file-path.hh"
39 #include "debug.hh"
40 #include "dimensions.hh"
41 #include "command-request.hh"
42 #include "musical-request.hh"
43 #include "my-lily-parser.hh"
44 #include "context-specced-music.hh"
45 #include "score.hh"
46 #include "music-list.hh"
47 #include "output-property-music-iterator.hh"
48 #include "property-iterator.hh"
49 #include "file-results.hh"
50 #include "input.hh"
51 #include "relative-music.hh"
52 #include "lyric-combine-music.hh"
53 #include "transposed-music.hh"
54 #include "time-scaled-music.hh"
55 #include "repeated-music.hh"
56 #include "untransposable-music.hh"
57 #include "lilypond-input-version.hh"
58 #include "grace-music.hh"
59 #include "part-combine-music.hh"
60 #include "scm-hash.hh"
61 #include "auto-change-iterator.hh"
62 #include "un-relativable-music.hh"
63 #include "chord.hh"
64
65 bool
66 regular_identifier_b (SCM id)
67 {
68   String str = ly_scm2string (id);
69   char const *s = str.ch_C() ;
70
71   bool v = true;
72   while (*s && v)
73    {
74         v = v && isalpha (*s);
75         s++;
76    }
77   return v;
78 }
79
80
81 Music* 
82 set_property_music (SCM sym, SCM value)
83 {
84         Music * p = new Music (SCM_EOL);
85         p->set_mus_property ("symbol", sym);
86         p->set_mus_property ("iterator-ctor",
87         Property_iterator::constructor_cxx_function);
88
89         p->set_mus_property ("value", value);
90         return p;
91 }
92
93 bool
94 is_duration_b (int t)
95 {
96   return t && t == 1 << intlog2 (t);
97 }
98
99 void
100 set_music_properties (Music *p, SCM a)
101 {
102   for (SCM k = a; gh_pair_p (k); k = ly_cdr (k))
103         {
104         p->internal_set_mus_property (ly_caar (k), ly_cdar (k));
105         }
106 }
107
108
109
110
111
112
113
114 // needed for bison.simple's malloc () and free ()
115
116 #include <malloc.h>
117 #include <stdlib.h>
118
119
120
121 #define YYERROR_VERBOSE 1
122
123 #define YYPARSE_PARAM my_lily_parser_l
124 #define YYLEX_PARAM my_lily_parser_l
125 #define THIS\
126         ((My_lily_parser *) my_lily_parser_l)
127
128 #define yyerror THIS->parser_error
129 #define ARRAY_SIZE(a,s)   if (a.size () != s) THIS->parser_error (_f ("Expecting %d arguments", s))
130
131 %}
132
133 /* We use SCMs to do strings, because it saves us the trouble of
134 deleting them.  Let's hope that a stack overflow doesnt trigger a move
135 of the parse stack onto the heap. */
136
137
138 %union {
139
140     Link_array<Request> *reqvec;
141
142     String *string; // needed by the lexer as temporary scratch area.
143     Music *music;
144     Score *score;
145     Scheme_hash_table *scmhash;
146     Music_output_def * outputdef;
147
148     Request * request;
149
150     SCM scm;
151
152     Tempo_req *tempo;
153     int i;
154 }
155 %{
156
157 int
158 yylex (YYSTYPE *s,  void * v_l)
159 {
160         My_lily_parser   *pars_l = (My_lily_parser*) v_l;
161         My_lily_lexer * lex_l = pars_l->lexer_p_;
162
163         lex_l->lexval_l = (void*) s;
164         return lex_l->yylex ();
165 }
166
167
168 %}
169
170 %pure_parser
171
172 /* tokens which are not keywords */
173 %token AUTOCHANGE
174 %token ALIAS
175 %token APPLY
176 %token ARPEGGIO
177 %token DYNAMICSCRIPT
178 %token ACCEPTS
179 %token ALTERNATIVE
180 %token BAR
181 %token BREATHE
182 %token CHORDMODIFIERS
183 %token CHORDS
184 %token CHAR_T
185 %token CLEF
186 %token CM_T
187 %token CONSISTS
188 %token DURATION
189 %token SEQUENTIAL
190 %token GROBDESCRIPTIONS
191 %token SIMULTANEOUS
192 %token CONSISTSEND
193 %token DENIES
194 %token DURATION
195 %token EXTENDER
196 %token FIGURES FIGURE_OPEN FIGURE_CLOSE
197 %token FIGURE_BRACKET_CLOSE FIGURE_BRACKET_OPEN
198 %token GLISSANDO
199 %token GRACE 
200 %token HEADER
201 %token HYPHEN
202 %token IN_T
203 %token INVALID
204 %token KEY
205 %token LYRICS
206 %token MARK
207 %token MULTI_MEASURE_REST
208 %token MIDI
209 %token MM_T
210 %token PITCH
211 %token DEFAULT
212 %token NAME
213 %token PITCHNAMES
214 %token NOTES
215 %token PAPER
216 %token PARTIAL
217 %token PENALTY
218 %token PROPERTY
219 %token OVERRIDE SET REVERT 
220 %token PT_T
221 %token RELATIVE
222 %token REMOVE
223 %token REPEAT
224 %token ADDLYRICS
225 %token PARTCOMBINE
226 %token SCM_T
227 %token SCORE
228 %token SCRIPT
229 %token SKIP
230 %token SPANREQUEST
231 %token STYLESHEET
232 %token COMMANDSPANREQUEST
233 %token TEMPO
234 %token OUTPUTPROPERTY
235 %token TIME_T
236 %token TIMES
237 %token TRANSLATOR
238 %token TRANSPOSE
239 %token TYPE
240 %token UNSET
241 %token CONTEXT
242 %token REST
243
244 /* escaped */
245 %token E_CHAR E_EXCLAMATION E_SMALLER E_BIGGER E_OPEN E_CLOSE
246 %token E_LEFTSQUARE E_RIGHTSQUARE E_TILDE
247 %token E_BACKSLASH
248 %token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET
249 %token FIGURE_SPACE
250
251
252 %type <i>       exclamations questions dots optional_rest
253 %type <i>       bass_number bass_mod
254 %type <scm>     br_bass_figure bass_figure figure_list figure_spec
255 %token <i>      DIGIT
256 %token <scm>    NOTENAME_PITCH
257 %token <scm>    TONICNAME_PITCH
258 %token <scm>    CHORDMODIFIER_PITCH
259 %token <scm>    DURATION_IDENTIFIER
260 %token <scm>    FRACTION
261 %token <id>     IDENTIFIER
262
263
264 %token <scm>    SCORE_IDENTIFIER
265 %token <scm>    MUSIC_OUTPUT_DEF_IDENTIFIER
266
267 %token <scm>    NUMBER_IDENTIFIER
268 %token <scm>    REQUEST_IDENTIFIER
269 %token <scm>    MUSIC_IDENTIFIER TRANSLATOR_IDENTIFIER
270 %token <scm>    STRING_IDENTIFIER SCM_IDENTIFIER 
271 %token <scm>    RESTNAME
272 %token <scm>    STRING   
273 %token <scm>    SCM_T
274 %token <i>      UNSIGNED
275 %token <scm>   REAL
276
277 %type <outputdef> output_def
278 %type <scmhash>         lilypond_header lilypond_header_body
279 %type <request> open_request_parens close_request_parens open_request close_request
280 %type <request> request_with_dir request_that_take_dir verbose_request
281 %type <i>       sub_quotes sup_quotes
282 %type <music>   simple_element  request_chord command_element Simple_music  Composite_music 
283 %type <music>   Repeated_music
284 %type <scm>     Alternative_music
285 %type <i>       tremolo_type
286 %type <i>       bare_int  bare_unsigned
287 %type <i>       script_dir
288
289 %type <scm>     identifier_init 
290
291 %type <scm> steno_duration optional_notemode_duration multiplied_duration
292 %type <scm>  verbose_duration
293         
294 %type <reqvec>  pre_requests post_requests
295 %type <request> gen_text_def
296 %type <scm>   steno_pitch pitch absolute_pitch
297 %type <scm>   explicit_pitch steno_tonic_pitch
298
299 %type <scm>     chord_additions chord_subtractions chord_notes chord_step
300 %type <music>   chord
301 %type <scm>     chord_note chord_inversion chord_bass
302 %type <scm>     duration_length fraction
303
304 %type <scm>  embedded_scm scalar
305 %type <music>   Music Sequential_music Simultaneous_music 
306 %type <music>   relative_music re_rhythmed_music part_combined_music
307 %type <music>   property_def translator_change
308 %type <scm> Music_list
309 %type <outputdef>  music_output_def_body
310 %type <request> shorthand_command_req
311 %type <request> post_request 
312 %type <music> command_req verbose_command_req
313 %type <request> extender_req
314 %type <request> hyphen_req
315 %type <scm>     string bare_number number_expression number_term number_factor 
316
317 %type <score>   score_block score_body
318
319 %type <scm>     translator_spec_block translator_spec_body
320 %type <tempo>   tempo_request
321 %type <scm> notenames_body notenames_block chordmodifiers_block
322 %type <scm>     script_abbreviation
323
324
325
326 %left '-' '+'
327
328 /* We don't assign precedence to / and *, because we might need varied
329 prec levels in different prods */
330
331 %left UNARY_MINUS
332
333 %%
334
335 lilypond:       /* empty */
336         | lilypond toplevel_expression {}
337         | lilypond assignment  { }
338         | lilypond error {
339                 THIS->error_level_i_  = 1;
340         }
341         | lilypond INVALID      {
342                 THIS->error_level_i_  = 1;
343         }
344         ;
345
346 toplevel_expression:
347         notenames_block                 {
348                 THIS->lexer_p_->pitchname_tab_ =  $1;
349         }
350         | chordmodifiers_block                  {
351                 THIS->lexer_p_->chordmodifier_tab_  = $1;
352         }
353         | lilypond_header {
354                 if (global_header_p)
355                         scm_gc_unprotect_object (global_header_p->self_scm ());
356                 global_header_p = $1;
357         }
358         | score_block {
359                 score_global_array.push ($1);
360         }
361         | output_def {
362                 if (dynamic_cast<Paper_def*> ($1))
363                         THIS->lexer_p_->set_identifier (gh_str02scm ("$defaultpaper"), $1->self_scm ());
364                 else if (dynamic_cast<Midi_def*> ($1))
365                         THIS->lexer_p_->set_identifier (gh_str02scm ("$defaultmidi"), $1->self_scm ());
366         }
367         | embedded_scm {
368                 // junk value
369         }       
370         ;
371
372 embedded_scm:
373         SCM_T
374         | SCM_IDENTIFIER 
375         ;
376
377
378 chordmodifiers_block:
379         CHORDMODIFIERS notenames_body   {  $$ = $2; }
380         ;
381
382 notenames_block:
383         PITCHNAMES notenames_body   {  $$ = $2; }
384         ;
385
386 notenames_body:
387         embedded_scm    {
388           int i = scm_ilength ($1);
389
390           SCM tab = scm_make_vector (gh_int2scm (i), SCM_EOL);
391           for (SCM s = $1; gh_pair_p (s); s = ly_cdr (s)) {
392                 SCM pt = ly_cdar (s);
393                 if (!unsmob_pitch (pt))
394                         THIS->parser_error ("Need pitch object.");
395                 else
396                         scm_hashq_set_x (tab, ly_caar (s), pt);
397           }
398
399           $$ = tab;
400         }
401         ;
402
403 lilypond_header_body:
404         {
405                 $$ = new Scheme_hash_table;
406                 THIS->lexer_p_-> scope_l_arr_.push ($$);
407         }
408         | lilypond_header_body assignment  { 
409
410         }
411         ;
412
413 lilypond_header:
414         HEADER '{' lilypond_header_body '}'     {
415                 $$ = $3;
416                 THIS->lexer_p_->scope_l_arr_.pop ();
417         }
418         ;
419
420
421 /*
422         DECLARATIONS
423 */
424 assignment:
425         STRING {
426                 THIS->push_spot ();
427         }
428         /* cont */ '=' identifier_init  {
429
430         /*
431                 Should find generic way of associating input with objects.
432         */
433                 Input ip = THIS->pop_spot ();
434
435                 if (! regular_identifier_b ($1))
436                 {
437                         ip.warning (_ ("Identifier should have  alphabetic characters only"));
438                 }
439
440                 THIS->lexer_p_->set_identifier ($1, $4);
441
442 /*
443  TODO: devise standard for protection in parser.
444
445   The parser stack lives on the C-stack, which means that
446 all objects can be unprotected as soon as they're here.
447
448 */
449         }
450         ;
451
452
453
454 identifier_init:
455         score_block {
456                 $$ = $1->self_scm ();
457                 scm_gc_unprotect_object ($$);
458         }
459         | output_def {
460                 $$ = $1->self_scm ();
461                 scm_gc_unprotect_object ($$);
462         }
463         | translator_spec_block {
464                 $$ = $1;
465         }
466         | Music  {
467                 $$ = $1->self_scm ();
468                 scm_gc_unprotect_object ($$);
469         }
470         | post_request {
471                 $$ = $1->self_scm ();
472                 scm_gc_unprotect_object ($$);
473         }
474         | verbose_duration {
475                 $$ = $1;
476         }
477         | number_expression {
478                 $$ = $1;
479         }
480         | string {
481                 $$ = $1;
482         }
483         | embedded_scm  {
484                 $$ = $1;
485         }
486         ;
487
488 translator_spec_block:
489         TRANSLATOR '{' translator_spec_body '}'
490                 {
491                 $$ = $3;
492         }
493         ;
494
495 translator_spec_body:
496         TRANSLATOR_IDENTIFIER   {
497                 $$ = unsmob_translator_def ($1)->clone_scm ();
498                 unsmob_translator_def ($$)-> set_spot (THIS->here_input ());
499         }
500         | TYPE STRING   {
501                 $$ = Translator_def::make_scm ();
502                 Translator_def*td =  unsmob_translator_def ($$);
503                 td->translator_group_type_ = $2;
504                 td->set_spot (THIS->here_input ());
505         }
506         | translator_spec_body STRING '=' embedded_scm                  {
507                 unsmob_translator_def ($$)->add_property_assign ($2, $4);
508         }
509         | translator_spec_body STRING OVERRIDE embedded_scm '=' embedded_scm {
510                 unsmob_translator_def ($$)
511                         ->add_push_property (scm_string_to_symbol ($2), $4, $6);
512         }
513         | translator_spec_body STRING REVERT embedded_scm  {
514           unsmob_translator_def ($$)->add_pop_property (
515                 scm_string_to_symbol ($2), $4);
516         }
517         | translator_spec_body NAME STRING  {
518                 unsmob_translator_def ($$)->type_name_ = $3;
519         }
520         | translator_spec_body CONSISTS STRING  {
521                 unsmob_translator_def ($$)->add_element ($3);
522         }
523         | translator_spec_body ALIAS STRING  {
524                 Translator_def*td = unsmob_translator_def ($$);
525                 td->type_aliases_ = gh_cons ($3, td->type_aliases_);
526         }
527         | translator_spec_body GROBDESCRIPTIONS embedded_scm {
528                 Translator_def*td = unsmob_translator_def($$);
529                 // td->add_property_assign (ly_symbol2scm ("allGrobDescriptions"), $3);
530                 for (SCM p = $3; gh_pair_p (p); p = ly_cdr (p))
531                         td->add_property_assign (scm_symbol_to_string (ly_caar (p)), ly_cdar (p));
532         }
533         | translator_spec_body CONSISTSEND STRING  {
534                 unsmob_translator_def ($$)->add_last_element ( $3);
535         }
536         | translator_spec_body ACCEPTS STRING  {
537                 unsmob_translator_def ($$)->set_acceptor ($3,true);
538         }
539         | translator_spec_body DENIES STRING  {
540                 unsmob_translator_def ($$)->set_acceptor ($3,false);
541         }
542         | translator_spec_body REMOVE STRING  {
543                 unsmob_translator_def ($$)->remove_element ($3);
544         }
545         ;
546
547 /*
548         SCORE
549 */
550 score_block:
551         SCORE { 
552                 THIS->push_spot ();
553         }
554         /*cont*/ '{' score_body '}'     {
555                 THIS->pop_spot ();
556                 $$ = $4;
557                 if (!$$->def_p_arr_.size ())
558                 {
559                   Music_output_def *id =
560                         unsmob_music_output_def (THIS->lexer_p_->lookup_identifier ("$defaultpaper"));
561                   $$->add_output (id ? id->clone () :  new Paper_def );
562                 }
563         }
564         ;
565
566 score_body:
567         Music   {
568                 $$ = new Score;
569         
570                 $$->set_spot (THIS->here_input ());
571                 SCM m = $1->self_scm ();
572                 scm_gc_unprotect_object (m);
573
574                 /*
575                         guh.
576                 */
577                 SCM check_funcs = scm_c_eval_string ("toplevel-music-functions");
578                 for (; gh_pair_p (check_funcs); check_funcs = gh_cdr (check_funcs))
579                         m = gh_call1 (gh_car (check_funcs), m);
580                 $$->music_ = m;
581
582         }
583         | SCORE_IDENTIFIER {
584                 $$ = new Score (*unsmob_score ($1));
585                 $$->set_spot (THIS->here_input ());
586         }
587         | score_body lilypond_header    {
588                 scm_gc_unprotect_object ($2->self_scm ()); 
589                 $$->header_p_ = $2;
590         }
591         | score_body output_def {
592                 $$->add_output ($2);
593         }
594         | score_body error {
595
596         }
597         ;
598
599
600 /*
601         MIDI
602 */
603 output_def:
604         music_output_def_body '}' {
605                 $$ = $1;
606                 THIS-> lexer_p_-> scope_l_arr_.pop ();
607         }
608         ;
609
610 music_output_def_body:
611         MIDI '{'    {
612            Music_output_def *id = unsmob_music_output_def (THIS->lexer_p_->lookup_identifier ("$defaultmidi"));
613
614                 
615          Midi_def* p =0;
616         if (id)
617                 p = dynamic_cast<Midi_def*> (id->clone ());
618         else
619                 p = new Midi_def;
620
621          $$ = p;
622          THIS->lexer_p_->scope_l_arr_.push (p->variable_tab_);
623         }
624         | PAPER '{'     {
625                 Music_output_def *id = unsmob_music_output_def (THIS->lexer_p_->lookup_identifier ("$defaultpaper"));
626                   Paper_def *p = 0;
627                 if (id)
628                         p = dynamic_cast<Paper_def*> (id->clone ());
629                 else
630                         p = new Paper_def;
631                 THIS-> lexer_p_-> scope_l_arr_.push (p->variable_tab_);
632                 $$ = p;
633         }
634         | PAPER '{' MUSIC_OUTPUT_DEF_IDENTIFIER         {
635                 Music_output_def *p = unsmob_music_output_def ($3);
636                 p = p->clone ();
637                 THIS->lexer_p_->scope_l_arr_.push (p->variable_tab_);
638                 $$ = p;
639         }
640         | MIDI '{' MUSIC_OUTPUT_DEF_IDENTIFIER  {
641                 Music_output_def *p = unsmob_music_output_def ($3);
642                 p = p->clone ();
643
644                 THIS->lexer_p_->scope_l_arr_.push (p->variable_tab_);
645                 $$ = p;
646         }
647         | music_output_def_body assignment  {
648
649         }
650         | music_output_def_body translator_spec_block   {
651                 $$->assign_translator ($2);
652         }
653         | music_output_def_body STYLESHEET embedded_scm {
654                 dynamic_cast<Paper_def*> ($$)-> style_sheet_ = $3;
655         }
656         | music_output_def_body tempo_request  {
657                 /*
658                         junk this ? there already is tempo stuff in
659                         music.
660                 */
661                 int m = gh_scm2int ( $2->get_mus_property ("metronome-count"));
662                 Duration *d = unsmob_duration ($2->get_mus_property ("duration"));
663                 Midi_def * md = dynamic_cast<Midi_def*> ($$);
664                 if (md)
665                         md->set_tempo (d->length_mom (), m);
666         }
667         | music_output_def_body error {
668
669         }
670         ;
671
672 tempo_request:
673         TEMPO steno_duration '=' bare_unsigned  {
674                 $$ = new Tempo_req;
675                 $$->set_mus_property ("duration", $2);
676                 $$->set_mus_property ("metronome-count", gh_int2scm ( $4));
677         }
678         ;
679
680 /*
681 The representation of a  list is the
682
683   (LIST . LAST-CONS)
684
685  to have  efficient append.
686 */
687 Music_list: /* empty */ {
688                 $$ = gh_cons (SCM_EOL, SCM_EOL);
689         }
690         | Music_list Music {
691                 SCM s = $$;
692                 SCM c = gh_cons ($2->self_scm (), SCM_EOL);
693                 scm_gc_unprotect_object ($2->self_scm ()); /* UGH */
694                 if (gh_pair_p (ly_cdr (s)))
695                         gh_set_cdr_x (ly_cdr (s), c); /* append */
696                 else
697                         gh_set_car_x (s, c); /* set first cons */
698                 gh_set_cdr_x (s, c) ;  /* remember last cell */ 
699         }
700         | Music_list error {
701         }
702         ;
703
704
705 Music:
706         Simple_music
707         | Composite_music
708         ;
709
710 Alternative_music:
711         /* empty */ {
712                 $$ = SCM_EOL;
713         }
714         | ALTERNATIVE '{' Music_list '}' {
715                 $$ = $3;
716         }
717         ;
718
719 Repeated_music:
720         REPEAT string bare_unsigned Music Alternative_music
721         {
722                 Music *beg = $4;
723                 int times = $3;
724                 SCM alts = gh_pair_p ($5) ? gh_car ($5) : SCM_EOL;
725                 if (times < scm_ilength (alts)) {
726                   unsmob_music (gh_car (alts))
727                     ->origin ()->warning (
728                     _("More alternatives than repeats.  Junking excess alternatives."));
729                   alts = ly_truncate_list (times, alts);
730                 }
731
732                 Repeated_music * r = new Repeated_music (SCM_EOL);
733                 if (beg)
734                         {
735                         r-> set_mus_property ("element", beg->self_scm ());
736                         scm_gc_unprotect_object (beg->self_scm ());
737                         }
738                 r->set_mus_property ("repeat-count", gh_int2scm (times >? 1));
739
740                 r-> set_mus_property ("elements",alts);
741                 SCM func = scm_primitive_eval (ly_symbol2scm ("repeat-name-to-ctor"));
742                 SCM result = gh_call1 (func, $2);
743
744                 set_music_properties (r, result);
745
746                 r->set_spot (*$4->origin ());
747                 $$ = r;
748         }
749         ;
750
751 Sequential_music:
752         SEQUENTIAL '{' Music_list '}'           {
753                 $$ = new Sequential_music (SCM_EOL);
754                 $$->set_mus_property ("elements", ly_car ($3));
755                 $$->set_spot(THIS->here_input());
756         }
757         | '{' Music_list '}'            {
758                 $$ = new Sequential_music (SCM_EOL);
759                 $$->set_mus_property ("elements", ly_car ($2));
760                 $$->set_spot(THIS->here_input());
761         }
762         ;
763
764 Simultaneous_music:
765         SIMULTANEOUS '{' Music_list '}'{
766                 $$ = new Simultaneous_music (SCM_EOL);
767                 $$->set_mus_property ("elements", ly_car ($3));
768                 $$->set_spot(THIS->here_input());
769
770         }
771         | '<' Music_list '>'    {
772                 $$ = new Simultaneous_music (SCM_EOL);
773                 $$->set_mus_property ("elements", ly_car ($2));
774                 $$->set_spot(THIS->here_input());
775         }
776         ;
777
778 Simple_music:
779         request_chord           { $$ = $1; }
780         | OUTPUTPROPERTY embedded_scm embedded_scm '=' embedded_scm     {
781                 SCM pred = $2;
782                 if (!gh_symbol_p ($3))
783                 {
784                         THIS->parser_error (_ ("Second argument must be a symbol")); 
785                 }
786                 /*hould check # args */
787                 if (!gh_procedure_p (pred))
788                 {
789                         THIS->parser_error (_ ("First argument must be a procedure taking 1 argument"));
790                 }
791
792                 Music *m = new Music (SCM_EOL);
793                 m->set_mus_property ("predicate", pred);
794                 m->set_mus_property ("grob-property", $3);
795                 m->set_mus_property ("grob-value",  $5);
796                 m->set_mus_property ("iterator-ctor",
797                 Output_property_music_iterator::constructor_cxx_function);
798
799                 $$ = m;
800         }
801         | MUSIC_IDENTIFIER {
802                 $$ = unsmob_music ($1)->clone ();
803
804                 $$->set_spot (THIS->here_input());
805         }
806         | property_def
807         | translator_change
808         ;
809
810
811 Composite_music:
812         CONTEXT STRING Music    {
813                 Context_specced_music *csm =  new Context_specced_music (SCM_EOL);
814                 csm->set_mus_property ("element", $3->self_scm ());
815                 scm_gc_unprotect_object ($3->self_scm ());
816
817                 csm->set_mus_property ("context-type",$2);
818                 csm->set_mus_property ("context-id", ly_str02scm (""));
819
820                 $$ = csm;
821         }
822         | AUTOCHANGE STRING Music       {
823                 Music * chm = new Music_wrapper (SCM_EOL);
824                 chm->set_mus_property ("element", $3->self_scm ());
825                 chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_cxx_function);
826
827                 scm_gc_unprotect_object ($3->self_scm ());
828                 chm->set_mus_property ("what", $2); 
829
830                 $$ = chm;
831                 chm->set_spot (*$3->origin ());
832         }
833         | GRACE Music {
834 #if 1
835         /*
836                 The other version is for easier debugging  of
837                 Sequential_music_iterator in combination with grace notes.
838         */
839
840                 SCM start = THIS->lexer_p_->lookup_identifier ("startGraceMusic");
841                 SCM stop = THIS->lexer_p_->lookup_identifier ("stopGraceMusic");
842                 Music *startm = unsmob_music (start);
843                 Music *stopm = unsmob_music (stop);
844
845                 SCM ms = SCM_EOL;
846                 if (stopm) {
847                         stopm = stopm->clone ();
848                         ms = gh_cons (stopm->self_scm (), ms);
849                         scm_gc_unprotect_object (stopm->self_scm ());
850                 }
851                 ms = gh_cons ($2->self_scm (), ms);
852                 scm_gc_unprotect_object ($2->self_scm());
853                 if (startm) {
854                         startm = startm->clone ();
855                         ms = gh_cons (startm->self_scm () , ms);
856                         scm_gc_unprotect_object (startm->self_scm ());
857                 }
858
859                 Music* seq = new Sequential_music (SCM_EOL);
860                 seq->set_mus_property ("elements", ms);
861
862                 $$ = new Grace_music (SCM_EOL);
863                 $$->set_mus_property ("element", seq->self_scm ());
864                 scm_gc_unprotect_object (seq->self_scm ());
865 #else
866                 $$ = new Grace_music (SCM_EOL);
867                 $$->set_mus_property ("element", $2->self_scm ());
868                 scm_gc_unprotect_object ($2->self_scm ());
869 #endif
870         }
871         | CONTEXT string '=' string Music {
872                 Context_specced_music *csm =  new Context_specced_music (SCM_EOL);
873                 csm->set_mus_property ("element", $5->self_scm ());
874                 scm_gc_unprotect_object ($5->self_scm ());
875
876                 csm->set_mus_property ("context-type", $2);
877                 csm->set_mus_property ("context-id", $4);
878
879                 $$ = csm;
880         }
881         | TIMES {
882                 THIS->push_spot ();
883         }
884         /* CONTINUED */ 
885                 fraction Music  
886
887         {
888                 int n = gh_scm2int (ly_car ($3)); int d = gh_scm2int (ly_cdr ($3));
889                 Music *mp = $4;
890                 $$ = new Time_scaled_music (SCM_EOL);
891                 $$->set_spot (THIS->pop_spot ());
892
893
894                 $$->set_mus_property ("element", mp->self_scm ());
895                 scm_gc_unprotect_object (mp->self_scm ());
896                 $$->set_mus_property ("numerator", gh_int2scm (n));
897                 $$->set_mus_property ("denominator", gh_int2scm (d));
898                 $$->compress (Moment (Rational (n,d)));
899
900         }
901         | Repeated_music                { $$ = $1; }
902         | Simultaneous_music            { $$ = $1; }
903         | Sequential_music              { $$ = $1; }
904         | TRANSPOSE pitch Music {
905                 $$ = new Transposed_music (SCM_EOL);
906                 Music *p = $3;
907                 Pitch pit = *unsmob_pitch ($2);
908
909                 p->transpose (pit);
910                 $$->set_mus_property ("element", p->self_scm ());
911                 scm_gc_unprotect_object (p->self_scm ());
912         }
913         | TRANSPOSE steno_tonic_pitch Music {
914                 $$ = new Transposed_music (SCM_EOL);
915                 Music *p = $3;
916                 Pitch pit = *unsmob_pitch ($2);
917
918                 p->transpose (pit);
919                 $$->set_mus_property ("element", p->self_scm ());
920                 scm_gc_unprotect_object (p->self_scm ());
921         
922         }
923         | APPLY embedded_scm Music  {
924                 SCM ret = gh_call1 ($2, $3->self_scm ());
925                 Music *m = unsmob_music (ret);
926                 if (!m) {
927                         THIS->parser_error ("\\apply must return a Music");
928                         m = new Music (SCM_EOL);
929                         }
930                 $$ = m;
931         }
932         | NOTES
933                 { THIS->lexer_p_->push_note_state (); }
934         Music
935                 { $$ = $3;
936                   THIS->lexer_p_->pop_state ();
937                 }
938         | FIGURES
939                 { THIS->lexer_p_->push_figuredbass_state (); }
940         Music
941                 {
942                   Music * chm = new Untransposable_music () ;
943                   chm->set_mus_property ("element", $3->self_scm ());
944                   $$ = chm;
945                   scm_gc_unprotect_object ($3->self_scm());
946
947                   THIS->lexer_p_->pop_state ();
948         }
949         | CHORDS
950                 { THIS->lexer_p_->push_chord_state (); }
951         Music
952                 {
953                   Music * chm = new Un_relativable_music ;
954                   chm->set_mus_property ("element", $3->self_scm ());
955                   scm_gc_unprotect_object ($3->self_scm());
956                   $$ = chm;
957
958                   THIS->lexer_p_->pop_state ();
959         }
960         | LYRICS
961                 { THIS->lexer_p_->push_lyric_state (); }
962         Music
963                 {
964                   $$ = $3;
965                   THIS->lexer_p_->pop_state ();
966         }
967         | relative_music        { $$ = $1; }
968         | re_rhythmed_music     { $$ = $1; } 
969         | part_combined_music   { $$ = $1; } 
970         ;
971
972 relative_music:
973         RELATIVE absolute_pitch Music {
974                 Music * p = $3;
975                 Pitch pit = *unsmob_pitch ($2);
976                 $$ = new Relative_octave_music (SCM_EOL);
977
978                 $$->set_mus_property ("element", p->self_scm ());
979                 scm_gc_unprotect_object (p->self_scm ());
980
981                 $$->set_mus_property ("last-pitch", p->to_relative_octave (pit).smobbed_copy ());
982
983         }
984         ;
985
986 re_rhythmed_music:
987         ADDLYRICS Music Music {
988           Lyric_combine_music * l = new Lyric_combine_music (SCM_EOL);
989           l->set_mus_property ("elements", gh_list ($2->self_scm (), $3->self_scm (), SCM_UNDEFINED));
990           scm_gc_unprotect_object ($3->self_scm ());
991           scm_gc_unprotect_object ($2->self_scm ());
992           $$ = l;
993         }
994         ;
995
996 part_combined_music:
997         PARTCOMBINE STRING Music Music {
998                 Part_combine_music * p = new Part_combine_music (SCM_EOL);
999
1000                 p->set_mus_property ("what", $2);
1001                 p->set_mus_property ("elements", gh_list ($3->self_scm (),$4->self_scm (), SCM_UNDEFINED));  
1002
1003                 scm_gc_unprotect_object ($3->self_scm ());
1004                 scm_gc_unprotect_object ($4->self_scm ());  
1005
1006                 $$ = p;
1007         }
1008         ;
1009
1010 translator_change:
1011         TRANSLATOR STRING '=' STRING  {
1012                 Music * t = new Music (SCM_EOL);
1013                 t->set_mus_property ("iterator-ctor",
1014                         Change_iterator::constructor_cxx_function);
1015                 t-> set_mus_property ("change-to-type", $2);
1016                 t-> set_mus_property ("change-to-id", $4);
1017
1018                 $$ = t;
1019                 $$->set_spot (THIS->here_input ());
1020         }
1021         ;
1022
1023 property_def:
1024         PROPERTY STRING '.' STRING '='  scalar {
1025                 
1026                 Music *t = set_property_music (scm_string_to_symbol ($4), $6);
1027                 Context_specced_music *csm = new Context_specced_music (SCM_EOL);
1028
1029                 csm->set_mus_property ("element", t->self_scm ());
1030                 scm_gc_unprotect_object (t->self_scm ());
1031
1032                 $$ = csm;
1033                 $$->set_spot (THIS->here_input ());
1034
1035                 csm-> set_mus_property ("context-type", $2);
1036         }
1037         | PROPERTY STRING '.' STRING UNSET {
1038                 Music *t = new Music (SCM_EOL);
1039
1040                 t->set_mus_property ("iterator-ctor",
1041                         Property_unset_iterator::constructor_cxx_function);
1042                 t->set_mus_property ("symbol", scm_string_to_symbol ($4));
1043
1044                 Context_specced_music *csm = new Context_specced_music (SCM_EOL);
1045                 csm->set_mus_property ("element", t->self_scm ());
1046                 scm_gc_unprotect_object (t->self_scm ());
1047
1048                 $$ = csm;
1049                 $$->set_spot (THIS->here_input ());
1050
1051                 csm-> set_mus_property ("context-type", $2);
1052         }
1053         | PROPERTY STRING '.' STRING SET embedded_scm '=' embedded_scm {
1054                 Music *t = new Music (SCM_EOL);
1055                 t->set_mus_property ("iterator-ctor",
1056                         Push_property_iterator::constructor_cxx_function);
1057                 t->set_mus_property ("symbol", scm_string_to_symbol ($4));
1058                 t->set_mus_property ("pop-first", SCM_BOOL_T);
1059                 t->set_mus_property ("grob-property", $6);
1060                 t->set_mus_property ("grob-value", $8);
1061                 Context_specced_music *csm = new Context_specced_music (SCM_EOL);
1062                 csm->set_mus_property ("element", t->self_scm ());
1063                 scm_gc_unprotect_object (t->self_scm ());
1064                 $$ = csm;
1065                 $$->set_spot (THIS->here_input ());
1066
1067                 csm-> set_mus_property ("context-type", $2);
1068         }
1069         | PROPERTY STRING '.' STRING OVERRIDE embedded_scm '=' embedded_scm {
1070                 Music *t = new Music (SCM_EOL);
1071                 t->set_mus_property ("iterator-ctor",
1072                         Push_property_iterator::constructor_cxx_function);
1073                 t->set_mus_property ("symbol", scm_string_to_symbol ($4));
1074                 t->set_mus_property ("grob-property", $6);
1075                 t->set_mus_property ("grob-value", $8);
1076                 Context_specced_music *csm = new Context_specced_music (SCM_EOL);
1077                 csm->set_mus_property ("element", t->self_scm ());
1078                 scm_gc_unprotect_object (t->self_scm ());
1079
1080                 $$ = csm;
1081                 $$->set_spot (THIS->here_input ());
1082
1083                 csm-> set_mus_property ("context-type", $2);
1084         }
1085         | PROPERTY STRING '.' STRING REVERT embedded_scm {
1086                 Music *t = new Music (SCM_EOL);
1087                 t->set_mus_property ("iterator-ctor",
1088                         Pop_property_iterator::constructor_cxx_function);
1089                 t->set_mus_property ("symbol", scm_string_to_symbol ($4));
1090                 t->set_mus_property ("grob-property", $6);
1091
1092                 Context_specced_music *csm = new Context_specced_music (SCM_EOL);
1093                 csm->set_mus_property ("element", t->self_scm ());
1094                 scm_gc_unprotect_object (t->self_scm ());
1095
1096                 $$ = csm;
1097                 $$->set_spot (THIS->here_input ());
1098
1099                 csm-> set_mus_property ("context-type", $2);
1100         }
1101         ;
1102
1103 scalar:
1104         string          { $$ = $1; }
1105         | bare_int      { $$ = gh_int2scm ($1); }
1106         | embedded_scm  { $$ = $1; }
1107         ;
1108
1109
1110 request_chord:
1111         pre_requests {
1112                 THIS->push_spot ();
1113         } /*cont */ simple_element post_requests        {
1114                 Music_sequence *l = dynamic_cast<Music_sequence*> ($3);
1115                 
1116                 $1->concat (*$4);
1117                 for (int i=0; i < $1->size (); i++) {
1118                   Music * m = $1->elem (i);
1119                   l->append_music (m);
1120                 }
1121                 $$ = $3;
1122
1123                 delete $1;
1124                 delete $4;
1125         }
1126         | command_element
1127         ;
1128
1129 command_element:
1130         command_req {
1131                 $$ = new Request_chord (SCM_EOL);
1132                 $$->set_mus_property ("elements", gh_cons ($1->self_scm (), SCM_EOL));
1133           scm_gc_unprotect_object ($1->self_scm());
1134
1135                 $$-> set_spot (THIS->here_input ());
1136                 $1-> set_spot (THIS->here_input ());
1137         }
1138         | E_LEFTSQUARE {
1139                 Span_req *l = new Span_req;
1140                 l->set_span_dir (START);
1141                 l->set_mus_property ("span-type", ly_str02scm ("ligature"));
1142                 l->set_spot (THIS->here_input ());
1143
1144                 $$ = new Request_chord (SCM_EOL);
1145                 $$->set_mus_property ("elements", gh_cons (l->self_scm (), SCM_EOL));
1146           scm_gc_unprotect_object (l->self_scm());
1147                 $$->set_spot (THIS->here_input ());
1148         }
1149         | E_RIGHTSQUARE {
1150                 Span_req *l = new Span_req;
1151                 l->set_span_dir (STOP);
1152                 l->set_mus_property ("span-type", ly_str02scm ("ligature"));
1153                 l->set_spot (THIS->here_input ());
1154
1155                 $$ = new Request_chord (SCM_EOL);
1156                 $$->set_mus_property ("elements", gh_cons (l->self_scm (), SCM_EOL));
1157                 $$->set_spot (THIS->here_input ());
1158           scm_gc_unprotect_object (l->self_scm());
1159
1160         }
1161         | E_BACKSLASH {
1162                 $$ = new Music (gh_list (gh_cons (ly_symbol2scm ("name"), ly_symbol2scm ("separator")), SCM_UNDEFINED));
1163                 $$->set_spot (THIS->here_input ());
1164         }
1165         | '|'      {
1166
1167                 extern Music * get_barcheck();
1168                 $$ = get_barcheck ();
1169                 $$->set_spot (THIS->here_input ());
1170         }
1171         | BAR STRING                    {
1172                 Music *t = set_property_music (ly_symbol2scm ("whichBar"), $2);
1173
1174                 Context_specced_music *csm = new Context_specced_music (SCM_EOL);
1175                 csm->set_mus_property ("element", t->self_scm ());
1176                 scm_gc_unprotect_object (t->self_scm ());
1177
1178                 $$ = csm;
1179                 $$->set_spot (THIS->here_input ());
1180
1181                 csm->set_mus_property ("context-type", ly_str02scm ("Score"));
1182         }
1183         | PARTIAL duration_length       {
1184                 Moment m = - unsmob_duration ($2)->length_mom ();
1185                 Music * p = set_property_music (ly_symbol2scm ( "measurePosition"),m.smobbed_copy ());
1186
1187                 Context_specced_music * sp = new Context_specced_music (SCM_EOL);
1188                 sp->set_mus_property ("element", p->self_scm ());
1189                 scm_gc_unprotect_object (p->self_scm ());
1190
1191                 $$ =sp ;
1192                 sp-> set_mus_property ("context-type", ly_str02scm ( "Score"));
1193         }
1194         | CLEF STRING  {
1195                 SCM func = scm_primitive_eval (ly_symbol2scm ("clef-name-to-properties"));
1196                 SCM result = gh_call1 (func, $2);
1197
1198                 SCM l = SCM_EOL;
1199                 for (SCM s = result ; gh_pair_p (s); s = ly_cdr (s)) {
1200                         Music * p = new Music (SCM_EOL);
1201                         set_music_properties (p, ly_car (s));
1202                         l = gh_cons (p->self_scm (), l);
1203                         scm_gc_unprotect_object (p->self_scm ());
1204                 }
1205                 Sequential_music * seq = new Sequential_music (SCM_EOL);
1206                 seq->set_mus_property ("elements", l);
1207
1208                 Context_specced_music * sp = new Context_specced_music (SCM_EOL);
1209                 sp->set_mus_property ("element", seq->self_scm ());
1210                 scm_gc_unprotect_object (seq->self_scm ());
1211
1212                 $$ =sp ;
1213                 sp-> set_mus_property ("context-type", ly_str02scm ("Staff"));
1214         }
1215         | TIME_T fraction  {
1216                 Music * p1 = set_property_music (ly_symbol2scm ( "timeSignatureFraction"), $2);
1217
1218                 int l = gh_scm2int (ly_car ($2));
1219                 int o = gh_scm2int (ly_cdr ($2));
1220
1221                 Moment one_beat = Moment (1)/Moment (o);
1222                 Moment len = Moment (l) * one_beat;
1223
1224
1225                 Music *p2 = set_property_music (ly_symbol2scm ("measureLength"), len.smobbed_copy ());
1226                 Music *p3 = set_property_music (ly_symbol2scm ("beatLength"), one_beat.smobbed_copy ());
1227
1228                 SCM list = scm_list_n (p1->self_scm (), p2->self_scm (), p3->self_scm(), SCM_UNDEFINED);
1229                 Sequential_music *seq = new Sequential_music (SCM_EOL);
1230                 seq->set_mus_property ("elements", list);
1231                 
1232
1233                 Context_specced_music * sp = new Context_specced_music (SCM_EOL);
1234                 sp->set_mus_property ("element", seq->self_scm ());
1235
1236                 
1237
1238                 scm_gc_unprotect_object (p3->self_scm ());
1239                 scm_gc_unprotect_object (p2->self_scm ());
1240                 scm_gc_unprotect_object (p1->self_scm ());
1241                 scm_gc_unprotect_object (seq->self_scm ());
1242
1243                 $$ = sp;
1244
1245 /*
1246  TODO: should make alias TimingContext for Score
1247 */
1248
1249                 sp-> set_mus_property ("context-type", ly_str02scm ( "Score"));
1250         }
1251         ;
1252
1253 command_req:
1254         shorthand_command_req   { $$ = $1; }
1255         | verbose_command_req   { $$ = $1; }
1256         ;
1257
1258 shorthand_command_req:
1259         extender_req {
1260                 $$ = $1;
1261         }
1262         | hyphen_req {
1263                 $$ = $1;
1264         }
1265         | '~'   {
1266                 $$ = new Tie_req;
1267         }
1268         | '['           {
1269                 Span_req*b= new Span_req;
1270                 b->set_span_dir (START);
1271                 b->set_mus_property ("span-type", ly_str02scm ("beam"));
1272                 $$ =b;
1273
1274
1275                 THIS->last_beam_start_ = b->self_scm ();
1276         }
1277         | ']'           {
1278                 Span_req*b= new Span_req;
1279                 b->set_span_dir ( STOP);
1280                 b->set_mus_property ("span-type", ly_str02scm ("beam"));
1281                 $$ = b;
1282         }
1283         | BREATHE {
1284                 $$ = new Breathing_sign_req;
1285         }
1286         | E_TILDE {
1287                 $$ = new Porrectus_req;
1288         }
1289         ;
1290
1291 verbose_command_req:
1292         COMMANDSPANREQUEST bare_int STRING { /*TODO: junkme */
1293                 Span_req * sp_p = new Span_req;
1294                 sp_p-> set_span_dir ( Direction ($2));
1295                 sp_p->set_mus_property ("span-type",$3);
1296                 sp_p->set_spot (THIS->here_input ());
1297                 $$ = sp_p;
1298         }
1299         | MARK DEFAULT  {
1300                 Mark_req * m = new Mark_req;
1301                 $$ = m;
1302         }
1303         | MARK scalar {
1304                 Mark_req *m = new Mark_req;
1305                 m->set_mus_property ("label", $2);
1306                 $$ = m;
1307
1308         }
1309         | PENALTY SCM_T         {
1310                 Break_req * b = new Break_req;
1311                 SCM s = $2;
1312                 if (!gh_number_p (s))
1313                         s  =gh_int2scm (0);
1314
1315                 b->set_mus_property ("penalty", s);
1316                 b->set_spot (THIS->here_input ());
1317                 $$ = b;
1318         }
1319         | SKIP duration_length {
1320                 Skip_req * skip_p = new Skip_req;
1321                 skip_p->set_mus_property ("duration", $2);
1322
1323                 $$ = skip_p;
1324         }
1325         | tempo_request {
1326                 $$ = $1;
1327         }
1328         | KEY DEFAULT {
1329                 Key_change_req *key_p= new Key_change_req;
1330                 $$ = key_p;
1331         }
1332         | KEY NOTENAME_PITCH SCM_IDENTIFIER     {
1333                 Key_change_req *key_p= new Key_change_req;
1334                 
1335                 key_p->set_mus_property ("pitch-alist", $3);
1336                 ((Music*)key_p)->transpose (* unsmob_pitch ($2));
1337                 $$ = key_p; 
1338         }
1339         ;
1340
1341 post_requests:
1342         {
1343                 $$ = new Link_array<Request>;
1344         }
1345         | post_requests post_request {
1346                 $2->set_spot (THIS->here_input ());
1347                 $$->push ($2);
1348         }
1349         ;
1350
1351 post_request:
1352         verbose_request
1353         | request_with_dir
1354         | close_request
1355         ;
1356
1357
1358 request_that_take_dir:
1359         gen_text_def
1360         | verbose_request
1361         | script_abbreviation {
1362                 SCM s = THIS->lexer_p_->lookup_identifier ("dash" + ly_scm2string ($1));
1363                 Articulation_req *a = new Articulation_req;
1364                 if (gh_string_p (s))
1365                         a->set_mus_property ("articulation-type", s);
1366                 else THIS->parser_error (_ ("Expecting string as script definition"));
1367                 $$ = a;
1368         }
1369         ;
1370
1371 request_with_dir:
1372         script_dir request_that_take_dir        {
1373                 if (Script_req * gs = dynamic_cast<Script_req*> ($2))
1374                         gs->set_direction (Direction ($1));
1375                 else if ($1)
1376                         $2->origin ()->warning (_ ("Can't specify direction for this request"));
1377                 $$ = $2;
1378         }
1379         ;
1380         
1381 verbose_request:
1382         REQUEST_IDENTIFIER      {
1383                 $$ = dynamic_cast<Request*> (unsmob_music ($1)->clone ());
1384                 $$->set_spot (THIS->here_input ());
1385         }
1386         | DYNAMICSCRIPT embedded_scm {
1387                 /*
1388                         TODO: junkme, use text-type == dynamic
1389                 */
1390                 Text_script_req *d = new Text_script_req;
1391                 SCM dyn = ly_symbol2scm ("dynamic");
1392                 d->set_mus_property ("text-type" , dyn);
1393                 d->set_mus_property ("text", $2);
1394                 d->set_spot (THIS->here_input ());
1395                 $$ = d;
1396         }
1397         | SPANREQUEST bare_int STRING {
1398                 Span_req * sp_p = new Span_req;
1399                 sp_p->set_span_dir ( Direction ($2));
1400                 sp_p->set_mus_property ("span-type", $3);
1401                 sp_p->set_spot (THIS->here_input ());
1402                 $$ = sp_p;
1403         }
1404         | tremolo_type  {
1405                Tremolo_req* a = new Tremolo_req;
1406                a->set_spot (THIS->here_input ());
1407                a->set_mus_property ("tremolo-type", gh_int2scm ($1));
1408                $$ = a;
1409         }
1410         | SCRIPT STRING         { 
1411                 Articulation_req * a = new Articulation_req;
1412                 a->set_mus_property ("articulation-type", $2);
1413                 a->set_spot (THIS->here_input ());
1414                 $$ = a;
1415         }
1416         /*
1417 duh, junk this syntax from the parser, if possible. 
1418         */
1419         | ARPEGGIO {
1420                 Arpeggio_req *a = new Arpeggio_req;
1421                 a->set_spot (THIS->here_input ());
1422                 $$ = a;
1423         }
1424         | GLISSANDO {
1425                 Glissando_req *g = new Glissando_req;
1426                 g->set_spot /* No pun intended */ (THIS->here_input ());
1427                 $$ = g;
1428         }       
1429         ;
1430
1431 sup_quotes:
1432         '\'' {
1433                 $$ = 1;
1434         }
1435         | sup_quotes '\'' {
1436                 $$ ++;
1437         }
1438         ;
1439
1440 sub_quotes:
1441         ',' {
1442                 $$ = 1;
1443         }
1444         | sub_quotes ',' {
1445                 $$ ++ ;
1446         }
1447         ;
1448
1449 steno_pitch:
1450         NOTENAME_PITCH  {
1451                 $$ = $1;
1452         }
1453         | NOTENAME_PITCH sup_quotes     {
1454                 Pitch p = *unsmob_pitch ($1);
1455                 p.octave_i_ +=  $2;
1456                 $$ = p.smobbed_copy ();
1457         }
1458         | NOTENAME_PITCH sub_quotes      {
1459                 Pitch p =* unsmob_pitch ($1);
1460
1461                 p.octave_i_ +=  -$2;
1462                 $$ = p.smobbed_copy ();
1463
1464         }
1465         ;
1466
1467 /*
1468 ugh. duplication
1469 */
1470
1471 steno_tonic_pitch:
1472         TONICNAME_PITCH {
1473                 $$ = $1;
1474         }
1475         | TONICNAME_PITCH sup_quotes    {
1476                 Pitch p = *unsmob_pitch ($1);
1477                 p.octave_i_ +=  $2;
1478                 $$ = p.smobbed_copy ();
1479         }
1480         | TONICNAME_PITCH sub_quotes     {
1481                 Pitch p =* unsmob_pitch ($1);
1482
1483                 p.octave_i_ +=  -$2;
1484                 $$ = p.smobbed_copy ();
1485
1486         }
1487         ;
1488
1489 pitch:
1490         steno_pitch {
1491                 $$ = $1;
1492         }
1493         | explicit_pitch {
1494                 $$ = $1;
1495         }
1496         ;
1497
1498 explicit_pitch:
1499         PITCH embedded_scm {
1500                 $$ = $2;
1501                 if (!unsmob_pitch ($2)) {
1502                         THIS->parser_error (_f ("Expecting musical-pitch value", 3));
1503                          $$ = Pitch ().smobbed_copy ();
1504                 }
1505         }
1506         ;
1507
1508 verbose_duration:
1509         DURATION embedded_scm   {
1510                 $$ = $2;
1511                 if (!unsmob_duration ($2))
1512                 {
1513                         THIS->parser_error (_ ("Must have duration object"));
1514                         $$ = Duration ().smobbed_copy ();
1515                 }
1516         }
1517         ;
1518
1519 extender_req:
1520         EXTENDER {
1521                 if (!THIS->lexer_p_->lyric_state_b ())
1522                         THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
1523                 $$ = new Extender_req;
1524         }
1525         ;
1526
1527 hyphen_req:
1528         HYPHEN {
1529                 if (!THIS->lexer_p_->lyric_state_b ())
1530                         THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
1531                 $$ = new Hyphen_req;
1532         }
1533         ;
1534
1535 close_request:
1536         close_request_parens {
1537                 $$ = $1;
1538                 dynamic_cast<Span_req*> ($$)->set_span_dir ( START);
1539         }
1540         ;
1541  
1542 close_request_parens:
1543         '('     {
1544                 Span_req* s= new Span_req;
1545                 $$ = s;
1546                 s->set_mus_property ("span-type", ly_str02scm ( "slur"));
1547                 s->set_spot (THIS->here_input());
1548         }
1549         | E_OPEN        {
1550                 Span_req* s= new Span_req;
1551                 $$ = s;
1552                 s->set_mus_property ("span-type", ly_str02scm ( "phrasing-slur"));
1553                 s->set_spot (THIS->here_input());
1554         }
1555         | E_SMALLER {
1556                 Span_req*s =new Span_req;
1557                 $$ = s;
1558                 s->set_mus_property ("span-type", ly_str02scm ( "crescendo"));
1559                 s->set_spot (THIS->here_input());
1560         }
1561         | E_BIGGER {
1562                 Span_req*s =new Span_req;
1563                 $$ = s;
1564                 s->set_mus_property ("span-type", ly_str02scm ("decrescendo"));
1565                 s->set_spot (THIS->here_input());
1566         }
1567         ;
1568
1569
1570 open_request:
1571         open_request_parens {
1572                 $$ = $1;
1573                 dynamic_cast<Span_req*> ($$)->set_span_dir (STOP);
1574         }
1575         ;
1576
1577 open_request_parens:
1578         E_EXCLAMATION   {
1579                 Span_req *s =  new Span_req;
1580                 s->set_mus_property ("span-type", ly_str02scm ( "crescendo"));
1581                 s->set_spot (THIS->here_input());
1582
1583                 $$ = s;
1584         }
1585         | ')'   {
1586                 Span_req* s= new Span_req;
1587                 $$ = s;
1588                 s->set_mus_property ("span-type", ly_str02scm ( "slur"));
1589                 s->set_spot (THIS->here_input());
1590
1591         }
1592         | E_CLOSE       {
1593                 Span_req* s= new Span_req;
1594                 $$ = s;
1595                 s->set_mus_property ("span-type", ly_str02scm ( "phrasing-slur"));
1596                 s->set_spot (THIS->here_input());
1597         }
1598         ;
1599
1600 gen_text_def:
1601         embedded_scm {
1602                 Text_script_req *t = new Text_script_req;
1603                 t->set_mus_property ("text", $1);
1604                 t->set_spot (THIS->here_input ());
1605                 $$ = t;
1606         }
1607         | string {
1608                 Text_script_req *t = new Text_script_req;
1609                 t->set_mus_property ("text", $1);
1610                 t->set_spot (THIS->here_input ());
1611                 $$ = t;
1612         }
1613         | DIGIT {
1614                 String ds = to_str ($1);
1615                 Text_script_req* t = new Text_script_req;
1616                 SCM finger = ly_symbol2scm ("finger");
1617                 t->set_mus_property ("text",  ly_str02scm (ds.ch_C ()));
1618                 t->set_mus_property ("text-type" , finger);
1619                 t->set_spot (THIS->here_input ());
1620                 $$ = t;
1621         }
1622         ;
1623
1624 script_abbreviation:
1625         '^'             {
1626                 $$ = gh_str02scm ("Hat");
1627         }
1628         | '+'           {
1629                 $$ = gh_str02scm ("Plus");
1630         }
1631         | '-'           {
1632                 $$ = gh_str02scm ("Dash");
1633         }
1634         | '|'           {
1635                 $$ = gh_str02scm ("Bar");
1636         }
1637         | '>'           {
1638                 $$ = gh_str02scm ("Larger");
1639         }
1640         | '.'           {
1641                 $$ = gh_str02scm ("Dot");
1642         }
1643         ;
1644
1645 script_dir:
1646         '_'     { $$ = DOWN; }
1647         | '^'   { $$ = UP; }
1648         | '-'   { $$ = CENTER; }
1649         ;
1650
1651 pre_requests:
1652         {
1653                 $$ = new Link_array<Request>;
1654         }
1655         | pre_requests open_request {
1656                 $$->push ($2);
1657         }
1658         ;
1659
1660 absolute_pitch:
1661         steno_pitch     {
1662                 $$ = $1;
1663         }
1664         ;
1665
1666 duration_length:
1667         multiplied_duration {
1668                 $$ = $1;
1669         }
1670         | verbose_duration {
1671                 $$ = $1;
1672         }       
1673         ;
1674
1675 optional_notemode_duration:
1676         {
1677                 Duration dd = THIS->default_duration_;
1678                 $$ = dd.smobbed_copy ();
1679
1680                 THIS->beam_check ($$);
1681         }
1682         | multiplied_duration   {
1683                 $$ = $1;
1684                 THIS->default_duration_ = *unsmob_duration ($$);
1685
1686                 THIS->beam_check ($$);
1687         }
1688         | verbose_duration {
1689                 $$ = $1;
1690                 THIS->default_duration_ = *unsmob_duration ($$);
1691         }       
1692         ;
1693
1694 steno_duration:
1695         bare_unsigned dots              {
1696                 int l = 0;
1697                 if (!is_duration_b ($1))
1698                         THIS->parser_error (_f ("not a duration: %d", $1));
1699                 else
1700                         l =  intlog2 ($1);
1701
1702                 $$ = Duration (l, $2).smobbed_copy ();
1703         }
1704         | DURATION_IDENTIFIER dots      {
1705                 Duration *d =unsmob_duration ($1);
1706                 Duration k (d->duration_log (),d->dot_count () + $2);
1707                 $$ = k.smobbed_copy ();
1708         }
1709         ;
1710
1711
1712
1713
1714 multiplied_duration:
1715         steno_duration {
1716                 $$ = $1;
1717         }
1718         | multiplied_duration '*' bare_unsigned {
1719                 $$ = unsmob_duration ($$)->compressed ( $3) .smobbed_copy ();
1720         }
1721         | multiplied_duration '*' FRACTION {
1722                 Rational  m (gh_scm2int (ly_car ($3)), gh_scm2int (ly_cdr ($3)));
1723
1724                 $$ = unsmob_duration ($$)->compressed (m).smobbed_copy ();
1725         }
1726         ;
1727
1728 fraction:
1729         FRACTION { $$ = $1; }
1730         | UNSIGNED '/' UNSIGNED {
1731                 $$ = gh_cons (gh_int2scm ($1), gh_int2scm ($3));
1732         }
1733         ;
1734
1735 dots:
1736         /* empty */     {
1737                 $$ = 0;
1738         }
1739         | dots '.' {
1740                 $$ ++;
1741         }
1742         ;
1743
1744
1745 tremolo_type: 
1746         ':'     {
1747                 $$ =0;
1748         }
1749         | ':' bare_unsigned {
1750                 if (!is_duration_b ($2))
1751                         THIS->parser_error (_f ("not a duration: %d", $2));
1752                 $$ = $2;
1753         }
1754         ;
1755
1756
1757 bass_number:
1758         DIGIT
1759         | UNSIGNED 
1760         ;
1761
1762 bass_mod:
1763         '-'     { $$ = -1; }
1764         | '+'   { $$ = 1; } 
1765         | '!'   { $$ = 0; }
1766         ;
1767
1768 bass_figure:
1769         FIGURE_SPACE {
1770                 Bass_figure_req *bfr = new Bass_figure_req;
1771                 $$ = bfr->self_scm();
1772                 scm_gc_unprotect_object ($$);
1773         }
1774         | bass_number  {
1775                 Bass_figure_req *bfr = new Bass_figure_req;
1776                 $$ = bfr->self_scm();
1777
1778                 bfr->set_mus_property ("figure", gh_int2scm ($1));
1779
1780                 scm_gc_unprotect_object ($$);
1781         }
1782         | bass_figure bass_mod {
1783                 Music *m = unsmob_music ($1);
1784                 if ($2) {
1785                         SCM salter =m->get_mus_property ("alteration");
1786                         int alter = gh_number_p( salter) ? gh_scm2int (salter) : 0;
1787                         m->set_mus_property ("alteration",
1788                                 gh_int2scm (alter + $2));
1789                 } else {
1790                         m->set_mus_property ("alteration", gh_int2scm (0));
1791                 }
1792         }
1793         ;
1794
1795 br_bass_figure:
1796         '[' bass_figure {
1797                 $$ = $2;
1798                 unsmob_music ($$)->set_mus_property ("bracket-start", SCM_BOOL_T);
1799         }
1800         | bass_figure   {
1801                 $$ = $1;
1802         }
1803         | br_bass_figure ']' {
1804                 $$ = $1;
1805                 unsmob_music ($1)->set_mus_property ("bracket-stop", SCM_BOOL_T);
1806         }
1807         ;
1808
1809 figure_list:
1810         /**/            {
1811                 $$ = SCM_EOL;
1812         }
1813         | figure_list br_bass_figure {
1814                 $$ = gh_cons ($2, $1); 
1815         }
1816         ;
1817
1818 figure_spec:
1819         FIGURE_OPEN figure_list FIGURE_CLOSE {
1820                 Music * m = new Request_chord (SCM_EOL);
1821                 $2 = scm_reverse_x ($2, SCM_EOL);
1822                 m->set_mus_property ("elements",  $2);
1823                 $$ = m->self_scm ();
1824         }
1825         ;
1826
1827
1828 optional_rest:
1829         /**/   { $$ = 0; }
1830         | REST { $$ = 1; }
1831         ;
1832
1833 simple_element:
1834         pitch exclamations questions optional_notemode_duration optional_rest {
1835
1836                 Input i = THIS->pop_spot ();
1837                 if (!THIS->lexer_p_->note_state_b ())
1838                         THIS->parser_error (_ ("Have to be in Note mode for notes"));
1839
1840                 Music *n = 0;
1841                 if ($5)
1842                         n =  new Rest_req ;
1843                 else
1844                         n =  new Note_req;
1845                 
1846                 n->set_mus_property ("pitch", $1);
1847                 n->set_mus_property ("duration", $4);
1848
1849
1850                 if ($3 % 2)
1851                         n->set_mus_property ("cautionary", SCM_BOOL_T);
1852                 if ($2 % 2 || $3 % 2)
1853                         n->set_mus_property ("force-accidental", SCM_BOOL_T);
1854
1855                 Simultaneous_music*v = new Request_chord (SCM_EOL);
1856                 v->set_mus_property ("elements", scm_list_n (n->self_scm (), SCM_UNDEFINED));
1857                 scm_gc_unprotect_object (n->self_scm());
1858
1859                 v->set_spot (i);
1860                 n->set_spot (i);
1861                 $$ = v;
1862         }
1863         | figure_spec optional_notemode_duration {
1864                 Music * m = unsmob_music ($1);
1865                 Input i = THIS->pop_spot (); 
1866                 m->set_spot (i);
1867                 for (SCM s = m->get_mus_property ("elements"); gh_pair_p (s); s = ly_cdr (s))
1868                         {
1869                                 unsmob_music (ly_car (s))->set_mus_property ("duration", $2);
1870                         }
1871                 $$ = m;
1872         }       
1873         | RESTNAME optional_notemode_duration           {
1874
1875                 Input i = THIS->pop_spot ();
1876                 SCM e = SCM_UNDEFINED;
1877                 if (ly_scm2string ($1) =="s") {
1878                         /* Space */
1879                         Skip_req * skip_p = new Skip_req;
1880                         skip_p->set_mus_property ("duration" ,$2);
1881                         skip_p->set_spot (i);
1882                         e = skip_p->self_scm ();
1883                   }
1884                   else {
1885                         Rest_req * rest_req_p = new Rest_req;
1886                         rest_req_p->set_mus_property ("duration", $2);
1887                         rest_req_p->set_spot (i);
1888                         e = rest_req_p->self_scm ();
1889                     }
1890                 Simultaneous_music* velt_p = new Request_chord (SCM_EOL);
1891                 velt_p-> set_mus_property ("elements", scm_list_n (e,SCM_UNDEFINED));
1892                 velt_p->set_spot (i);
1893
1894                 $$ = velt_p;
1895         }
1896         | MULTI_MEASURE_REST optional_notemode_duration         {
1897                 Input i = THIS->pop_spot ();
1898
1899                 Skip_req * sk = new Skip_req;
1900                 sk->set_mus_property ("duration", $2);
1901                 Span_req *sp1 = new Span_req;
1902                 Span_req *sp2 = new Span_req;
1903                 sp1-> set_span_dir ( START);
1904                 sp2-> set_span_dir ( STOP);
1905                 SCM r = ly_str02scm ("rest");
1906                 sp1->set_mus_property ("span-type", r);
1907                 sp2->set_mus_property ("span-type", r);
1908
1909                 Request_chord * rqc1 = new Request_chord (SCM_EOL);
1910                 rqc1->set_mus_property ("elements", scm_list_n (sp1->self_scm (), SCM_UNDEFINED));
1911                 Request_chord * rqc2 = new Request_chord (SCM_EOL);
1912                 rqc2->set_mus_property ("elements", scm_list_n (sk->self_scm (), SCM_UNDEFINED));;
1913                 Request_chord * rqc3 = new Request_chord (SCM_EOL);
1914                 rqc3->set_mus_property ("elements", scm_list_n (sp2->self_scm (), SCM_UNDEFINED));;
1915
1916                 SCM ms = scm_list_n (rqc1->self_scm (), rqc2->self_scm (), rqc3->self_scm (), SCM_UNDEFINED);
1917
1918                 $$ = new Sequential_music (SCM_EOL);
1919                 $$->set_mus_property ("elements", ms);
1920         }
1921         | STRING optional_notemode_duration     {
1922                 Input i = THIS->pop_spot ();
1923
1924                 Lyric_req* lreq_p = new Lyric_req;
1925                 lreq_p->set_mus_property ("text", $1);
1926                 lreq_p->set_mus_property ("duration",$2);
1927                 lreq_p->set_spot (i);
1928                 Simultaneous_music* velt_p = new Request_chord (SCM_EOL);
1929                 velt_p->set_mus_property ("elements", scm_list_n (lreq_p->self_scm (), SCM_UNDEFINED));
1930
1931                 $$= velt_p;
1932         }
1933         | chord {
1934                 Input i = THIS->pop_spot ();
1935
1936                 if (!THIS->lexer_p_->chord_state_b ())
1937                         THIS->parser_error (_ ("Have to be in Chord mode for chords"));
1938                 $$ = $1;
1939         }
1940         ;
1941
1942
1943 chord:
1944         steno_tonic_pitch optional_notemode_duration chord_additions chord_subtractions chord_inversion chord_bass {
1945                 $$ = Chord::get_chord ($1, $3, $4, $5, $6, $2);
1946                 $$->set_spot (THIS->here_input ());
1947         };
1948
1949 chord_additions: 
1950         {
1951                 $$ = SCM_EOL;
1952         } 
1953         | CHORD_COLON chord_notes {
1954                 $$ = $2;
1955         }
1956         ;
1957
1958 chord_notes:
1959         chord_step {
1960                 $$ = $1
1961         }
1962         | chord_notes '.' chord_step {
1963                 $$ = gh_append2 ($$, $3);
1964         }
1965         ;
1966
1967 chord_subtractions: 
1968         {
1969                 $$ = SCM_EOL;
1970         } 
1971         | CHORD_CARET chord_notes {
1972                 $$ = $2;
1973         }
1974         ;
1975
1976
1977 chord_inversion:
1978         {
1979                 $$ = SCM_EOL;
1980         }
1981         | '/' steno_tonic_pitch {
1982                 $$ = $2;
1983         }
1984         ;
1985
1986 chord_bass:
1987         {
1988                 $$ = SCM_EOL;
1989         }
1990         | CHORD_BASS steno_tonic_pitch {
1991                 $$ = $2;
1992         }
1993         ;
1994
1995 chord_step:
1996         chord_note {
1997                 $$ = gh_cons ($1, SCM_EOL);
1998         }
1999         | CHORDMODIFIER_PITCH {
2000                 $$ = gh_cons (unsmob_pitch ($1)->smobbed_copy (), SCM_EOL);
2001         }
2002         | CHORDMODIFIER_PITCH chord_note { /* Ugh. */
2003                 $$ = scm_list_n (unsmob_pitch ($1)->smobbed_copy (),
2004                         $2, SCM_UNDEFINED);
2005         }
2006         ;
2007
2008 chord_note:
2009         bare_unsigned {
2010                  Pitch m;
2011                 m.notename_i_ = ($1 - 1) % 7;
2012                 m.octave_i_ = $1 > 7 ? 1 : 0;
2013                 m.alteration_i_ = 0;
2014
2015                 $$ = m.smobbed_copy ();
2016         } 
2017         | bare_unsigned '+' {
2018                 Pitch m;
2019                 m.notename_i_ = ($1 - 1) % 7;
2020                 m.octave_i_ = $1 > 7 ? 1 : 0;
2021                 m.alteration_i_ = 1;
2022
2023
2024                 $$ = m.smobbed_copy ();
2025         }
2026         | bare_unsigned CHORD_MINUS {
2027                 Pitch m;
2028                 m.notename_i_ = ($1 - 1) % 7;
2029                 m.octave_i_ = $1 > 7 ? 1 : 0;
2030                 m.alteration_i_ = -1;
2031
2032                 $$ = m.smobbed_copy ();
2033         }
2034         ;
2035
2036 /*
2037         UTILITIES
2038  */
2039 number_expression:
2040         number_expression '+' number_term {
2041                 $$ = scm_sum ($1, $3);
2042         }
2043         | number_expression '-' number_term {
2044                 $$ = scm_difference ($1, $3);
2045         }
2046         | number_term 
2047         ;
2048
2049 number_term:
2050         number_factor {
2051                 $$ = $1;
2052         }
2053         | number_factor '*' number_factor {
2054                 $$ = scm_product ($1, $3);
2055         }
2056         | number_factor '/' number_factor {
2057                 $$ = scm_divide ($1, $3);
2058         }
2059         ;
2060
2061 number_factor:
2062         '(' number_expression ')'       {
2063                 $$ = $2;
2064         }
2065         | '-'  number_factor { /* %prec UNARY_MINUS */
2066                 $$ = scm_difference ($2, SCM_UNDEFINED);
2067         }
2068         | bare_number
2069         ;
2070
2071
2072 bare_number:
2073         UNSIGNED        {
2074                 $$ = gh_int2scm ($1);
2075         }
2076         | REAL          {
2077                 $$ = $1;
2078         }
2079         | NUMBER_IDENTIFIER             {
2080                 $$ = $1;
2081         }
2082         | REAL CM_T     {
2083                 $$ = gh_double2scm (gh_scm2double ($1) CM );
2084         }
2085         | REAL PT_T     {
2086                 $$ = gh_double2scm (gh_scm2double ($1) PT);
2087         }
2088         | REAL IN_T     {
2089                 $$ = gh_double2scm (gh_scm2double ($1) INCH);
2090         }
2091         | REAL MM_T     {
2092                 $$ = gh_double2scm (gh_scm2double ($1) MM);
2093         }
2094         | REAL CHAR_T   {
2095                 $$ = gh_double2scm (gh_scm2double ($1) CHAR);
2096         }
2097         ;
2098
2099
2100 bare_unsigned:
2101         UNSIGNED {
2102                         $$ = $1;
2103         }
2104         | DIGIT {
2105                 $$ = $1;
2106         }
2107         ;
2108
2109 bare_int:
2110         bare_number {
2111                 if (scm_integer_p ($1) == SCM_BOOL_T)
2112                 {
2113                         int k = gh_scm2int ($1);
2114                         $$ = k;
2115                 } else
2116                 {
2117                         THIS->parser_error (_ ("need integer number arg"));
2118                         $$ = 0;
2119                 }
2120         }
2121         | '-' bare_int {
2122                 $$ = -$2;
2123         }
2124         ;
2125
2126
2127 string:
2128         STRING          {
2129                 $$ = $1;
2130         }
2131         | STRING_IDENTIFIER     {
2132                 $$ = $1;
2133         }
2134         | string '+' string {
2135                 $$ = scm_string_append (scm_list_n ($1, $3, SCM_UNDEFINED));
2136         }
2137         ;
2138
2139
2140 exclamations:
2141                 { $$ = 0; }
2142         | exclamations '!'      { $$ ++; }
2143         ;
2144
2145 questions:
2146                 { $$ = 0; }
2147         | questions '?' { $$ ++; }
2148         ;
2149
2150
2151 %%
2152
2153 void
2154 My_lily_parser::set_yydebug (bool )
2155 {
2156 #if 0
2157         yydebug = b;
2158 #endif
2159 }
2160
2161 extern My_lily_parser * current_parser;
2162
2163 void
2164 My_lily_parser::do_yyparse ()
2165 {
2166
2167         current_parser = this;;
2168         yyparse ((void*)this);
2169 }
2170
2171
2172 /*
2173 Should make this optional?    It will also complain when you do
2174
2175         [s4]
2176
2177 which is entirely legitimate.
2178
2179 Or we can scrap it. Barchecks should detect wrong durations, and
2180 skipTypesetting speeds it up a lot.
2181 */
2182 void
2183 My_lily_parser::beam_check (SCM dur)
2184 {
2185   Duration *d = unsmob_duration (dur);
2186   if (unsmob_music (last_beam_start_) && d->duration_log () <= 2)
2187     {
2188       Music * m = unsmob_music (last_beam_start_);
2189       m->origin ()->warning (_("Suspect duration found following this beam"));
2190     }
2191   last_beam_start_ = SCM_EOL;
2192 }