]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parser.yy
* mf/GNUmakefile: always trace pfa fonts.
[lilypond.git] / lily / parser.yy
index 5ffd2d308e31a112a854e577ac376f471c700339..2f9d9b37c232daa0163a66877b4a4e2be722c178 100644 (file)
@@ -53,7 +53,9 @@ TODO:
 */
 
 #include <ctype.h>
+#include <stdio.h>
 #include <stdlib.h>
+#include <stdio.h>
 
 
 #include "scm-option.hh"
@@ -255,7 +257,6 @@ yylex (YYSTYPE *s,  void * v)
 %token DEFAULT
 %token DENIES
 %token DESCRIPTION
-%token DURATION
 %token EXTENDER
 %token FIGURES FIGURE_OPEN FIGURE_CLOSE
 %token FIGURE_BRACKET_CLOSE FIGURE_BRACKET_OPEN
@@ -276,12 +277,10 @@ yylex (YYSTYPE *s,  void * v)
 %token NOTES
 %token OCTAVE
 %token ONCE
-%token OUTPUTPROPERTY
 %token OVERRIDE SET REVERT 
 %token PAPER
 %token PARTCOMBINE
 %token PARTIAL
-%token PITCH
 %token PITCHNAMES
 %token PROPERTY
 %token RELATIVE
@@ -367,12 +366,11 @@ yylex (YYSTYPE *s,  void * v)
 %type <music> note_chord_element chord_body chord_body_element
 %type <scm>  chord_body_elements 
 %type <scm> steno_duration optional_notemode_duration multiplied_duration
-%type <scm>  verbose_duration
        
 %type <scm>   post_events 
 %type <music> gen_text_def direction_less_event direction_reqd_event
 %type <scm>   steno_pitch pitch absolute_pitch pitch_also_in_chords
-%type <scm>   explicit_pitch steno_tonic_pitch
+%type <scm>    steno_tonic_pitch
 %type <scm>    duration_length fraction
 
 %type <scm> new_chord step_number chord_items chord_item chord_separator step_numbers
@@ -541,9 +539,6 @@ identifier_init:
                $$ = $1->self_scm ();
                scm_gc_unprotect_object ($$);
        }
-       | verbose_duration {
-               $$ = $1;
-       }
        | number_expression {
                $$ = $1;
        }
@@ -893,25 +888,6 @@ Simple_music:
                $$->set_mus_property ("procedure", $2);
                $$->set_spot (THIS->here_input());
        }
-       | OUTPUTPROPERTY embedded_scm embedded_scm '=' embedded_scm     {
-               SCM pred = $2;
-               if (!gh_symbol_p ($3))
-               {
-                       THIS->parser_error (_ ("Second argument must be a symbol")); 
-               }
-               /* Should check # args */
-               if (!gh_procedure_p (pred))
-               {
-                       THIS->parser_error (_ ("First argument must be a procedure taking one argument"));
-               }
-
-               Music*m = MY_MAKE_MUSIC("OutputPropertySetMusic");
-               m->set_mus_property ("predicate", pred);
-               m->set_mus_property ("grob-property", $3);
-               m->set_mus_property ("grob-value",  $5);
-
-               $$ = m;
-       }
        | MUSIC_IDENTIFIER {
                $$ = unsmob_music ($1);
        }
@@ -1022,8 +998,10 @@ basic music objects too, since the meaning is different.
 
                csm->set_mus_property ("context-type", scm_string_to_symbol ($2));
 
-               SCM new_id = scm_number_to_string (gh_int2scm (new_context_count ++),
-                                       gh_int2scm (10));
+               char s[1024];
+               snprintf (s, 1024, "uniqueContext%d", new_context_count ++);
+               
+               SCM new_id = scm_makfrom0str (s);
                csm->set_mus_property ("context-id", new_id);
                $$ = csm;
        }
@@ -1062,15 +1040,20 @@ basic music objects too, since the meaning is different.
        }
        | APPLY embedded_scm Music  {
                if (!ly_input_procedure_p ($2))
+                       {
                        THIS->parser_error (_ ("\\apply takes function argument"));
-               
-               SCM ret = gh_call1 ($2, $3->self_scm ());
-               Music *m = unsmob_music (ret);
-               if (!m) {
-                       THIS->parser_error ("\\apply must return a Music");
-                       m = MY_MAKE_MUSIC("Music");
+                       $$ = $3;
+                       }
+               else
+                       {
+                       SCM ret = gh_call1 ($2, $3->self_scm ());
+                       Music *m = unsmob_music (ret);
+                       if (!m) {
+                               THIS->parser_error ("\\apply must return a Music");
+                               m = MY_MAKE_MUSIC("Music");
+                               }
+                       $$ = m;
                        }
-               $$ = m;
        }
        | NOTES
                { THIS->lexer_->push_note_state (); }
@@ -1706,9 +1689,6 @@ pitch:
        steno_pitch {
                $$ = $1;
        }
-       | explicit_pitch {
-               $$ = $1;
-       }
        ;
 
 pitch_also_in_chords:
@@ -1716,26 +1696,9 @@ pitch_also_in_chords:
        | steno_tonic_pitch
        ;
 
-explicit_pitch:
-       PITCH embedded_scm {
-               $$ = $2;
-               if (!unsmob_pitch ($2)) {
-                       THIS->parser_error (_f ("Expecting musical-pitch value", 3));
-                        $$ = Pitch ().smobbed_copy ();
-               }
-       }
-       ;
 
-verbose_duration:
-       DURATION embedded_scm   {
-               $$ = $2;
-               if (!unsmob_duration ($2))
-               {
-                       THIS->parser_error (_ ("Must have duration object"));
-                       $$ = Duration ().smobbed_copy ();
-               }
-       }
-       ;
+
+
 
 extender_req:
        EXTENDER {
@@ -1861,9 +1824,6 @@ duration_length:
        multiplied_duration {
                $$ = $1;
        }
-       | verbose_duration {
-               $$ = $1;
-       }       
        ;
 
 optional_notemode_duration:
@@ -1879,10 +1839,6 @@ optional_notemode_duration:
 
                THIS->beam_check ($$);
        }
-       | verbose_duration {
-               $$ = $1;
-               THIS->default_duration_ = *unsmob_duration ($$);
-       }       
        ;
 
 steno_duration: