1 %{ // -*-Fundamental-*-
4 parser.yy -- Bison/C++ parser for lilypond
6 source file of the GNU LilyPond music typesetter
8 (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 Jan Nieuwenhuizen <janneke@gnu.org>
13 Two shift/reduce problems:
20 the rules for who is protecting what are very shady. TODO: uniformise
28 #include "translator-def.hh"
29 #include "lily-guile.hh"
31 #include "my-lily-lexer.hh"
32 #include "paper-def.hh"
33 #include "midi-def.hh"
35 #include "file-path.hh"
37 #include "dimensions.hh"
38 #include "my-lily-parser.hh"
40 #include "input-file-results.hh"
42 #include "lilypond-input-version.hh"
43 #include "scm-hash.hh"
44 #include "auto-change-iterator.hh"
46 #include "ly-modules.hh"
47 #include "music-sequence.hh"
50 regular_identifier_b (SCM id)
52 String str = ly_scm2string (id);
53 char const *s = str.to_str0 () ;
58 v = v && isalpha (*s);
69 return t && t == 1 << intlog2 (t);
73 set_music_properties (Music *p, SCM a)
75 for (SCM k = a; gh_pair_p (k); k = ly_cdr (k))
77 p->internal_set_mus_property (ly_caar (k), ly_cdar (k));
83 #define MY_MAKE_MUSIC(x) make_music_by_name (ly_symbol2scm (x))
86 set_property_music (SCM sym, SCM value)
88 Music * p = MY_MAKE_MUSIC("PropertySet");
89 p->set_mus_property ("symbol", sym);
90 p->set_mus_property ("value", value);
95 make_span_req (SCM name)
99 proc = scm_c_eval_string ("old-span-event->event");
100 SCM m = scm_call_1 (proc, name);
101 scm_gc_protect_object (m);
102 return unsmob_music (m);
105 // needed for bison.simple's malloc () and free ()
107 // #include <malloc.h>
112 #define YYERROR_VERBOSE 1
114 #define YYPARSE_PARAM my_lily_parser
115 #define YYLEX_PARAM my_lily_parser
117 ((My_lily_parser *) my_lily_parser)
119 #define yyerror THIS->parser_error
123 /* We use SCMs to do strings, because it saves us the trouble of
124 deleting them. Let's hope that a stack overflow doesnt trigger a move
125 of the parse stack onto the heap. */
130 Link_array<Music> *reqvec;
132 String *string; // needed by the lexer as temporary scratch area.
135 Scheme_hash_table *scmhash;
136 Music_output_def * outputdef;
143 yylex (YYSTYPE *s, void * v)
145 My_lily_parser *pars = (My_lily_parser*) v;
146 My_lily_lexer * lex = pars->lexer_;
148 lex->lexval = (void*) s;
149 return lex->yylex ();
157 /* tokens which are not keywords */
166 %token CHORDMODIFIERS
174 %token GROBDESCRIPTIONS
180 %token FIGURES FIGURE_OPEN FIGURE_CLOSE
181 %token FIGURE_BRACKET_CLOSE FIGURE_BRACKET_OPEN
191 %token MULTI_MEASURE_REST
204 %token OVERRIDE SET REVERT
217 %token COMMANDSPANREQUEST
219 %token OUTPUTPROPERTY
230 %token E_CHAR E_EXCLAMATION E_SMALLER E_BIGGER E_OPEN E_CLOSE
231 %token E_LEFTSQUARE E_RIGHTSQUARE E_TILDE
233 %token <i> E_UNSIGNED
234 %token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET CHORD_SLASH
237 %type <i> exclamations questions dots optional_rest
238 %type <i> bass_number bass_mod
239 %type <scm> br_bass_figure bass_figure figure_list figure_spec
241 %token <scm> NOTENAME_PITCH
242 %token <scm> TONICNAME_PITCH
243 %token <scm> CHORDMODIFIER_PITCH
244 %token <scm> DURATION_IDENTIFIER
245 %token <scm> FRACTION
246 %token <id> IDENTIFIER
249 %token <scm> SCORE_IDENTIFIER
250 %token <scm> MUSIC_OUTPUT_DEF_IDENTIFIER
252 %token <scm> NUMBER_IDENTIFIER
253 %token <scm> EVENT_IDENTIFIER
254 %token <scm> MUSIC_IDENTIFIER TRANSLATOR_IDENTIFIER
255 %token <scm> STRING_IDENTIFIER SCM_IDENTIFIER
256 %token <scm> RESTNAME
262 %type <outputdef> output_def
263 %type <scm> lilypond_header lilypond_header_body
264 %type <music> open_event_parens close_event_parens open_event close_event
265 %type <music> event_with_dir event_that_take_dir verbose_event
266 %type <i> sub_quotes sup_quotes
267 %type <music> simple_element event_chord command_element Simple_music Composite_music
268 %type <music> Repeated_music
269 %type <scm> Alternative_music
270 %type <i> tremolo_type
271 %type <i> bare_int bare_unsigned
273 %type <scm> identifier_init
275 %type <scm> steno_duration optional_notemode_duration multiplied_duration
276 %type <scm> verbose_duration
278 %type <reqvec> pre_events post_events
279 %type <music> gen_text_def
280 %type <scm> steno_pitch pitch absolute_pitch
281 %type <scm> explicit_pitch steno_tonic_pitch
283 %type <scm> chord_additions chord_subtractions chord_notes chord_step
285 %type <scm> chord_note chord_inversion chord_bass
286 %type <scm> duration_length fraction
288 %type <scm> embedded_scm scalar
289 %type <music> Music Sequential_music Simultaneous_music
290 %type <music> relative_music re_rhythmed_music part_combined_music
291 %type <music> property_def translator_change simple_property_def
292 %type <scm> Music_list
293 %type <outputdef> music_output_def_body
294 %type <music> shorthand_command_req
295 %type <music> post_event
296 %type <music> command_req verbose_command_req
297 %type <music> extender_req
298 %type <music> hyphen_req
299 %type <music> string_event
300 %type <scm> string bare_number number_expression number_term number_factor
302 %type <score> score_block score_body
304 %type <scm> translator_spec_block translator_spec_body
305 %type <music> tempo_event
306 %type <scm> notenames_body notenames_block chordmodifiers_block
307 %type <scm> script_abbreviation
313 /* We don't assign precedence to / and *, because we might need varied
314 prec levels in different prods */
320 lilypond: /* empty */
321 | lilypond toplevel_expression {}
322 | lilypond assignment { }
324 THIS->error_level_ = 1;
327 THIS->error_level_ = 1;
333 THIS->lexer_->pitchname_tab_ = $1;
335 | chordmodifiers_block {
336 THIS->lexer_->chordmodifier_tab_ = $1;
339 THIS->input_file_->header_ = $1;
342 THIS->input_file_->scores_.push ($1);
345 if (dynamic_cast<Paper_def*> ($1))
346 THIS->lexer_->set_identifier (scm_makfrom0str ("$defaultpaper"), $1->self_scm ());
347 else if (dynamic_cast<Midi_def*> ($1))
348 THIS->lexer_->set_identifier (scm_makfrom0str ("$defaultmidi"), $1->self_scm ());
361 chordmodifiers_block:
362 CHORDMODIFIERS notenames_body { $$ = $2; }
366 PITCHNAMES notenames_body { $$ = $2; }
371 int i = scm_ilength ($1);
373 SCM tab = scm_make_vector (gh_int2scm (i), SCM_EOL);
374 for (SCM s = $1; gh_pair_p (s); s = ly_cdr (s)) {
375 SCM pt = ly_cdar (s);
376 if (!unsmob_pitch (pt))
377 THIS->parser_error ("Need pitch object.");
379 scm_hashq_set_x (tab, ly_caar (s), pt);
386 lilypond_header_body:
388 $$ = ly_make_anonymous_module ();
389 THIS->lexer_->add_scope ($$);
391 | lilypond_header_body assignment {
397 HEADER '{' lilypond_header_body '}' {
398 $$ = THIS->lexer_-> remove_scope();
410 /* cont */ '=' identifier_init {
413 Should find generic way of associating input with objects.
415 Input ip = THIS->pop_spot ();
417 if (! regular_identifier_b ($1))
419 ip.warning (_ ("Identifier should have alphabetic characters only"));
422 THIS->lexer_->set_identifier ($1, $4);
425 TODO: devise standard for protection in parser.
427 The parser stack lives on the C-stack, which means that
428 all objects can be unprotected as soon as they're here.
438 $$ = $1->self_scm ();
439 scm_gc_unprotect_object ($$);
442 $$ = $1->self_scm ();
443 scm_gc_unprotect_object ($$);
445 | translator_spec_block {
449 $$ = $1->self_scm ();
450 scm_gc_unprotect_object ($$);
453 $$ = $1->self_scm ();
454 scm_gc_unprotect_object ($$);
459 | number_expression {
470 translator_spec_block:
471 TRANSLATOR '{' translator_spec_body '}'
477 translator_spec_body:
478 TRANSLATOR_IDENTIFIER {
479 $$ = unsmob_translator_def ($1)->clone_scm ();
480 unsmob_translator_def ($$)-> set_spot (THIS->here_input ());
483 $$ = Translator_def::make_scm ();
484 Translator_def*td = unsmob_translator_def ($$);
485 td->translator_group_type_ = $2;
486 td->set_spot (THIS->here_input ());
488 | translator_spec_body STRING '=' embedded_scm {
489 unsmob_translator_def ($$)->add_property_assign ($2, $4);
491 | translator_spec_body STRING OVERRIDE embedded_scm '=' embedded_scm {
492 unsmob_translator_def ($$)
493 ->add_push_property (scm_string_to_symbol ($2), $4, $6);
495 | translator_spec_body STRING SET embedded_scm '=' embedded_scm {
496 unsmob_translator_def ($$)
497 ->add_push_property (scm_string_to_symbol ($2), $4, $6);
499 | translator_spec_body STRING REVERT embedded_scm {
500 unsmob_translator_def ($$)->add_pop_property (
501 scm_string_to_symbol ($2), $4);
503 | translator_spec_body NAME STRING {
504 unsmob_translator_def ($$)->type_name_ = $3;
506 | translator_spec_body CONSISTS STRING {
507 unsmob_translator_def ($$)->add_element ($3);
509 | translator_spec_body ALIAS STRING {
510 Translator_def*td = unsmob_translator_def ($$);
511 td->type_aliases_ = scm_cons ($3, td->type_aliases_);
513 | translator_spec_body GROBDESCRIPTIONS embedded_scm {
514 Translator_def*td = unsmob_translator_def($$);
515 // td->add_property_assign (ly_symbol2scm ("allGrobDescriptions"), $3);
516 for (SCM p = $3; gh_pair_p (p); p = ly_cdr (p))
517 td->add_property_assign (scm_symbol_to_string (ly_caar (p)), ly_cdar (p));
519 | translator_spec_body CONSISTSEND STRING {
520 unsmob_translator_def ($$)->add_last_element ( $3);
522 | translator_spec_body ACCEPTS STRING {
523 unsmob_translator_def ($$)->set_acceptor ($3,true);
525 | translator_spec_body DENIES STRING {
526 unsmob_translator_def ($$)->set_acceptor ($3,false);
528 | translator_spec_body REMOVE STRING {
529 unsmob_translator_def ($$)->remove_element ($3);
540 /*cont*/ '{' score_body '}' {
543 if (!$$->defs_.size ())
545 Music_output_def *id =
546 unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultpaper"));
547 $$->add_output (id ? id->clone () : new Paper_def );
556 $$->set_spot (THIS->here_input ());
557 SCM m = $1->self_scm ();
558 scm_gc_unprotect_object (m);
563 SCM check_funcs = scm_c_eval_string ("toplevel-music-functions");
564 for (; gh_pair_p (check_funcs); check_funcs = gh_cdr (check_funcs))
565 m = gh_call1 (gh_car (check_funcs), m);
570 $$ = new Score (*unsmob_score ($1));
571 $$->set_spot (THIS->here_input ());
573 | score_body lilypond_header {
576 | score_body output_def {
589 music_output_def_body '}' {
591 THIS-> lexer_-> remove_scope ();
595 music_output_def_body:
597 Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultmidi"));
602 p = dynamic_cast<Midi_def*> (id->clone ());
607 THIS->lexer_->add_scope (p->scope_);
610 Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultpaper"));
613 p = dynamic_cast<Paper_def*> (id->clone ());
616 THIS-> lexer_->add_scope (p->scope_);
619 | PAPER '{' MUSIC_OUTPUT_DEF_IDENTIFIER {
620 Music_output_def *p = unsmob_music_output_def ($3);
622 THIS->lexer_->add_scope (p->scope_);
625 | MIDI '{' MUSIC_OUTPUT_DEF_IDENTIFIER {
626 Music_output_def *p = unsmob_music_output_def ($3);
629 THIS->lexer_->add_scope (p->scope_);
632 | music_output_def_body assignment {
635 | music_output_def_body translator_spec_block {
636 $$->assign_translator ($2);
638 | music_output_def_body STYLESHEET embedded_scm {
639 dynamic_cast<Paper_def*> ($$)-> style_sheet_ = $3;
641 | music_output_def_body tempo_event {
643 junk this ? there already is tempo stuff in
646 int m = gh_scm2int ( $2->get_mus_property ("metronome-count"));
647 Duration *d = unsmob_duration ($2->get_mus_property ("duration"));
648 Midi_def * md = dynamic_cast<Midi_def*> ($$);
650 md->set_tempo (d->get_length (), m);
652 | music_output_def_body error {
658 TEMPO steno_duration '=' bare_unsigned {
659 $$ = MY_MAKE_MUSIC("TempoEvent");
660 $$->set_mus_property ("duration", $2);
661 $$->set_mus_property ("metronome-count", gh_int2scm ( $4));
666 The representation of a list is the
670 to have efficient append.
672 Music_list: /* empty */ {
673 $$ = scm_cons (SCM_EOL, SCM_EOL);
677 SCM c = scm_cons ($2->self_scm (), SCM_EOL);
678 scm_gc_unprotect_object ($2->self_scm ()); /* UGH */
679 if (gh_pair_p (ly_cdr (s)))
680 gh_set_cdr_x (ly_cdr (s), c); /* append */
682 gh_set_car_x (s, c); /* set first cons */
683 gh_set_cdr_x (s, c) ; /* remember last cell */
699 | ALTERNATIVE '{' Music_list '}' {
705 REPEAT string bare_unsigned Music Alternative_music
709 SCM alts = gh_pair_p ($5) ? gh_car ($5) : SCM_EOL;
710 if (times < scm_ilength (alts)) {
711 unsmob_music (gh_car (alts))
712 ->origin ()->warning (
713 _("More alternatives than repeats. Junking excess alternatives."));
714 alts = ly_truncate_list (times, alts);
720 proc = scm_c_eval_string ("make-repeated-music");
722 SCM mus = scm_call_1 (proc, $2);
723 scm_gc_protect_object (mus); // UGH.
724 Music *r =unsmob_music (mus);
727 r-> set_mus_property ("element", beg->self_scm ());
728 scm_gc_unprotect_object (beg->self_scm ());
730 r->set_mus_property ("repeat-count", gh_int2scm (times >? 1));
732 r-> set_mus_property ("elements",alts);
733 if (gh_equal_p ($2, scm_makfrom0str ("tremolo")))
736 we can not get durations and other stuff correct down the line, so we have to
737 add to the duration log here.
739 SCM func = scm_primitive_eval (ly_symbol2scm ("shift-duration-log"));
741 gh_call3 (func, r->self_scm (), gh_int2scm(-intlog2 ($3*2/3)),gh_int2scm(1));
743 gh_call3 (func, r->self_scm (), gh_int2scm(-intlog2 ($3)), gh_int2scm(0));
745 r->set_spot (*$4->origin ());
752 SEQUENTIAL '{' Music_list '}' {
753 $$ = MY_MAKE_MUSIC("SequentialMusic");
754 $$->set_mus_property ("elements", ly_car ($3));
755 $$->set_spot(THIS->here_input());
757 | '{' Music_list '}' {
758 $$ = MY_MAKE_MUSIC("SequentialMusic");
759 $$->set_mus_property ("elements", ly_car ($2));
760 $$->set_spot(THIS->here_input());
765 SIMULTANEOUS '{' Music_list '}'{
766 $$ = MY_MAKE_MUSIC("SimultaneousMusic");
767 $$->set_mus_property ("elements", ly_car ($3));
768 $$->set_spot(THIS->here_input());
771 | '<' Music_list '>' {
772 $$ = MY_MAKE_MUSIC("SimultaneousMusic");
773 $$->set_mus_property ("elements", ly_car ($2));
774 $$->set_spot(THIS->here_input());
779 event_chord { $$ = $1; }
780 | OUTPUTPROPERTY embedded_scm embedded_scm '=' embedded_scm {
782 if (!gh_symbol_p ($3))
784 THIS->parser_error (_ ("Second argument must be a symbol"));
786 /* Should check # args */
787 if (!gh_procedure_p (pred))
789 THIS->parser_error (_ ("First argument must be a procedure taking one argument"));
792 Music*m = MY_MAKE_MUSIC("OutputPropertySetMusic");
793 m->set_mus_property ("predicate", pred);
794 m->set_mus_property ("grob-property", $3);
795 m->set_mus_property ("grob-value", $5);
800 $$ = unsmob_music ($1)->clone ();
802 $$->set_spot (THIS->here_input());
810 CONTEXT STRING Music {
811 Music*csm =MY_MAKE_MUSIC("ContextSpeccedMusic");
813 csm->set_mus_property ("element", $3->self_scm ());
814 scm_gc_unprotect_object ($3->self_scm ());
816 csm->set_mus_property ("context-type",$2);
817 csm->set_mus_property ("context-id", scm_makfrom0str (""));
821 | AUTOCHANGE STRING Music {
822 Music*chm = MY_MAKE_MUSIC("AutoChangeMusic");
823 chm->set_mus_property ("element", $3->self_scm ());
824 chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_proc);
826 scm_gc_unprotect_object ($3->self_scm ());
827 chm->set_mus_property ("what", $2);
830 chm->set_spot (*$3->origin ());
835 The other version is for easier debugging of
836 Sequential_music_iterator in combination with grace notes.
839 SCM start = THIS->lexer_->lookup_identifier ("startGraceMusic");
840 SCM stop = THIS->lexer_->lookup_identifier ("stopGraceMusic");
841 Music *startm = unsmob_music (start);
842 Music *stopm = unsmob_music (stop);
846 stopm = stopm->clone ();
847 ms = scm_cons (stopm->self_scm (), ms);
848 scm_gc_unprotect_object (stopm->self_scm ());
850 ms = scm_cons ($2->self_scm (), ms);
851 scm_gc_unprotect_object ($2->self_scm());
853 startm = startm->clone ();
854 ms = scm_cons (startm->self_scm () , ms);
855 scm_gc_unprotect_object (startm->self_scm ());
859 Music* seq = MY_MAKE_MUSIC("SequentialMusic");
860 seq->set_mus_property ("elements", ms);
863 $$ = MY_MAKE_MUSIC("GraceMusic");
864 $$->set_mus_property ("element", seq->self_scm ());
865 scm_gc_unprotect_object (seq->self_scm ());
867 $$ = MY_MAKE_MUSIC("GraceMusic");
868 $$->set_mus_property ("element", $2->self_scm ());
869 scm_gc_unprotect_object ($2->self_scm ());
872 | CONTEXT string '=' string Music {
873 Music * csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
875 csm->set_mus_property ("element", $5->self_scm ());
876 scm_gc_unprotect_object ($5->self_scm ());
878 csm->set_mus_property ("context-type", $2);
879 csm->set_mus_property ("context-id", $4);
890 int n = gh_scm2int (ly_car ($3)); int d = gh_scm2int (ly_cdr ($3));
892 $$= MY_MAKE_MUSIC("TimeScaledMusic");
893 $$->set_spot (THIS->pop_spot ());
896 $$->set_mus_property ("element", mp->self_scm ());
897 scm_gc_unprotect_object (mp->self_scm ());
898 $$->set_mus_property ("numerator", gh_int2scm (n));
899 $$->set_mus_property ("denominator", gh_int2scm (d));
900 $$->compress (Moment (Rational (n,d)));
903 | Repeated_music { $$ = $1; }
904 | Simultaneous_music { $$ = $1; }
905 | Sequential_music { $$ = $1; }
906 | TRANSPOSE pitch Music {
907 $$ = MY_MAKE_MUSIC("TransposedMusic");
909 Pitch pit = *unsmob_pitch ($2);
912 $$->set_mus_property ("element", p->self_scm ());
913 scm_gc_unprotect_object (p->self_scm ());
915 | TRANSPOSE steno_tonic_pitch Music {
916 $$ = MY_MAKE_MUSIC("TransposedMusic");
918 Pitch pit = *unsmob_pitch ($2);
921 $$->set_mus_property ("element", p->self_scm ());
922 scm_gc_unprotect_object (p->self_scm ());
925 | APPLY embedded_scm Music {
926 SCM ret = gh_call1 ($2, $3->self_scm ());
927 Music *m = unsmob_music (ret);
929 THIS->parser_error ("\\apply must return a Music");
930 m = MY_MAKE_MUSIC("Music");
935 { THIS->lexer_->push_note_state (); }
938 THIS->lexer_->pop_state ();
941 { THIS->lexer_->push_figuredbass_state (); }
944 Music * chm = MY_MAKE_MUSIC("UntransposableMusic");
945 chm->set_mus_property ("element", $3->self_scm ());
947 scm_gc_unprotect_object ($3->self_scm());
949 THIS->lexer_->pop_state ();
952 { THIS->lexer_->push_chord_state (); }
955 Music * chm = MY_MAKE_MUSIC("UnrelativableMusic");
956 chm->set_mus_property ("element", $3->self_scm ());
957 scm_gc_unprotect_object ($3->self_scm());
960 THIS->lexer_->pop_state ();
963 { THIS->lexer_->push_lyric_state (); }
967 THIS->lexer_->pop_state ();
969 | relative_music { $$ = $1; }
970 | re_rhythmed_music { $$ = $1; }
971 | part_combined_music { $$ = $1; }
975 RELATIVE absolute_pitch Music {
977 Pitch pit = *unsmob_pitch ($2);
978 $$ = MY_MAKE_MUSIC("RelativeOctaveMusic");
980 $$->set_mus_property ("element", p->self_scm ());
981 scm_gc_unprotect_object (p->self_scm ());
983 $$->set_mus_property ("last-pitch", p->to_relative_octave (pit).smobbed_copy ());
989 ADDLYRICS Music Music {
990 Music*l =MY_MAKE_MUSIC("LyricCombineMusic");
991 l->set_mus_property ("elements", gh_list ($2->self_scm (), $3->self_scm (), SCM_UNDEFINED));
992 scm_gc_unprotect_object ($3->self_scm ());
993 scm_gc_unprotect_object ($2->self_scm ());
999 PARTCOMBINE STRING Music Music {
1000 Music * p= MY_MAKE_MUSIC("PartCombineMusic");
1001 p->set_mus_property ("what", $2);
1002 p->set_mus_property ("elements", gh_list ($3->self_scm (),$4->self_scm (), SCM_UNDEFINED));
1004 scm_gc_unprotect_object ($3->self_scm ());
1005 scm_gc_unprotect_object ($4->self_scm ());
1012 TRANSLATOR STRING '=' STRING {
1013 Music*t= MY_MAKE_MUSIC("TranslatorChange");
1014 t-> set_mus_property ("change-to-type", $2);
1015 t-> set_mus_property ("change-to-id", $4);
1018 $$->set_spot (THIS->here_input ());
1024 | ONCE simple_property_def {
1026 SCM e = $2->get_mus_property ("element");
1027 unsmob_music (e)->set_mus_property ("once", SCM_BOOL_T);
1031 simple_property_def:
1032 PROPERTY STRING '.' STRING '=' scalar {
1033 Music *t = set_property_music (scm_string_to_symbol ($4), $6);
1034 Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
1036 csm->set_mus_property ("element", t->self_scm ());
1037 scm_gc_unprotect_object (t->self_scm ());
1040 $$->set_spot (THIS->here_input ());
1042 csm-> set_mus_property ("context-type", $2);
1044 | PROPERTY STRING '.' STRING UNSET {
1046 Music *t = MY_MAKE_MUSIC("PropertyUnset");
1047 t->set_mus_property ("symbol", scm_string_to_symbol ($4));
1049 Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
1050 csm->set_mus_property ("element", t->self_scm ());
1051 scm_gc_unprotect_object (t->self_scm ());
1054 $$->set_spot (THIS->here_input ());
1056 csm-> set_mus_property ("context-type", $2);
1058 | PROPERTY STRING '.' STRING SET embedded_scm '=' embedded_scm {
1060 = gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings"));
1061 bool itc = internal_type_checking_global_b;
1062 Music *t = MY_MAKE_MUSIC("OverrideProperty");
1063 t->set_mus_property ("symbol", scm_string_to_symbol ($4));
1064 t->set_mus_property ("pop-first", SCM_BOOL_T);
1066 internal_type_checking_global_b = false;
1067 t->set_mus_property ("grob-property", $6);
1069 internal_type_checking_global_b = itc;
1070 t->set_mus_property ("grob-value", $8);
1072 Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
1073 csm->set_mus_property ("element", t->self_scm ());
1074 scm_gc_unprotect_object (t->self_scm ());
1076 $$->set_spot (THIS->here_input ());
1078 csm-> set_mus_property ("context-type", $2);
1080 | PROPERTY STRING '.' STRING OVERRIDE
1081 embedded_scm '=' embedded_scm
1087 = gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings"));
1088 bool itc = internal_type_checking_global_b;
1090 Music *t = MY_MAKE_MUSIC("OverrideProperty");
1091 t->set_mus_property ("symbol", scm_string_to_symbol ($4));
1093 internal_type_checking_global_b = false;
1094 t->set_mus_property ("grob-property", $6);
1095 t->set_mus_property ("grob-value", $8);
1097 internal_type_checking_global_b = itc;
1099 Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
1100 csm->set_mus_property ("element", t->self_scm ());
1101 scm_gc_unprotect_object (t->self_scm ());
1104 $$->set_spot (THIS->here_input ());
1106 csm-> set_mus_property ("context-type", $2);
1109 | PROPERTY STRING '.' STRING REVERT embedded_scm {
1110 Music *t = MY_MAKE_MUSIC("RevertProperty");
1112 = gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings"));
1113 bool itc = internal_type_checking_global_b;
1115 t->set_mus_property ("symbol", scm_string_to_symbol ($4));
1117 internal_type_checking_global_b = false;
1118 t->set_mus_property ("grob-property", $6);
1120 internal_type_checking_global_b = itc;
1122 Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
1123 csm->set_mus_property ("element", t->self_scm ());
1124 scm_gc_unprotect_object (t->self_scm ());
1127 $$->set_spot (THIS->here_input ());
1129 csm-> set_mus_property ("context-type", $2);
1136 | bare_int { $$ = gh_int2scm ($1); }
1137 | embedded_scm { $$ = $1; }
1144 } /*cont */ simple_element post_events {
1145 Music_sequence *l = dynamic_cast<Music_sequence*> ($3);
1148 for (int i=0; i < $1->size (); i++) {
1149 Music * m = $1->elem (i);
1150 l->append_music (m);
1162 $$ = MY_MAKE_MUSIC("EventChord");
1163 $$->set_mus_property ("elements", scm_cons ($1->self_scm (), SCM_EOL));
1164 scm_gc_unprotect_object ($1->self_scm());
1166 $$-> set_spot (THIS->here_input ());
1167 $1-> set_spot (THIS->here_input ());
1170 Music *l = MY_MAKE_MUSIC("LigatureEvent");
1171 l->set_mus_property ("span-direction", gh_int2scm (START));
1172 l->set_spot (THIS->here_input ());
1174 $$ = MY_MAKE_MUSIC("EventChord");
1175 $$->set_mus_property ("elements", scm_cons (l->self_scm (), SCM_EOL));
1176 scm_gc_unprotect_object (l->self_scm());
1177 $$->set_spot (THIS->here_input ());
1180 Music *l = MY_MAKE_MUSIC("LigatureEvent");
1181 l->set_mus_property ("span-direction", gh_int2scm (STOP));
1182 l->set_spot (THIS->here_input ());
1184 $$ = MY_MAKE_MUSIC("EventChord");
1185 $$->set_mus_property ("elements", scm_cons (l->self_scm (), SCM_EOL));
1186 $$->set_spot (THIS->here_input ());
1187 scm_gc_unprotect_object (l->self_scm());
1191 $$ = MY_MAKE_MUSIC("VoiceSeparator");
1192 $$->set_spot (THIS->here_input ());
1196 $$ = MY_MAKE_MUSIC("BarCheck");
1197 $$->set_spot (THIS->here_input ());
1200 Music *t = set_property_music (ly_symbol2scm ("whichBar"), $2);
1202 Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
1203 csm->set_mus_property ("element", t->self_scm ());
1204 scm_gc_unprotect_object (t->self_scm ());
1207 $$->set_spot (THIS->here_input ());
1209 csm->set_mus_property ("context-type", scm_makfrom0str ("Timing"));
1211 | PARTIAL duration_length {
1212 Moment m = - unsmob_duration ($2)->get_length ();
1213 Music * p = set_property_music (ly_symbol2scm ( "measurePosition"),m.smobbed_copy ());
1215 Music * sp = MY_MAKE_MUSIC("ContextSpeccedMusic");
1216 sp->set_mus_property ("element", p->self_scm ());
1217 scm_gc_unprotect_object (p->self_scm ());
1220 sp-> set_mus_property ("context-type", scm_makfrom0str ("Timing"));
1225 proc = scm_c_eval_string ("make-clef-set");
1227 SCM result = scm_call_1 (proc, $2);
1228 scm_gc_protect_object (result);
1229 $$ = unsmob_music (result);
1232 Music * p1 = set_property_music (ly_symbol2scm ( "timeSignatureFraction"), $2);
1234 int l = gh_scm2int (ly_car ($2));
1235 int o = gh_scm2int (ly_cdr ($2));
1237 Moment one_beat = Moment (1)/Moment (o);
1238 Moment len = Moment (l) * one_beat;
1241 Music *p2 = set_property_music (ly_symbol2scm ("measureLength"), len.smobbed_copy ());
1242 Music *p3 = set_property_music (ly_symbol2scm ("beatLength"), one_beat.smobbed_copy ());
1244 SCM list = scm_list_n (p1->self_scm (), p2->self_scm (), p3->self_scm(), SCM_UNDEFINED);
1245 Music *seq = MY_MAKE_MUSIC("SequentialMusic");
1246 seq->set_mus_property ("elements", list);
1249 Music * sp = MY_MAKE_MUSIC("ContextSpeccedMusic");
1250 sp->set_mus_property ("element", seq->self_scm ());
1252 scm_gc_unprotect_object (p3->self_scm ());
1253 scm_gc_unprotect_object (p2->self_scm ());
1254 scm_gc_unprotect_object (p1->self_scm ());
1255 scm_gc_unprotect_object (seq->self_scm ());
1259 sp-> set_mus_property ("context-type", scm_makfrom0str ( "Timing"));
1264 shorthand_command_req { $$ = $1; }
1265 | verbose_command_req { $$ = $1; }
1268 shorthand_command_req:
1276 $$ = MY_MAKE_MUSIC("TieEvent");
1279 Music *b= MY_MAKE_MUSIC("BeamEvent");
1280 b->set_mus_property ("span-direction", gh_int2scm (START))
1285 THIS->last_beam_start_ = b->self_scm ();
1288 Music *b= MY_MAKE_MUSIC("BeamEvent");
1289 b->set_mus_property ("span-direction", gh_int2scm (STOP));
1293 $$ = MY_MAKE_MUSIC("BreathingSignEvent");
1296 $$ = MY_MAKE_MUSIC("PorrectusEvent");
1300 verbose_command_req:
1301 COMMANDSPANREQUEST bare_int STRING {
1302 Music *sp = make_span_req ($3);
1303 sp->set_mus_property ("span-direction", gh_int2scm (Direction ($2)));
1304 sp->set_spot (THIS->here_input ());
1308 Music * m = MY_MAKE_MUSIC("MarkEvent");
1312 Music *m = MY_MAKE_MUSIC("MarkEvent");
1313 m->set_mus_property ("label", $2);
1317 Music * b = MY_MAKE_MUSIC("BreakEvent");
1319 if (!gh_number_p (s))
1322 b->set_mus_property ("penalty", s);
1323 b->set_spot (THIS->here_input ());
1326 | SKIP duration_length {
1327 Music * skip = MY_MAKE_MUSIC("SkipEvent");
1328 skip->set_mus_property ("duration", $2);
1336 Music *key= MY_MAKE_MUSIC("KeyChangeEvent");
1339 | KEY NOTENAME_PITCH SCM_IDENTIFIER {
1340 Music *key= MY_MAKE_MUSIC("KeyChangeEvent");
1342 key->set_mus_property ("pitch-alist", $3);
1343 ((Music*)key)->transpose (* unsmob_pitch ($2));
1350 $$ = new Link_array<Music>;
1352 | post_events post_event {
1353 $2->set_spot (THIS->here_input ());
1368 Music * s = MY_MAKE_MUSIC("StringNumberEvent");
1369 s->set_mus_property ("string-number", gh_int2scm($1));
1370 s->set_spot (THIS->here_input ());
1376 event_that_take_dir:
1381 | script_abbreviation {
1382 SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1));
1383 Music *a = MY_MAKE_MUSIC("ArticulationEvent");
1384 if (gh_string_p (s))
1385 a->set_mus_property ("articulation-type", s);
1386 else THIS->parser_error (_ ("Expecting string as script definition"));
1392 script_dir event_that_take_dir {
1393 $2->set_mus_property ("direction", gh_int2scm ($1));
1400 $$ = unsmob_music ($1)->clone ();
1401 $$->set_spot (THIS->here_input ());
1403 | SPANREQUEST bare_int STRING {
1405 Music * sp = make_span_req ($3);
1406 sp->set_mus_property ("span-direction", gh_int2scm ( $2));
1407 sp->set_spot (THIS->here_input ());
1411 Music * a = MY_MAKE_MUSIC("TremoloEvent");
1412 a->set_spot (THIS->here_input ());
1413 a->set_mus_property ("tremolo-type", gh_int2scm ($1));
1417 Music * a = MY_MAKE_MUSIC("ArticulationEvent");
1418 a->set_mus_property ("articulation-type", $2);
1419 a->set_spot (THIS->here_input ());
1424 duh, junk this syntax from the parser, if possible.
1427 Music *a = MY_MAKE_MUSIC("ArpeggioEvent");
1428 a->set_spot (THIS->here_input ());
1432 Music *g = MY_MAKE_MUSIC("GlissandoEvent");
1433 g->set_spot /* No pun intended */ (THIS->here_input ());
1460 | NOTENAME_PITCH sup_quotes {
1461 Pitch p = *unsmob_pitch ($1);
1463 $$ = p.smobbed_copy ();
1465 | NOTENAME_PITCH sub_quotes {
1466 Pitch p =* unsmob_pitch ($1);
1469 $$ = p.smobbed_copy ();
1482 | TONICNAME_PITCH sup_quotes {
1483 Pitch p = *unsmob_pitch ($1);
1485 $$ = p.smobbed_copy ();
1487 | TONICNAME_PITCH sub_quotes {
1488 Pitch p =* unsmob_pitch ($1);
1491 $$ = p.smobbed_copy ();
1506 PITCH embedded_scm {
1508 if (!unsmob_pitch ($2)) {
1509 THIS->parser_error (_f ("Expecting musical-pitch value", 3));
1510 $$ = Pitch ().smobbed_copy ();
1516 DURATION embedded_scm {
1518 if (!unsmob_duration ($2))
1520 THIS->parser_error (_ ("Must have duration object"));
1521 $$ = Duration ().smobbed_copy ();
1528 if (!THIS->lexer_->lyric_state_b ())
1529 THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
1530 $$ = MY_MAKE_MUSIC("ExtenderEvent");
1536 if (!THIS->lexer_->lyric_state_b ())
1537 THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
1538 $$ = MY_MAKE_MUSIC("HyphenEvent");
1543 close_event_parens {
1545 dynamic_cast<Music *> ($$)->set_mus_property ("span-direction", gh_int2scm (START))
1552 Music * s= MY_MAKE_MUSIC("SlurEvent");
1554 s->set_spot (THIS->here_input());
1557 Music * s= MY_MAKE_MUSIC("PhrasingSlurEvent");
1559 s->set_spot (THIS->here_input());
1562 Music *s =MY_MAKE_MUSIC("CrescendoEvent");
1564 s->set_spot (THIS->here_input());
1567 Music *s =MY_MAKE_MUSIC("DecrescendoEvent");
1569 s->set_spot (THIS->here_input());
1577 dynamic_cast<Music *> ($$)->set_mus_property ("span-direction", gh_int2scm (STOP))
1584 Music *s = MY_MAKE_MUSIC("CrescendoEvent");
1585 s->set_spot (THIS->here_input());
1590 Music * s= MY_MAKE_MUSIC("SlurEvent");
1592 s->set_spot (THIS->here_input());
1596 Music * s= MY_MAKE_MUSIC("PhrasingSlurEvent");
1598 s->set_mus_property ("span-type", scm_makfrom0str ( "phrasing-slur"));
1599 s->set_spot (THIS->here_input());
1605 Music *t = MY_MAKE_MUSIC("TextScriptEvent");
1606 t->set_mus_property ("text", $1);
1607 t->set_spot (THIS->here_input ());
1611 Music *t = MY_MAKE_MUSIC("TextScriptEvent");
1612 t->set_mus_property ("text", $1);
1613 t->set_spot (THIS->here_input ());
1617 String ds = to_string ($1);
1618 Music * t = MY_MAKE_MUSIC("TextScriptEvent");
1619 SCM finger = ly_symbol2scm ("finger");
1620 t->set_mus_property ("text", scm_makfrom0str (ds.to_str0 ()));
1621 t->set_mus_property ("text-type" , finger);
1622 t->set_spot (THIS->here_input ());
1627 script_abbreviation:
1629 $$ = scm_makfrom0str ("Hat");
1632 $$ = scm_makfrom0str ("Plus");
1635 $$ = scm_makfrom0str ("Dash");
1638 $$ = scm_makfrom0str ("Bar");
1641 $$ = scm_makfrom0str ("Larger");
1644 $$ = scm_makfrom0str ("Dot");
1647 $$ = scm_makfrom0str ("Underscore");
1654 | '-' { $$ = CENTER; }
1659 $$ = new Link_array<Music>;
1661 | pre_events open_event {
1673 multiplied_duration {
1676 | verbose_duration {
1681 optional_notemode_duration:
1683 Duration dd = THIS->default_duration_;
1684 $$ = dd.smobbed_copy ();
1686 THIS->beam_check ($$);
1688 | multiplied_duration {
1690 THIS->default_duration_ = *unsmob_duration ($$);
1692 THIS->beam_check ($$);
1694 | verbose_duration {
1696 THIS->default_duration_ = *unsmob_duration ($$);
1701 bare_unsigned dots {
1703 if (!is_duration_b ($1))
1704 THIS->parser_error (_f ("not a duration: %d", $1));
1708 $$ = Duration (l, $2).smobbed_copy ();
1710 | DURATION_IDENTIFIER dots {
1711 Duration *d =unsmob_duration ($1);
1712 Duration k (d->duration_log (),d->dot_count () + $2);
1713 $$ = k.smobbed_copy ();
1720 multiplied_duration:
1724 | multiplied_duration '*' bare_unsigned {
1725 $$ = unsmob_duration ($$)->compressed ( $3) .smobbed_copy ();
1727 | multiplied_duration '*' FRACTION {
1728 Rational m (gh_scm2int (ly_car ($3)), gh_scm2int (ly_cdr ($3)));
1730 $$ = unsmob_duration ($$)->compressed (m).smobbed_copy ();
1735 FRACTION { $$ = $1; }
1736 | UNSIGNED '/' UNSIGNED {
1737 $$ = scm_cons (gh_int2scm ($1), gh_int2scm ($3));
1755 | ':' bare_unsigned {
1756 if (!is_duration_b ($2))
1757 THIS->parser_error (_f ("not a duration: %d", $2));
1776 Music *bfr = MY_MAKE_MUSIC("BassFigureEvent");
1777 $$ = bfr->self_scm();
1778 scm_gc_unprotect_object ($$);
1781 Music *bfr = MY_MAKE_MUSIC("BassFigureEvent");
1782 $$ = bfr->self_scm();
1784 bfr->set_mus_property ("figure", gh_int2scm ($1));
1786 scm_gc_unprotect_object ($$);
1788 | bass_figure bass_mod {
1789 Music *m = unsmob_music ($1);
1791 SCM salter =m->get_mus_property ("alteration");
1792 int alter = gh_number_p ( salter) ? gh_scm2int (salter) : 0;
1793 m->set_mus_property ("alteration",
1794 gh_int2scm (alter + $2));
1796 m->set_mus_property ("alteration", gh_int2scm (0));
1804 unsmob_music ($$)->set_mus_property ("bracket-start", SCM_BOOL_T);
1809 | br_bass_figure ']' {
1811 unsmob_music ($1)->set_mus_property ("bracket-stop", SCM_BOOL_T);
1819 | figure_list br_bass_figure {
1820 $$ = scm_cons ($2, $1);
1825 FIGURE_OPEN figure_list FIGURE_CLOSE {
1826 Music * m = MY_MAKE_MUSIC("EventChord");
1827 $2 = scm_reverse_x ($2, SCM_EOL);
1828 m->set_mus_property ("elements", $2);
1829 $$ = m->self_scm ();
1840 pitch exclamations questions optional_notemode_duration optional_rest {
1842 Input i = THIS->pop_spot ();
1843 if (!THIS->lexer_->note_state_b ())
1844 THIS->parser_error (_ ("Have to be in Note mode for notes"));
1848 n = MY_MAKE_MUSIC("RestEvent");
1850 n = MY_MAKE_MUSIC("NoteEvent");
1852 n->set_mus_property ("pitch", $1);
1853 n->set_mus_property ("duration", $4);
1857 n->set_mus_property ("cautionary", SCM_BOOL_T);
1858 if ($2 % 2 || $3 % 2)
1859 n->set_mus_property ("force-accidental", SCM_BOOL_T);
1861 Music *v = MY_MAKE_MUSIC("EventChord");
1862 v->set_mus_property ("elements", scm_list_n (n->self_scm (), SCM_UNDEFINED));
1863 scm_gc_unprotect_object (n->self_scm());
1869 | figure_spec optional_notemode_duration {
1870 Music * m = unsmob_music ($1);
1871 Input i = THIS->pop_spot ();
1873 for (SCM s = m->get_mus_property ("elements"); gh_pair_p (s); s = ly_cdr (s))
1875 unsmob_music (ly_car (s))->set_mus_property ("duration", $2);
1879 | RESTNAME optional_notemode_duration {
1881 Input i = THIS->pop_spot ();
1882 SCM e = SCM_UNDEFINED;
1883 if (ly_scm2string ($1) =="s") {
1885 Music * skip = MY_MAKE_MUSIC("SkipEvent");
1886 skip->set_mus_property ("duration" ,$2);
1888 e = skip->self_scm ();
1891 Music * rest_req = MY_MAKE_MUSIC("RestEvent");
1892 rest_req->set_mus_property ("duration", $2);
1893 rest_req->set_spot (i);
1894 e = rest_req->self_scm ();
1896 Music * velt = MY_MAKE_MUSIC("EventChord");
1897 velt-> set_mus_property ("elements", scm_list_n (e,SCM_UNDEFINED));
1902 | MULTI_MEASURE_REST optional_notemode_duration {
1905 Music * sk = MY_MAKE_MUSIC("SkipEvent");
1906 sk->set_mus_property ("duration", $2);
1907 Music *sp1 = MY_MAKE_MUSIC("MultiMeasureRestEvent");
1908 Music *sp2 = MY_MAKE_MUSIC("MultiMeasureRestEvent");
1909 sp1-> set_mus_property ("span-direction", gh_int2scm (START))
1911 sp2-> set_mus_property ("span-direction", gh_int2scm (STOP))
1913 Music *rqc1 = MY_MAKE_MUSIC("EventChord");
1914 rqc1->set_mus_property ("elements", scm_list_n (sp1->self_scm (), SCM_UNDEFINED));
1915 Music *rqc2 = MY_MAKE_MUSIC("EventChord");
1916 rqc2->set_mus_property ("elements", scm_list_n (sk->self_scm (), SCM_UNDEFINED));;
1917 Music *rqc3 = MY_MAKE_MUSIC("EventChord");
1918 rqc3->set_mus_property ("elements", scm_list_n (sp2->self_scm (), SCM_UNDEFINED));;
1920 SCM ms = scm_list_n (rqc1->self_scm (), rqc2->self_scm (), rqc3->self_scm (), SCM_UNDEFINED);
1922 $$ = MY_MAKE_MUSIC("SequentialMusic");
1923 $$->set_mus_property ("elements", ms);
1925 | STRING optional_notemode_duration {
1926 Input i = THIS->pop_spot ();
1928 Music * lreq = MY_MAKE_MUSIC("LyricEvent");
1929 lreq->set_mus_property ("text", $1);
1930 lreq->set_mus_property ("duration",$2);
1932 Music * velt = MY_MAKE_MUSIC("EventChord");
1933 velt->set_mus_property ("elements", scm_list_n (lreq->self_scm (), SCM_UNDEFINED));
1940 if (!THIS->lexer_->chord_state_b ())
1941 THIS->parser_error (_ ("Have to be in Chord mode for chords"));
1948 steno_tonic_pitch optional_notemode_duration chord_additions chord_subtractions chord_inversion chord_bass {
1949 $$ = Chord::get_chord ($1, $3, $4, $5, $6, $2);
1950 $$->set_spot (THIS->here_input ());
1957 | CHORD_COLON chord_notes {
1966 | chord_notes '.' chord_step {
1967 $$ = gh_append2 ($$, $3);
1975 | CHORD_CARET chord_notes {
1985 | CHORD_SLASH steno_tonic_pitch {
1994 | CHORD_BASS steno_tonic_pitch {
2001 $$ = scm_cons ($1, SCM_EOL);
2003 | CHORDMODIFIER_PITCH {
2004 $$ = scm_cons (unsmob_pitch ($1)->smobbed_copy (), SCM_EOL);
2006 | CHORDMODIFIER_PITCH chord_note { /* Ugh. */
2007 $$ = scm_list_n (unsmob_pitch ($1)->smobbed_copy (),
2015 m.notename_ = ($1 - 1) % 7;
2016 m.octave_ = $1 > 7 ? 1 : 0;
2019 $$ = m.smobbed_copy ();
2021 | bare_unsigned '+' {
2023 m.notename_ = ($1 - 1) % 7;
2024 m.octave_ = $1 > 7 ? 1 : 0;
2028 $$ = m.smobbed_copy ();
2030 | bare_unsigned CHORD_MINUS {
2032 m.notename_ = ($1 - 1) % 7;
2033 m.octave_ = $1 > 7 ? 1 : 0;
2036 $$ = m.smobbed_copy ();
2044 number_expression '+' number_term {
2045 $$ = scm_sum ($1, $3);
2047 | number_expression '-' number_term {
2048 $$ = scm_difference ($1, $3);
2057 | number_factor '*' number_factor {
2058 $$ = scm_product ($1, $3);
2060 | number_factor '/' number_factor {
2061 $$ = scm_divide ($1, $3);
2066 '-' number_factor { /* %prec UNARY_MINUS */
2067 $$ = scm_difference ($2, SCM_UNDEFINED);
2075 $$ = gh_int2scm ($1);
2080 | NUMBER_IDENTIFIER {
2084 $$ = gh_double2scm (gh_scm2double ($1) CM );
2087 $$ = gh_double2scm (gh_scm2double ($1) PT);
2090 $$ = gh_double2scm (gh_scm2double ($1) INCH);
2093 $$ = gh_double2scm (gh_scm2double ($1) MM);
2096 $$ = gh_double2scm (gh_scm2double ($1) CHAR);
2112 if (scm_integer_p ($1) == SCM_BOOL_T)
2114 int k = gh_scm2int ($1);
2118 THIS->parser_error (_ ("need integer number arg"));
2132 | STRING_IDENTIFIER {
2135 | string '+' string {
2136 $$ = scm_string_append (scm_list_n ($1, $3, SCM_UNDEFINED));
2143 | exclamations '!' { $$ ++; }
2148 | questions '?' { $$ ++; }
2155 My_lily_parser::set_yydebug (bool )
2162 extern My_lily_parser * current_parser;
2165 My_lily_parser::do_yyparse ()
2168 current_parser = this;;
2169 yyparse ((void*)this);
2174 Should make this optional? It will also complain when you do
2178 which is entirely legitimate.
2180 Or we can scrap it. Barchecks should detect wrong durations, and
2181 skipTypesetting speeds it up a lot.
2184 My_lily_parser::beam_check (SCM dur)
2186 Duration *d = unsmob_duration (dur);
2187 if (unsmob_music (last_beam_start_) && d->duration_log () <= 2)
2189 Music * m = unsmob_music (last_beam_start_);
2190 m->origin ()->warning (_("Suspect duration found following this beam"));
2192 last_beam_start_ = SCM_EOL;