From: fred Date: Tue, 26 Mar 2002 21:26:00 +0000 (+0000) Subject: lilypond-1.0.9 X-Git-Tag: release/1.5.59~2885 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0d417b53c9b72cd82ed34d32af0a0e56c717bdbf;p=lilypond.git lilypond-1.0.9 --- diff --git a/lily/parser.yy b/lily/parser.yy index ca673730c7..f9a3094e02 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -44,8 +44,8 @@ // mmm -Mudela_version oldest_version ("1.0.1"); -Mudela_version version ("1.0.2"); +Mudela_version oldest_version ("1.0.3"); +Mudela_version version ("1.0.3"); // needed for bison.simple's malloc() and free() @@ -74,6 +74,8 @@ Paper_def* current_paper = 0; #define THIS ((My_lily_parser *) my_lily_parser_l) #define yyerror THIS->parser_error +#define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f("expecting %d arguments", s)) + %} @@ -163,11 +165,11 @@ yylex (YYSTYPE *s, void * v_l) %token MARK %token MUSIC %token MUSICAL_PITCH -%token MELODIC +%token NOTES %token MIDI %token TIME_T %token MM_T -%token MULTI + %token NOTENAMES %token OCTAVE %token OUTPUT @@ -181,7 +183,7 @@ yylex (YYSTYPE *s, void * v_l) %token SHAPE %token SKIP %token SPANDYNAMIC -%token STAFF + %token START_T %token SYMBOLTABLES %token TABLE @@ -236,7 +238,7 @@ yylex (YYSTYPE *s, void * v_l) %type steno_duration notemode_duration %type entered_notemode_duration explicit_duration %type dinterval -%type intastint_list +%type intastint_list int_list %type symtables symtables_body %type explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch @@ -614,6 +616,9 @@ midi_block: midi_body: /* empty */ { $$ = THIS->default_midi_p (); } + | MIDI_IDENTIFIER { + $$ = $1-> access_Midi_def (); + } | midi_body STRING '=' translator_spec { $$-> assign_translator (*$2, $4); delete $2; @@ -678,7 +683,7 @@ Music: | Sequential_music { $$ = $1; } | transposed_music { $$ = $1; } | MUSIC_IDENTIFIER { $$ = $1->access_Music (); } - | MELODIC + | NOTES { THIS->lexer_p_->push_note_state (); } Music { $$ = $3; @@ -917,13 +922,17 @@ steno_musical_pitch: ; explicit_musical_pitch: - MUSICAL_PITCH '{' int int int '}' {/* ugh */ + MUSICAL_PITCH '{' int_list '}' {/* ugh */ + Array &a = *$3; + ARRAY_SIZE(a,3); $$ = new Musical_pitch; - $$->octave_i_ = $3; - $$->notename_i_ = $4; - $$->accidental_i_ = $5; + $$->octave_i_ = a[0]; + $$->notename_i_ = a[1]; + $$->accidental_i_ = a[2]; + delete &a; } ; + musical_pitch: steno_musical_pitch | explicit_musical_pitch @@ -943,10 +952,15 @@ steno_notepitch: explicit_duration: - DURATION '{' int unsigned '}' { + DURATION '{' int_list '}' { $$ = new Duration; - $$-> durlog_i_ = $3; - $$-> dots_i_ = $4; + Array &a = *$3; + ARRAY_SIZE(a,2); + + $$-> durlog_i_ = a[0]; + $$-> dots_i_ = a[1]; + + delete &a; } ; @@ -1278,6 +1292,16 @@ pitch_list: { } ; + +int_list: + /**/ { + $$ = new Array + } + | int_list int { + $$->push ($2); + } + ; + unsigned: UNSIGNED { $$ = $1;