// 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()
#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))
+
%}
%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
%token SHAPE
%token SKIP
%token SPANDYNAMIC
-%token STAFF
+
%token START_T
%token SYMBOLTABLES
%token TABLE
%type <duration> steno_duration notemode_duration
%type <duration> entered_notemode_duration explicit_duration
%type <interval> dinterval
-%type <intvec> intastint_list
+%type <intvec> intastint_list int_list
%type <lookup> symtables symtables_body
%type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
midi_body: /* empty */ {
$$ = THIS->default_midi_p ();
}
+ | MIDI_IDENTIFIER {
+ $$ = $1-> access_Midi_def ();
+ }
| midi_body STRING '=' translator_spec {
$$-> assign_translator (*$2, $4);
delete $2;
| Sequential_music { $$ = $1; }
| transposed_music { $$ = $1; }
| MUSIC_IDENTIFIER { $$ = $1->access_Music (); }
- | MELODIC
+ | NOTES
{ THIS->lexer_p_->push_note_state (); }
Music
{ $$ = $3;
;
explicit_musical_pitch:
- MUSICAL_PITCH '{' int int int '}' {/* ugh */
+ MUSICAL_PITCH '{' int_list '}' {/* ugh */
+ Array<int> &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
explicit_duration:
- DURATION '{' int unsigned '}' {
+ DURATION '{' int_list '}' {
$$ = new Duration;
- $$-> durlog_i_ = $3;
- $$-> dots_i_ = $4;
+ Array<int> &a = *$3;
+ ARRAY_SIZE(a,2);
+
+ $$-> durlog_i_ = a[0];
+ $$-> dots_i_ = a[1];
+
+ delete &a;
}
;
}
;
+
+int_list:
+ /**/ {
+ $$ = new Array<int>
+ }
+ | int_list int {
+ $$->push ($2);
+ }
+ ;
+
unsigned:
UNSIGNED {
$$ = $1;