]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parser.yy
* lily/part-combine-music.cc: removed file and class.
[lilypond.git] / lily / parser.yy
index f67fa5363dcd89324d77414b955c229060061788..fcb719e317d8215848accaed517b0dd1eef8eb7c 100644 (file)
@@ -37,10 +37,9 @@ this.
 #include "file-path.hh"
 #include "warn.hh"
 #include "dimensions.hh"
-#include "command-request.hh"
-#include "musical-request.hh"
+
+#include "request.hh"
 #include "my-lily-parser.hh"
-#include "context-specced-music.hh"
 #include "score.hh"
 #include "music-list.hh"
 #include "output-property-music-iterator.hh"
@@ -55,7 +54,6 @@ this.
 #include "untransposable-music.hh"
 #include "lilypond-input-version.hh"
 #include "grace-music.hh"
-#include "part-combine-music.hh"
 #include "scm-hash.hh"
 #include "auto-change-iterator.hh"
 #include "un-relativable-music.hh"
@@ -106,6 +104,16 @@ set_property_music (SCM sym, SCM value)
        return p;
 }
 
+Music*
+make_span_req (SCM name)
+{
+  static SCM proc;
+  if (!proc)
+    proc = scm_c_eval_string ("old-span-request->event");
+  SCM m = scm_call_1 (proc, name);
+  scm_gc_protect_object (m);
+  return unsmob_music (m);
+}
 
 // needed for bison.simple's malloc () and free ()
 
@@ -719,8 +727,15 @@ Repeated_music:
                    _("More alternatives than repeats.  Junking excess alternatives."));
                  alts = ly_truncate_list (times, alts);
                }
