]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parser.yy
* input/mutopia/F.Schubert/standchen.ly (trebleThrough): fixes
[lilypond.git] / lily / parser.yy
index 7b8ba1f0cbda86d26cbbbbc3cf5a91753dcd3b37..54f23241c158488f37b723d3876d0b1ab373d155 100644 (file)
@@ -342,7 +342,7 @@ yylex (YYSTYPE *s,  void * v)
 %type <scm> steno_duration optional_notemode_duration multiplied_duration
 %type <scm>  verbose_duration
        
-%type <scm>  pre_events post_events
+%type <scm>   post_events
 %type <music> gen_text_def
 %type <scm>   steno_pitch pitch absolute_pitch pitch_also_in_chords
 %type <scm>   explicit_pitch steno_tonic_pitch
@@ -1226,17 +1226,38 @@ scalar:
         ;
 
 
-event_chord:
-       pre_events {
+
+/*
+This is a trick:
+
+Adding pre_events to the simple_element
+makes the choice between
+
+  string:  STRING
+
+and
+
+  simple_element: STRING
+
+a single shift/reduction conflict.
+
+nevertheless, this is not very clean, and we should find a different
+solution.  
+
+*/
+pre_events: {
                THIS->push_spot ();
-       } /*cont */ simple_element post_events  {
-               SCM elts = $3-> get_mus_property ("elements");
+       }
+       ;
 
-               elts = gh_append3 (elts, scm_reverse_x ($1, SCM_EOL),
-                                  scm_reverse_x ($4, SCM_EOL));
+event_chord:
+       pre_events simple_element post_events   {
+               SCM elts = $2-> get_mus_property ("elements");
 
-               $3-> set_mus_property ("elements", elts);
-               $$ = $3;
+               elts = gh_append2 (elts, scm_reverse_x ($3, SCM_EOL));
+
+               $2->set_mus_property ("elements", elts);
+               $$ = $2;
        }
        | command_element
        | note_chord_element
@@ -1482,6 +1503,17 @@ event_that_take_dir:
        | close_event
        | open_event
        | '['  {
+
+
+/*
+
+TODO: should take all these defs out of the parser, adn make use
+configurable, i.e.
+
+
+(set-articulation '~ "trill")
+
+*/
                Music * m = MY_MAKE_MUSIC ("NewBeamEvent");
                m->set_spot (THIS->here_input());
                m->set_mus_property ("span-direction" , gh_int2scm (START));
@@ -1752,15 +1784,6 @@ script_dir:
        | '-'   { $$ = CENTER; }
        ;
 
-pre_events:
-       /* empty */ { 
-               $$ = SCM_EOL;
-       }
-       | pre_events open_event {
-               $$ = gh_cons ($2->self_scm(), $$);
-               scm_gc_unprotect_object ($2->self_scm());
-       }
-       ;
 
 absolute_pitch:
        steno_pitch     {
@@ -2106,6 +2129,9 @@ step_number:
 
 /*
        UTILITIES
+
+TODO: should deprecate in favor of Scheme?
+
  */
 number_expression:
        number_expression '+' number_term {