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 My_lily_parser* my_lily_parser;
115 #define YYPARSE_PARAM my_lily_parser
116 #define YYLEX_PARAM my_lily_parser
118 ((My_lily_parser *) my_lily_parser)
120 #define yyerror THIS->parser_error
124 /* We use SCMs to do strings, because it saves us the trouble of
125 deleting them. Let's hope that a stack overflow doesnt trigger a move
126 of the parse stack onto the heap. */
131 Link_array<Music> *reqvec;
133 String *string; // needed by the lexer as temporary scratch area.
136 Scheme_hash_table *scmhash;
137 Music_output_def * outputdef;
144 yylex (YYSTYPE *s, void * v)
146 My_lily_parser *pars = (My_lily_parser*) v;
147 My_lily_lexer * lex = pars->lexer_;
149 lex->lexval = (void*) s;
150 return lex->yylex ();
158 /* tokens which are not keywords */
167 %token CHORDMODIFIERS
175 %token GROBDESCRIPTIONS
181 %token FIGURES FIGURE_OPEN FIGURE_CLOSE
182 %token FIGURE_BRACKET_CLOSE FIGURE_BRACKET_OPEN
192 %token MULTI_MEASURE_REST
205 %token OVERRIDE SET REVERT
218 %token COMMANDSPANREQUEST
220 %token OUTPUTPROPERTY
231 %token E_CHAR E_EXCLAMATION E_SMALLER E_BIGGER E_OPEN E_CLOSE
232 %token E_LEFTSQUARE E_RIGHTSQUARE E_TILDE
234 %token <i> E_UNSIGNED
235 %token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET CHORD_SLASH
238 %type <i> exclamations questions dots optional_rest
239 %type <i> bass_number bass_mod
240 %type <scm> br_bass_figure bass_figure figure_list figure_spec
242 %token <scm> NOTENAME_PITCH
243 %token <scm> TONICNAME_PITCH
244 %token <scm> CHORDMODIFIER_PITCH
245 %token <scm> DURATION_IDENTIFIER
246 %token <scm> FRACTION
247 %token <id> IDENTIFIER
250 %token <scm> SCORE_IDENTIFIER
251 %token <scm> MUSIC_OUTPUT_DEF_IDENTIFIER
253 %token <scm> NUMBER_IDENTIFIER
254 %token <scm> EVENT_IDENTIFIER
255 %token <scm> MUSIC_IDENTIFIER TRANSLATOR_IDENTIFIER
256 %token <scm> STRING_IDENTIFIER SCM_IDENTIFIER
257 %token <scm> RESTNAME
263 %type <outputdef> output_def
264 %type <scm> lilypond_header lilypond_header_body
265 %type <music> open_event_parens close_event_parens open_event close_event
266 %type <music> event_with_dir event_that_take_dir verbose_event
267 %type <i> sub_quotes sup_quotes
268 %type <music> simple_element event_chord command_element Simple_music Composite_music
269 %type <music> Repeated_music
270 %type <scm> Alternative_music
271 %type <i> tremolo_type
272 %type <i> bare_int bare_unsigned
274 %type <scm> identifier_init
276 %type <scm> steno_duration optional_notemode_duration multiplied_duration
277 %type <scm> verbose_duration
279 %type <reqvec> pre_events post_events
280 %type <music> gen_text_def
281 %type <scm> steno_pitch pitch absolute_pitch
282 %type <scm> explicit_pitch steno_tonic_pitch
284 %type <scm> chord_additions chord_subtractions chord_notes chord_step
286 %type <scm> chord_note chord_inversion chord_bass
287 %type <scm> duration_length fraction
289 %type <scm> embedded_scm scalar
290 %type <music> Music Sequential_music Simultaneous_music
291 %type <music> relative_music re_rhythmed_music part_combined_music
292 %type <music> property_def translator_change simple_property_def
293 %type <scm> Music_list
294 %type <outputdef> music_output_def_body
295 %type <music> shorthand_command_req
296 %type <music> post_event
297 %type <music> command_req verbose_command_req
298 %type <music> extender_req
299 %type <music> hyphen_req
300 %type <music> string_event
301 %type <scm> string bare_number number_expression number_term number_factor
303 %type <score> score_block score_body
305 %type <scm> translator_spec_block translator_spec_body
306 %type <music> tempo_event
307 %type <scm> notenames_body notenames_block chordmodifiers_block
308 %type <scm> script_abbreviation
314 /* We don't assign precedence to / and *, because we might need varied
315 prec levels in different prods */
321 lilypond: /* empty */
322 | lilypond toplevel_expression {}
323 | lilypond assignment { }
325 THIS->error_level_ = 1;
328 THIS->error_level_ = 1;
334 THIS->lexer_->pitchname_tab_ = $1;
336 | chordmodifiers_block {
337 THIS->lexer_->chordmodifier_tab_ = $1;
340 THIS->input_file_->header_ = $1;
343 THIS->input_file_->scores_.push ($1);
346 if (dynamic_cast<Paper_def*> ($1))
347 THIS->lexer_->set_identifier (scm_makfrom0str ("$defaultpaper"), $1->self_scm ());
348 else if (dynamic_cast<Midi_def*> ($1))
349 THIS->lexer_->set_identifier (scm_makfrom0str ("$defaultmidi"), $1->self_scm ());
362 chordmodifiers_block:
363 CHORDMODIFIERS notenames_body { $$ = $2; }
367 PITCHNAMES notenames_body { $$ = $2; }
372 int i = scm_ilength ($1);
374 SCM tab = scm_make_vector (gh_int2scm (i), SCM_EOL);
375 for (SCM s = $1; gh_pair_p (s); s = ly_cdr (s)) {
376 SCM pt = ly_cdar (s);
377 if (!unsmob_pitch (pt))
378 THIS->parser_error ("Need pitch object.");
380 scm_hashq_set_x (tab, ly_caar (s), pt);
387 lilypond_header_body:
389 $$ = ly_make_anonymous_module ();
390 THIS->lexer_->add_scope ($$);
392 | lilypond_header_body assignment {
398 HEADER '{' lilypond_header_body '}' {
399 $$ = THIS->lexer_-> remove_scope();
411 /* cont */ '=' identifier_init {
414 Should find generic way of associating input with objects.
416 Input ip = THIS->pop_spot ();
418 if (! regular_identifier_b ($1))
420 ip.warning (_ ("Identifier should have alphabetic characters only"));
423 THIS->lexer_->set_identifier ($1, $4);
426 TODO: devise standard for protection in parser.
428 The parser stack lives on the C-stack, which means that
429 all objects can be unprotected as soon as they're here.
439 $$ = $1->self_scm ();
440 scm_gc_unprotect_object ($$);
443 $$ = $1->self_scm ();
444 scm_gc_unprotect_object ($$);
446 | translator_spec_block {
450 $$ = $1->self_scm ();
451 scm_gc_unprotect_object ($$);
454 $$ = $1->self_scm ();
455 scm_gc_unprotect_object ($$);
460 | number_expression {
471 translator_spec_block:
472 TRANSLATOR '{' translator_spec_body '}'
478 translator_spec_body:
479 TRANSLATOR_IDENTIFIER {
480 $$ = unsmob_translator_def ($1)->clone_scm ();
481 unsmob_translator_def ($$)-> set_spot (THIS->here_input ());
484 $$ = Translator_def::make_scm ();
485 Translator_def*td = unsmob_translator_def ($$);
486 td->translator_group_type_ = $2;
487 td->set_spot (THIS->here_input ());
489 | translator_spec_body STRING '=' embedded_scm {
490 unsmob_translator_def ($$)->add_property_assign ($2, $4);
492 | translator_spec_body STRING OVERRIDE embedded_scm '=' embedded_scm {
493 unsmob_translator_def ($$)
494 ->add_push_property (scm_string_to_symbol ($2), $4, $6);
496 | translator_spec_body STRING SET embedded_scm '=' embedded_scm {
497 unsmob_translator_def ($$)
498 ->add_push_property (scm_string_to_symbol ($2), $4, $6);
500 | translator_spec_body STRING REVERT embedded_scm {
501 unsmob_translator_def ($$)->add_pop_property (
502 scm_string_to_symbol ($2), $4);
504 | translator_spec_body NAME STRING {
505 unsmob_translator_def ($$)->type_name_ = $3;
507 | translator_spec_body CONSISTS STRING {
508 unsmob_translator_def ($$)->add_element ($3);
510 | translator_spec_body ALIAS STRING {
511 Translator_def*td = unsmob_translator_def ($$);
512 td->type_aliases_ = scm_cons ($3, td->type_aliases_);
514 | translator_spec_body GROBDESCRIPTIONS embedded_scm {
515 Translator_def*td = unsmob_translator_def($$);
516 // td->add_property_assign (ly_symbol2scm ("allGrobDescriptions"), $3);
517 for (SCM p = $3; gh_pair_p (p); p = ly_cdr (p))
518 td->add_property_assign (scm_symbol_to_string (ly_caar (p)), ly_cdar (p));
520 | translator_spec_body CONSISTSEND STRING {
521 unsmob_translator_def ($$)->add_last_element ( $3);
523 | translator_spec_body ACCEPTS STRING {
524 unsmob_translator_def ($$)->set_acceptor ($3,true);
526 | translator_spec_body DENIES STRING {
527 unsmob_translator_def ($$)->set_acceptor ($3,false);
529 | translator_spec_body REMOVE STRING {
530 unsmob_translator_def ($$)->remove_element ($3);
541 /*cont*/ '{' score_body '}' {
544 if (!$$->defs_.size ())
546 Music_output_def *id =
547 unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultpaper"));
548 $$->add_output (id ? id->clone () : new Paper_def );
557 $$->set_spot (THIS->here_input ());
558 SCM m = $1->self_scm ();
559 scm_gc_unprotect_object (m);
564 SCM check_funcs = scm_c_eval_string ("toplevel-music-functions");
565 for (; gh_pair_p (check_funcs); check_funcs = gh_cdr (check_funcs))
566 m = gh_call1 (gh_car (check_funcs), m);
571 $$ = new Score (*unsmob_score ($1));
572 $$->set_spot (THIS->here_input ());
574 | score_body lilypond_header {
577 | score_body output_def {
590 music_output_def_body '}' {
592 THIS-> lexer_-> remove_scope ();
596 music_output_def_body:
598 Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultmidi"));
603 p = dynamic_cast<Midi_def*> (id->clone ());
608 THIS->lexer_->add_scope (p->scope_);
611 Music_output_def *id = unsmob_music_output_def (THIS->lexer_->lookup_identifier ("$defaultpaper"));
614 p = dynamic_cast<Paper_def*> (id->clone ());
617 THIS-> lexer_->add_scope (p->scope_);
620 | PAPER '{' MUSIC_OUTPUT_DEF_IDENTIFIER {
621 Music_output_def *p = unsmob_music_output_def ($3);
623 THIS->lexer_->add_scope (p->scope_);
626 | MIDI '{' MUSIC_OUTPUT_DEF_IDENTIFIER {
627 Music_output_def *p = unsmob_music_output_def ($3);
630 THIS->lexer_->add_scope (p->scope_);
633 | music_output_def_body assignment {
636 | music_output_def_body translator_spec_block {
637 $$->assign_translator ($2);
639 | music_output_def_body STYLESHEET embedded_scm {
640 dynamic_cast<Paper_def*> ($$)-> style_sheet_ = $3;
642 | music_output_def_body tempo_event {
644 junk this ? there already is tempo stuff in
647 int m = gh_scm2int ( $2->get_mus_property ("metronome-count"));
648 Duration *d = unsmob_duration ($2->get_mus_property ("duration"));
649 Midi_def * md = dynamic_cast<Midi_def*> ($$);
651 md->set_tempo (d->get_length (), m);
653 | music_output_def_body error {
659 TEMPO steno_duration '=' bare_unsigned {
660 $$ = MY_MAKE_MUSIC("TempoEvent");
661 $$->set_mus_property ("duration", $2);
662 $$->set_mus_property ("metronome-count", gh_int2scm ( $4));
667 The representation of a list is the
671 to have efficient append.
673 Music_list: /* empty */ {
674 $$ = scm_cons (SCM_EOL, SCM_EOL);
678 SCM c = scm_cons ($2->self_scm (), SCM_EOL);
679 scm_gc_unprotect_object ($2->self_scm ()); /* UGH */
680 if (gh_pair_p (ly_cdr (s)))
681 gh_set_cdr_x (ly_cdr (s), c); /* append */
683 gh_set_car_x (s, c); /* set first cons */
684 gh_set_cdr_x (s, c) ; /* remember last cell */
700 | ALTERNATIVE '{' Music_list '}' {
706 REPEAT string bare_unsigned Music Alternative_music
710 SCM alts = gh_pair_p ($5) ? gh_car ($5) : SCM_EOL;
711 if (times < scm_ilength (alts)) {
712 unsmob_music (gh_car (alts))
713 ->origin ()->warning (
714 _("More alternatives than repeats. Junking excess alternatives."));
715 alts = ly_truncate_list (times, alts);
721 proc = scm_c_eval_string ("make-repeated-music");
723 SCM mus = scm_call_1 (proc, $2);
724 scm_gc_protect_object (mus); // UGH.
725 Music *r =unsmob_music (mus);
728 r-> set_mus_property ("element", beg->self_scm ());
729 scm_gc_unprotect_object (beg->self_scm ());
731 r->set_mus_property ("repeat-count", gh_int2scm (times >? 1));
733 r-> set_mus_property ("elements",alts);
734 if (gh_equal_p ($2, scm_makfrom0str ("tremolo")))
737 we can not get durations and other stuff correct down the line, so we have to
738 add to the duration log here.
740 SCM func = scm_primitive_eval (ly_symbol2scm ("shift-duration-log"));
742 gh_call3 (func, r->self_scm (), gh_int2scm(-intlog2 ($3*2/3)),gh_int2scm(1));
744 gh_call3 (func, r->self_scm (), gh_int2scm(-intlog2 ($3)), gh_int2scm(0));
746 r->set_spot (*$4->origin ());
753 SEQUENTIAL '{' Music_list '}' {
754 $$ = MY_MAKE_MUSIC("SequentialMusic");
755 $$->set_mus_property ("elements", ly_car ($3));
756 $$->set_spot(THIS->here_input());
758 | '{' Music_list '}' {
759 $$ = MY_MAKE_MUSIC("SequentialMusic");
760 $$->set_mus_property ("elements", ly_car ($2));
761 $$->set_spot(THIS->here_input());
766 SIMULTANEOUS '{' Music_list '}'{
767 $$ = MY_MAKE_MUSIC("SimultaneousMusic");
768 $$->set_mus_property ("elements", ly_car ($3));
769 $$->set_spot(THIS->here_input());
772 | '<' Music_list '>' {
773 $$ = MY_MAKE_MUSIC("SimultaneousMusic");
774 $$->set_mus_property ("elements", ly_car ($2));
775 $$->set_spot(THIS->here_input());
780 event_chord { $$ = $1; }
781 | OUTPUTPROPERTY embedded_scm embedded_scm '=' embedded_scm {
783 if (!gh_symbol_p ($3))
785 THIS->parser_error (_ ("Second argument must be a symbol"));
787 /* Should check # args */
788 if (!gh_procedure_p (pred))
790 THIS->parser_error (_ ("First argument must be a procedure taking one argument"));
793 Music*m = MY_MAKE_MUSIC("OutputPropertySetMusic");
794 m->set_mus_property ("predicate", pred);
795 m->set_mus_property ("grob-property", $3);
796 m->set_mus_property ("grob-value", $5);
801 $$ = unsmob_music ($1)->clone ();
803 $$->set_spot (THIS->here_input());
811 CONTEXT STRING Music {
812 Music*csm =MY_MAKE_MUSIC("ContextSpeccedMusic");
814 csm->set_mus_property ("element", $3->self_scm ());
815 scm_gc_unprotect_object ($3->self_scm ());
817 csm->set_mus_property ("context-type",$2);
818 csm->set_mus_property ("context-id", scm_makfrom0str (""));
822 | AUTOCHANGE STRING Music {
823 Music*chm = MY_MAKE_MUSIC("AutoChangeMusic");
824 chm->set_mus_property ("element", $3->self_scm ());
825 chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_proc);
827 scm_gc_unprotect_object ($3->self_scm ());
828 chm->set_mus_property ("what", $2);
831 chm->set_spot (*$3->origin ());
836 The other version is for easier debugging of
837 Sequential_music_iterator in combination with grace notes.
840 SCM start = THIS->lexer_->lookup_identifier ("startGraceMusic");
841 SCM stop = THIS->lexer_->lookup_identifier ("stopGraceMusic");
842 Music *startm = unsmob_music (start);
843 Music *stopm = unsmob_music (stop);
847 stopm = stopm->clone ();
848 ms = scm_cons (stopm->self_scm (), ms);
849 scm_gc_unprotect_object (stopm->self_scm ());
851 ms = scm_cons ($2->self_scm (), ms);
852 scm_gc_unprotect_object ($2->self_scm());
854 startm = startm->clone ();
855 ms = scm_cons (startm->self_scm () , ms);
856 scm_gc_unprotect_object (startm->self_scm ());
860 Music* seq = MY_MAKE_MUSIC("SequentialMusic");
861 seq->set_mus_property ("elements", ms);
864 $$ = MY_MAKE_MUSIC("GraceMusic");
865 $$->set_mus_property ("element", seq->self_scm ());
866 scm_gc_unprotect_object (seq->self_scm ());
868 $$ = MY_MAKE_MUSIC("GraceMusic");
869 $$->set_mus_property ("element", $2->self_scm ());
870 scm_gc_unprotect_object ($2->self_scm ());
873 | CONTEXT string '=' string Music {
874 Music * csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
876 csm->set_mus_property ("element", $5->self_scm ());
877 scm_gc_unprotect_object ($5->self_scm ());
879 csm->set_mus_property ("context-type", $2);
880 csm->set_mus_property ("context-id", $4);
891 int n = gh_scm2int (ly_car ($3)); int d = gh_scm2int (ly_cdr ($3));
893 $$= MY_MAKE_MUSIC("TimeScaledMusic");
894 $$->set_spot (THIS->pop_spot ());
897 $$->set_mus_property ("element", mp->self_scm ());
898 scm_gc_unprotect_object (mp->self_scm ());
899 $$->set_mus_property ("numerator", gh_int2scm (n));
900 $$->set_mus_property ("denominator", gh_int2scm (d));
901 $$->compress (Moment (Rational (n,d)));
904 | Repeated_music { $$ = $1; }
905 | Simultaneous_music { $$ = $1; }
906 | Sequential_music { $$ = $1; }
907 | TRANSPOSE pitch Music {
908 $$ = MY_MAKE_MUSIC("TransposedMusic");
910 Pitch pit = *unsmob_pitch ($2);
913 $$->set_mus_property ("element", p->self_scm ());
914 scm_gc_unprotect_object (p->self_scm ());
916 | TRANSPOSE steno_tonic_pitch Music {
917 $$ = MY_MAKE_MUSIC("TransposedMusic");
919 Pitch pit = *unsmob_pitch ($2);
922 $$->set_mus_property ("element", p->self_scm ());
923 scm_gc_unprotect_object (p->self_scm ());
926 | APPLY embedded_scm Music {
927 SCM ret = gh_call1 ($2, $3->self_scm ());
928 Music *m = unsmob_music (ret);
930 THIS->parser_error ("\\apply must return a Music");
931 m = MY_MAKE_MUSIC("Music");
936 { THIS->lexer_->push_note_state (); }
939 THIS->lexer_->pop_state ();
942 { THIS->lexer_->push_figuredbass_state (); }
945 Music * chm = MY_MAKE_MUSIC("UntransposableMusic");
946 chm->set_mus_property ("element", $3->self_scm ());
948 scm_gc_unprotect_object ($3->self_scm());
950 THIS->lexer_->pop_state ();
953 { THIS->lexer_->push_chord_state (); }
956 Music * chm = MY_MAKE_MUSIC("UnrelativableMusic");
957 chm->set_mus_property ("element", $3->self_scm ());
958 scm_gc_unprotect_object ($3->self_scm());
961 THIS->lexer_->pop_state ();
964 { THIS->lexer_->push_lyric_state (); }
968 THIS->lexer_->pop_state ();
970 | relative_music { $$ = $1; }
971 | re_rhythmed_music { $$ = $1; }
972 | part_combined_music { $$ = $1; }
976 RELATIVE absolute_pitch Music {
978 Pitch pit = *unsmob_pitch ($2);
979 $$ = MY_MAKE_MUSIC("RelativeOctaveMusic");
981 $$->set_mus_property ("element", p->self_scm ());
982 scm_gc_unprotect_object (p->self_scm ());
984 $$->set_mus_property ("last-pitch", p->to_relative_octave (pit).smobbed_copy ());
990 ADDLYRICS Music Music {
991 Music*l =MY_MAKE_MUSIC("LyricCombineMusic");
992 l->set_mus_property ("elements", gh_list ($2->self_scm (), $3->self_scm (), SCM_UNDEFINED));
993 scm_gc_unprotect_object ($3->self_scm ());
994 scm_gc_unprotect_object ($2->self_scm ());
1000 PARTCOMBINE STRING Music Music {
1001 Music * p= MY_MAKE_MUSIC("PartCombineMusic");
1002 p->set_mus_property ("what", $2);
1003 p->set_mus_property ("elements", gh_list ($3->self_scm (),$4->self_scm (), SCM_UNDEFINED));
1005 scm_gc_unprotect_object ($3->self_scm ());
1006 scm_gc_unprotect_object ($4->self_scm ());
1013 TRANSLATOR STRING '=' STRING {
1014 Music*t= MY_MAKE_MUSIC("TranslatorChange");
1015 t-> set_mus_property ("change-to-type", $2);
1016 t-> set_mus_property ("change-to-id", $4);
1019 $$->set_spot (THIS->here_input ());
1025 | ONCE simple_property_def {
1027 SCM e = $2->get_mus_property ("element");
1028 unsmob_music (e)->set_mus_property ("once", SCM_BOOL_T);
1032 simple_property_def:
1033 PROPERTY STRING '.' STRING '=' scalar {
1034 Music *t = set_property_music (scm_string_to_symbol ($4), $6);
1035 Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
1037 csm->set_mus_property ("element", t->self_scm ());
1038 scm_gc_unprotect_object (t->self_scm ());
1041 $$->set_spot (THIS->here_input ());
1043 csm-> set_mus_property ("context-type", $2);
1045 | PROPERTY STRING '.' STRING UNSET {
1047 Music *t = MY_MAKE_MUSIC("PropertyUnset");
1048 t->set_mus_property ("symbol", scm_string_to_symbol ($4));
1050 Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
1051 csm->set_mus_property ("element", t->self_scm ());
1052 scm_gc_unprotect_object (t->self_scm ());
1055 $$->set_spot (THIS->here_input ());
1057 csm-> set_mus_property ("context-type", $2);
1059 | PROPERTY STRING '.' STRING SET embedded_scm '=' embedded_scm {
1061 = gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings"));
1062 bool itc = internal_type_checking_global_b;
1063 Music *t = MY_MAKE_MUSIC("OverrideProperty");
1064 t->set_mus_property ("symbol", scm_string_to_symbol ($4));
1065 t->set_mus_property ("pop-first", SCM_BOOL_T);
1067 internal_type_checking_global_b = false;
1068 t->set_mus_property ("grob-property", $6);
1070 internal_type_checking_global_b = itc;
1071 t->set_mus_property ("grob-value", $8);
1073 Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
1074 csm->set_mus_property ("element", t->self_scm ());
1075 scm_gc_unprotect_object (t->self_scm ());
1077 $$->set_spot (THIS->here_input ());
1079 csm-> set_mus_property ("context-type", $2);
1081 | PROPERTY STRING '.' STRING OVERRIDE
1082 embedded_scm '=' embedded_scm
1088 = gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings"));
1089 bool itc = internal_type_checking_global_b;
1091 Music *t = MY_MAKE_MUSIC("OverrideProperty");
1092 t->set_mus_property ("symbol", scm_string_to_symbol ($4));
1094 internal_type_checking_global_b = false;
1095 t->set_mus_property ("grob-property", $6);
1096 t->set_mus_property ("grob-value", $8);
1098 internal_type_checking_global_b = itc;
1100 Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
1101 csm->set_mus_property ("element", t->self_scm ());
1102 scm_gc_unprotect_object (t->self_scm ());
1105 $$->set_spot (THIS->here_input ());
1107 csm-> set_mus_property ("context-type", $2);
1110 | PROPERTY STRING '.' STRING REVERT embedded_scm {
1111 Music *t = MY_MAKE_MUSIC("RevertProperty");
1113 = gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings"));
1114 bool itc = internal_type_checking_global_b;
1116 t->set_mus_property ("symbol", scm_string_to_symbol ($4));
1118 internal_type_checking_global_b = false;
1119 t->set_mus_property ("grob-property", $6);
1121 internal_type_checking_global_b = itc;
1123 Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
1124 csm->set_mus_property ("element", t->self_scm ());
1125 scm_gc_unprotect_object (t->self_scm ());
1128 $$->set_spot (THIS->here_input ());
1130 csm-> set_mus_property ("context-type", $2);
1137 | bare_int { $$ = gh_int2scm ($1); }
1138 | embedded_scm { $$ = $1; }
1145 } /*cont */ simple_element post_events {
1146 Music_sequence *l = dynamic_cast<Music_sequence*> ($3);
1149 for (int i=0; i < $1->size (); i++) {
1150 Music * m = $1->elem (i);
1151 l->append_music (m);
1163 $$ = MY_MAKE_MUSIC("EventChord");
1164 $$->set_mus_property ("elements", scm_cons ($1->self_scm (), SCM_EOL));
1165 scm_gc_unprotect_object ($1->self_scm());
1167 $$-> set_spot (THIS->here_input ());
1168 $1-> set_spot (THIS->here_input ());
1171 Music *l = MY_MAKE_MUSIC("LigatureEvent");
1172 l->set_mus_property ("span-direction", gh_int2scm (START));
1173 l->set_spot (THIS->here_input ());
1175 $$ = MY_MAKE_MUSIC("EventChord");
1176 $$->set_mus_property ("elements", scm_cons (l->self_scm (), SCM_EOL));
1177 scm_gc_unprotect_object (l->self_scm());
1178 $$->set_spot (THIS->here_input ());
1181 Music *l = MY_MAKE_MUSIC("LigatureEvent");
1182 l->set_mus_property ("span-direction", gh_int2scm (STOP));
1183 l->set_spot (THIS->here_input ());
1185 $$ = MY_MAKE_MUSIC("EventChord");
1186 $$->set_mus_property ("elements", scm_cons (l->self_scm (), SCM_EOL));
1187 $$->set_spot (THIS->here_input ());
1188 scm_gc_unprotect_object (l->self_scm());
1192 $$ = MY_MAKE_MUSIC("VoiceSeparator");
1193 $$->set_spot (THIS->here_input ());
1197 $$ = MY_MAKE_MUSIC("BarCheck");
1198 $$->set_spot (THIS->here_input ());
1201 Music *t = set_property_music (ly_symbol2scm ("whichBar"), $2);
1203 Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic");
1204 csm->set_mus_property ("element", t->self_scm ());
1205 scm_gc_unprotect_object (t->self_scm ());
1208 $$->set_spot (THIS->here_input ());
1210 csm->set_mus_property ("context-type", scm_makfrom0str ("Timing"));
1212 | PARTIAL duration_length {
1213 Moment m = - unsmob_duration ($2)->get_length ();
1214 Music * p = set_property_music (ly_symbol2scm ( "measurePosition"),m.smobbed_copy ());
1216 Music * sp = MY_MAKE_MUSIC("ContextSpeccedMusic");
1217 sp->set_mus_property ("element", p->self_scm ());
1218 scm_gc_unprotect_object (p->self_scm ());
1221 sp-> set_mus_property ("context-type", scm_makfrom0str ("Timing"));
1226 proc = scm_c_eval_string ("make-clef-set");
1228 SCM result = scm_call_1 (proc, $2);
1229 scm_gc_protect_object (result);
1230 $$ = unsmob_music (result);
1233 Music * p1 = set_property_music (ly_symbol2scm ( "timeSignatureFraction"), $2);
1235 int l = gh_scm2int (ly_car ($2));
1236 int o = gh_scm2int (ly_cdr ($2));
1238 Moment one_beat = Moment (1)/Moment (o);
1239 Moment len = Moment (l) * one_beat;
1242 Music *p2 = set_property_music (ly_symbol2scm ("measureLength"), len.smobbed_copy ());
1243 Music *p3 = set_property_music (ly_symbol2scm ("beatLength"), one_beat.smobbed_copy ());
1245 SCM list = scm_list_n (p1->self_scm (), p2->self_scm (), p3->self_scm(), SCM_UNDEFINED);
1246 Music *seq = MY_MAKE_MUSIC("SequentialMusic");
1247 seq->set_mus_property ("elements", list);
1250 Music * sp = MY_MAKE_MUSIC("ContextSpeccedMusic");
1251 sp->set_mus_property ("element", seq->self_scm ());
1253 scm_gc_unprotect_object (p3->self_scm ());
1254 scm_gc_unprotect_object (p2->self_scm ());
1255 scm_gc_unprotect_object (p1->self_scm ());
1256 scm_gc_unprotect_object (seq->self_scm ());
1260 sp-> set_mus_property ("context-type", scm_makfrom0str ( "Timing"));
1265 shorthand_command_req { $$ = $1; }
1266 | verbose_command_req { $$ = $1; }
1269 shorthand_command_req:
1277 $$ = MY_MAKE_MUSIC("TieEvent");
1280 Music *b= MY_MAKE_MUSIC("BeamEvent");
1281 b->set_mus_property ("span-direction", gh_int2scm (START))
1286 THIS->last_beam_start_ = b->self_scm ();
1289 Music *b= MY_MAKE_MUSIC("BeamEvent");
1290 b->set_mus_property ("span-direction", gh_int2scm (STOP));
1294 $$ = MY_MAKE_MUSIC("BreathingSignEvent");
1297 $$ = MY_MAKE_MUSIC("PorrectusEvent");
1301 verbose_command_req:
1302 COMMANDSPANREQUEST bare_int STRING {
1303 Music *sp = make_span_req ($3);
1304 sp->set_mus_property ("span-direction", gh_int2scm (Direction ($2)));
1305 sp->set_spot (THIS->here_input ());
1309 Music * m = MY_MAKE_MUSIC("MarkEvent");
1313 Music *m = MY_MAKE_MUSIC("MarkEvent");
1314 m->set_mus_property ("label", $2);
1318 Music * b = MY_MAKE_MUSIC("BreakEvent");
1320 if (!gh_number_p (s))
1323 b->set_mus_property ("penalty", s);
1324 b->set_spot (THIS->here_input ());
1327 | SKIP duration_length {
1328 Music * skip = MY_MAKE_MUSIC("SkipEvent");
1329 skip->set_mus_property ("duration", $2);
1337 Music *key= MY_MAKE_MUSIC("KeyChangeEvent");
1340 | KEY NOTENAME_PITCH SCM_IDENTIFIER {
1341 Music *key= MY_MAKE_MUSIC("KeyChangeEvent");
1343 key->set_mus_property ("pitch-alist", $3);
1344 ((Music*)key)->transpose (* unsmob_pitch ($2));
1351 $$ = new Link_array<Music>;
1353 | post_events post_event {
1354 $2->set_spot (THIS->here_input ());
1369 Music * s = MY_MAKE_MUSIC("StringNumberEvent");
1370 s->set_mus_property ("string-number", gh_int2scm($1));
1371 s->set_spot (THIS->here_input ());
1377 event_that_take_dir:
1382 | script_abbreviation {
1383 SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1));
1384 Music *a = MY_MAKE_MUSIC("ArticulationEvent");
1385 if (gh_string_p (s))
1386 a->set_mus_property ("articulation-type", s);
1387 else THIS->parser_error (_ ("Expecting string as script definition"));
1393 script_dir event_that_take_dir {
1394 $2->set_mus_property ("direction", gh_int2scm ($1));
1401 $$ = unsmob_music ($1)->clone ();
1402 $$->set_spot (THIS->here_input ());
1404 | 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;