]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parser.yy
* lily/bar-line.cc: Add documentation for "||:" also in the
[lilypond.git] / lily / parser.yy
index 5901962c861103b99f998e4aeb6f587cba532d54..1d54ba97601290bdb5da524b8be090286f9080f0 100644 (file)
@@ -206,7 +206,6 @@ void set_music_properties (Music *p, SCM a);
 %token TEMPO "\\tempo"
 %token TIMES "\\times"
 %token TRANSPOSE "\\transpose"
-%token TRANSPOSITION "\\transposition"
 %token TYPE "\\type"
 %token UNSET "\\unset"
 %token WITH "\\with"
@@ -366,6 +365,7 @@ If we give names, Bison complains.
 %type <scm> music_function_event
 %type <scm> music_function_chord_body
 %type <scm> music_function_musicless_prefix
+%type <scm> music_function_musicless_function
 %type <scm> bass_figure
 %type <scm> figured_bass_modification
 %type <scm> br_bass_figure
@@ -945,7 +945,7 @@ function_scm_argument:
 /*
 TODO: use code generation for this
 */
-generic_prefix_music_scm:
+music_function_musicless_function:
        MUSIC_FUNCTION {
                $$ = scm_list_2 ($1, make_input (@$));
        }
@@ -955,21 +955,48 @@ generic_prefix_music_scm:
        | MUSIC_FUNCTION_MARKUP full_markup {
                $$ = scm_list_3 ($1, make_input (@$), $2);
        }
-       | music_function_musicless_prefix music {
-               $$ = ly_append2 ($1, scm_list_1 ($2));
-       }
        | MUSIC_FUNCTION_SCM_SCM function_scm_argument function_scm_argument {
                $$ = scm_list_4 ($1, make_input (@$), $2, $3);
        }
        | MUSIC_FUNCTION_SCM_SCM_SCM function_scm_argument function_scm_argument function_scm_argument {
                $$ = scm_list_5 ($1, make_input (@$), $2, $3, $4);
        }
-       | MUSIC_FUNCTION_MARKUP_MUSIC full_markup music {
+       | MUSIC_FUNCTION_MARKUP_MARKUP full_markup full_markup {
                $$ = scm_list_4 ($1, make_input (@$), $2, $3);
        }
-       | MUSIC_FUNCTION_MARKUP_MARKUP full_markup full_markup {
+       ;
+
+/*
+TODO: use code generation for this
+*/
+music_function_musicless_prefix:
+       MUSIC_FUNCTION_MUSIC {
+               $$ = scm_list_2 ($1, make_input (@$));
+       }
+       | MUSIC_FUNCTION_SCM_MUSIC function_scm_argument { 
+               $$ = scm_list_3 ($1, make_input (@$), $2);
+       }
+       | MUSIC_FUNCTION_SCM_SCM_MUSIC function_scm_argument function_scm_argument {
                $$ = scm_list_4 ($1, make_input (@$), $2, $3);
        }
+       | MUSIC_FUNCTION_SCM_SCM_SCM_MUSIC function_scm_argument function_scm_argument function_scm_argument {
+               $$ = scm_list_5 ($1, make_input (@$), $2, $3, $4);
+       }
+       | MUSIC_FUNCTION_SCM_SCM_SCM_SCM_MUSIC function_scm_argument function_scm_argument function_scm_argument function_scm_argument {
+               $$ = scm_list_n ($1, make_input (@$), $2, $3, $4, $5, SCM_UNDEFINED);
+       }
+       | MUSIC_FUNCTION_MARKUP_MUSIC full_markup {
+               $$ = scm_list_3 ($1, make_input (@$), $2);
+       }
+       ;
+
+generic_prefix_music_scm:
+       music_function_musicless_function {
+               $$ = $1;
+       }
+       | music_function_musicless_prefix music {
+               $$ = ly_append2 ($1, scm_list_1 ($2));
+       }
        | MUSIC_FUNCTION_MUSIC_MUSIC music music {
                $$ = scm_list_4 ($1, make_input (@$), $2, $3);
        }
@@ -984,6 +1011,7 @@ generic_prefix_music_scm:
        }
        ;
 
+
 optional_id:
        /**/ { $$ = SCM_EOL; }
        | '=' simple_string {
@@ -1387,8 +1415,8 @@ chord_body_element:
        ;
 
 music_function_chord_body:
-       MUSIC_FUNCTION {
-               $$ = scm_list_2 ($1, make_input (@$));
+       music_function_musicless_function {
+               $$ = $1;
        }
        | music_function_musicless_prefix chord_body_element {
                $$ = ly_append2 ($1, scm_list_1 ($2));
@@ -1399,29 +1427,11 @@ music_function_event:
        music_function_musicless_prefix post_event {
                $$ = ly_append2 ($1, scm_list_1 ($2));
        }
-       ;
-
-/*
-TODO: use code generation for this
-*/
-music_function_musicless_prefix:
-       MUSIC_FUNCTION_MUSIC {
-               $$ = scm_list_2 ($1, make_input (@$));
-       }
-       | MUSIC_FUNCTION_SCM_MUSIC function_scm_argument { 
-               $$ = scm_list_3 ($1, make_input (@$), $2);
-       }
-       | MUSIC_FUNCTION_SCM_SCM_MUSIC function_scm_argument function_scm_argument {
-               $$ = scm_list_4 ($1, make_input (@$), $2, $3);
-       }
-       | MUSIC_FUNCTION_SCM_SCM_SCM_MUSIC function_scm_argument function_scm_argument function_scm_argument {
-               $$ = scm_list_5 ($1, make_input (@$), $2, $3, $4);
-       }
-       | MUSIC_FUNCTION_SCM_SCM_SCM_SCM_MUSIC function_scm_argument function_scm_argument function_scm_argument function_scm_argument {
-               $$ = scm_list_n ($1, make_input (@$), $2, $3, $4, $5, SCM_UNDEFINED);
+       | music_function_musicless_function {
+               $$ = $1;
        }
        ;
-
+       
 
 command_element:
        command_event {
@@ -1459,11 +1469,6 @@ command_element:
                        $$ = MAKE_SYNTAX ("bar-check", @$, SCM_UNDEFINED);
 
        }
-       | TRANSPOSITION pitch {
-               Pitch middle_c;
-               Pitch sounds_as_c = pitch_interval (*unsmob_pitch ($2), middle_c);
-               $$ = MAKE_SYNTAX ("property-operation", @$, SCM_BOOL_F, ly_symbol2scm ("Staff"), ly_symbol2scm ("PropertySet"), ly_symbol2scm ("instrumentTransposition"), sounds_as_c.smobbed_copy ());
-       }
        | PARTIAL duration_length       {
                Moment m = - unsmob_duration ($2)->get_length ();
                $$ = MAKE_SYNTAX ("property-operation", @$, SCM_BOOL_F, ly_symbol2scm ("Timing"), ly_symbol2scm ("PropertySet"), ly_symbol2scm ("measurePosition"), m.smobbed_copy ());
@@ -1730,7 +1735,7 @@ gen_text_def:
                $$ = t->unprotect ();
        }
        | DIGIT {
-               Music *t = MY_MAKE_MUSIC ("FingerEvent");
+               Music *t = MY_MAKE_MUSIC ("FingeringEvent");
                t->set_property ("digit", scm_from_int ($1));
                t->set_spot (@$);
                $$ = t->unprotect ();