-               
-               Music *r = MY_MAKE_MUSIC("RepeatedMusic");
+
+
+               static SCM proc;
+               if (!proc)
+                       proc = scm_c_eval_string ("make-repeated-music");
+
+               SCM mus = scm_call_1 (proc, $2);
+               scm_gc_protect_object (mus); // UGH. 
+               Music *r =unsmob_music (mus);
                if (beg)
                        {
                        r-> set_mus_property ("element", beg->self_scm ());
@@ -729,9 +744,6 @@ Repeated_music:
                r->set_mus_property ("repeat-count", gh_int2scm (times >? 1));
 
                r-> set_mus_property ("elements",alts);
-               SCM func = scm_primitive_eval (ly_symbol2scm ("repeat-name-to-ctor"));
-               SCM result = gh_call1 (func, $2);
-
                if (gh_equal_p ($2, scm_makfrom0str ("tremolo")))
                {
                /*
@@ -744,9 +756,6 @@ Repeated_music:
                        else
                          gh_call3 (func, r->self_scm (), gh_int2scm(-intlog2 ($3)), gh_int2scm(0));
                }
-
-               set_music_properties (r, result);
-
                r->set_spot (*$4->origin ());
 
                $$ = r;
@@ -1293,20 +1302,17 @@ shorthand_command_req:
                $$ = MY_MAKE_MUSIC("TieEvent");
        }
        | '['           {
-               Music *b= MY_MAKE_MUSIC("SpanEvent");
+               Music *b= MY_MAKE_MUSIC("BeamEvent");
                b->set_mus_property ("span-direction", gh_int2scm (START))
 ;
-               b->set_mus_property ("span-type", scm_makfrom0str ("beam"));
                $$ =b;
 
 
                THIS->last_beam_start_ = b->self_scm ();
        }
        | ']'           {
-               Music *b= MY_MAKE_MUSIC("SpanEvent");
-               b->set_mus_property ("span-direction", gh_int2scm (STOP))
-;
-               b->set_mus_property ("span-type", scm_makfrom0str ("beam"));
+               Music *b= MY_MAKE_MUSIC("BeamEvent");
+               b->set_mus_property ("span-direction", gh_int2scm (STOP));
                $$ = b;
        }
        | BREATHE {
@@ -1318,10 +1324,9 @@ shorthand_command_req:
        ;
 
 verbose_command_req:
-       COMMANDSPANREQUEST bare_int STRING { /*TODO: junkme */
-               Music * sp = MY_MAKE_MUSIC("SpanEvent");
+       COMMANDSPANREQUEST bare_int STRING {
+               Music *sp = make_span_req ($3);
                sp->set_mus_property ("span-direction", gh_int2scm (Direction ($2)));
-               sp->set_mus_property ("span-type",$3);
                sp->set_spot (THIS->here_input ());
                $$ = sp;
        }
@@ -1338,7 +1343,7 @@ verbose_command_req:
                Music * b = MY_MAKE_MUSIC("BreakEvent");
                SCM s = $2;
                if (!gh_number_p (s))
-                       s  =gh_int2scm (0);
+                       s gh_int2scm (0);
 
                b->set_mus_property ("penalty", s);
                b->set_spot (THIS->here_input ());
@@ -1431,9 +1436,9 @@ verbose_request:
                $$ = d;
        }
        | SPANREQUEST bare_int STRING {
-               Music * sp = MY_MAKE_MUSIC("SpanEvent");
+
+               Music * sp = make_span_req ($3);
                sp->set_mus_property ("span-direction", gh_int2scm ( $2));
-               sp->set_mus_property ("span-type", $3);
                sp->set_spot (THIS->here_input ());
                $$ = sp;
        }
@@ -1579,27 +1584,23 @@ close_request:
  
 close_request_parens:
        '('     {
-               Music * s= MY_MAKE_MUSIC("SpanEvent");
+               Music * s= MY_MAKE_MUSIC("SlurEvent");
                $$ = s;
-               s->set_mus_property ("span-type", scm_makfrom0str ( "slur"));
                s->set_spot (THIS->here_input());
        }
        | E_OPEN        {
-               Music * s= MY_MAKE_MUSIC("SpanEvent");
+               Music * s= MY_MAKE_MUSIC("PhrasingSlurEvent");
                $$ = s;
-               s->set_mus_property ("span-type", scm_makfrom0str ( "phrasing-slur"));
                s->set_spot (THIS->here_input());
        }
        | E_SMALLER {
-               Music *s =MY_MAKE_MUSIC("SpanEvent");
+               Music *s =MY_MAKE_MUSIC("CrescendoEvent");
                $$ = s;
-               s->set_mus_property ("span-type", scm_makfrom0str ( "crescendo"));
                s->set_spot (THIS->here_input());
        }
        | E_BIGGER {
-               Music *s =MY_MAKE_MUSIC("SpanEvent");
+               Music *s =MY_MAKE_MUSIC("DecrescendoEvent");
                $$ = s;
-               s->set_mus_property ("span-type", scm_makfrom0str ("decrescendo"));
                s->set_spot (THIS->here_input());
        }
        ;
@@ -1615,21 +1616,19 @@ open_request:
 
 open_request_parens:
        E_EXCLAMATION   {
-               Music *s =  MY_MAKE_MUSIC("SpanEvent");
-               s->set_mus_property ("span-type", scm_makfrom0str ( "crescendo"));
+               Music *s =  MY_MAKE_MUSIC("CrescendoEvent");
                s->set_spot (THIS->here_input());
 
                $$ = s;
        }
        | ')'   {
-               Music * s= MY_MAKE_MUSIC("SpanEvent");
+               Music * s= MY_MAKE_MUSIC("SlurEvent");
                $$ = s;
-               s->set_mus_property ("span-type", scm_makfrom0str ( "slur"));
                s->set_spot (THIS->here_input());
 
        }
        | E_CLOSE       {
-               Music * s= MY_MAKE_MUSIC("SpanEvent");
+               Music * s= MY_MAKE_MUSIC("PhrasingSlurEvent");
                $$ = s;
                s->set_mus_property ("span-type", scm_makfrom0str ( "phrasing-slur"));
                s->set_spot (THIS->here_input());
@@ -1940,16 +1939,12 @@ simple_element:
 
                Music * sk = MY_MAKE_MUSIC("SkipEvent");
                sk->set_mus_property ("duration", $2);
-               Music *sp1 = MY_MAKE_MUSIC("SpanEvent");
-               Music *sp2 = MY_MAKE_MUSIC("SpanEvent");
+               Music *sp1 = MY_MAKE_MUSIC("MultiMeasureRestEvent");
+               Music *sp2 = MY_MAKE_MUSIC("MultiMeasureRestEvent");
                sp1-> set_mus_property ("span-direction", gh_int2scm (START))
 ;
                sp2-> set_mus_property ("span-direction", gh_int2scm (STOP))
 ;
-               SCM r = scm_makfrom0str ("rest");
-               sp1->set_mus_property ("span-type", r);
-               sp2->set_mus_property ("span-type", r);
-
                Music *rqc1 = MY_MAKE_MUSIC("RequestChord");
                rqc1->set_mus_property ("elements", scm_list_n (sp1->self_scm (), SCM_UNDEFINED));
                Music *rqc2 = MY_MAKE_MUSIC("RequestChord");