%token ADDQUOTE "\\addquote"
%token ALIAS "\\alias"
%token ALTERNATIVE "\\alternative"
-%token BOOK "\\book"
+%token BOOK "\book"
%token CHANGE "\\change"
%token CHORDMODE "\\chordmode"
%token CHORDS "\\chords"
%token CHORD_COLON ":"
%token CHORD_MINUS "-"
%token CHORD_SLASH "/"
-%token ANGLE_OPEN "<"
-%token ANGLE_CLOSE ">"
-%token DOUBLE_ANGLE_OPEN "<<"
%token DOUBLE_ANGLE_CLOSE ">>"
+%token DOUBLE_ANGLE_OPEN "<<"
%token E_BACKSLASH "\\"
%token E_ANGLE_CLOSE "\\>"
%token E_CHAR "\\C[haracter]"
%type <scm> simple_music_property_def
%type <scm> string_number_event
%type <scm> tempo_event
+%type <scm> toplevel_music
%type <outputdef> output_def_body
%type <outputdef> output_def_head
%type <scm> music_function_event
%type <scm> music_function_chord_body
%type <scm> music_function_musicless_prefix
-%type <scm> music_function_musicless_function
%type <scm> bass_figure
%type <scm> figured_bass_modification
%type <scm> br_bass_figure
scm_call_2 (proc, PARSER->self_scm (), score->self_scm ());
score->unprotect ();
}
- | composite_music {
+ | toplevel_music {
Music *music = unsmob_music ($1);
SCM proc = PARSER->lexer_->lookup_identifier ("toplevel-music-handler");
scm_call_2 (proc, PARSER->self_scm (), music->self_scm ());
}
;
+toplevel_music:
+ composite_music {
+ }
+ ;
+
embedded_scm:
SCM_T
| SCM_IDENTIFIER
SIMULTANEOUS '{' music_list '}'{
$$ = MAKE_SYNTAX ("simultaneous-music", @$, scm_car ($3));
}
- | DOUBLE_ANGLE_OPEN music_list DOUBLE_ANGLE_CLOSE {
+ | simul_open music_list simul_close {
$$ = MAKE_SYNTAX ("simultaneous-music", @$, scm_car ($2));
}
;
/*
TODO: use code generation for this
*/
-music_function_musicless_function:
+generic_prefix_music_scm:
MUSIC_FUNCTION {
$$ = scm_list_2 ($1, make_input (@$));
}
| MUSIC_FUNCTION_MARKUP full_markup {
$$ = scm_list_3 ($1, make_input (@$), $2);
}
+ | music_function_musicless_prefix music {
+ $$ = ly_append2 ($1, scm_list_1 ($2));
+ }
| MUSIC_FUNCTION_SCM_SCM function_scm_argument function_scm_argument {
$$ = scm_list_4 ($1, make_input (@$), $2, $3);
}
| MUSIC_FUNCTION_SCM_SCM_SCM function_scm_argument function_scm_argument function_scm_argument {
$$ = scm_list_5 ($1, make_input (@$), $2, $3, $4);
}
- | MUSIC_FUNCTION_MARKUP_MARKUP full_markup full_markup {
+ | MUSIC_FUNCTION_MARKUP_MUSIC full_markup music {
$$ = scm_list_4 ($1, make_input (@$), $2, $3);
}
- ;
-
-/*
-TODO: use code generation for this
-*/
-music_function_musicless_prefix:
- MUSIC_FUNCTION_MUSIC {
- $$ = scm_list_2 ($1, make_input (@$));
- }
- | MUSIC_FUNCTION_SCM_MUSIC function_scm_argument {
- $$ = scm_list_3 ($1, make_input (@$), $2);
- }
- | MUSIC_FUNCTION_SCM_SCM_MUSIC function_scm_argument function_scm_argument {
+ | MUSIC_FUNCTION_MARKUP_MARKUP full_markup full_markup {
$$ = scm_list_4 ($1, make_input (@$), $2, $3);
}
- | MUSIC_FUNCTION_SCM_SCM_SCM_MUSIC function_scm_argument function_scm_argument function_scm_argument {
- $$ = scm_list_5 ($1, make_input (@$), $2, $3, $4);
- }
- | MUSIC_FUNCTION_SCM_SCM_SCM_SCM_MUSIC function_scm_argument function_scm_argument function_scm_argument function_scm_argument {
- $$ = scm_list_n ($1, make_input (@$), $2, $3, $4, $5, SCM_UNDEFINED);
- }
- | MUSIC_FUNCTION_MARKUP_MUSIC full_markup {
- $$ = scm_list_3 ($1, make_input (@$), $2);
- }
- ;
-
-generic_prefix_music_scm:
- music_function_musicless_function {
- $$ = $1;
- }
- | music_function_musicless_prefix music {
- $$ = ly_append2 ($1, scm_list_1 ($2));
- }
| MUSIC_FUNCTION_MUSIC_MUSIC music music {
$$ = scm_list_4 ($1, make_input (@$), $2, $3);
}
}
;
-
optional_id:
/**/ { $$ = SCM_EOL; }
| '=' simple_string {
}
;
+chord_open: '<'
+ ;
+
+chord_close: '>'
+ ;
+
+simul_open: DOUBLE_ANGLE_OPEN
+ ;
+
+simul_close: DOUBLE_ANGLE_CLOSE
+ ;
+
chord_body:
- ANGLE_OPEN chord_body_elements ANGLE_CLOSE
+ chord_open chord_body_elements chord_close
{
$$ = MAKE_SYNTAX ("event-chord", @$, scm_reverse_x ($2, SCM_EOL));
}
;
music_function_chord_body:
- music_function_musicless_function {
- $$ = $1;
+ MUSIC_FUNCTION {
+ $$ = scm_list_2 ($1, make_input (@$));
}
| music_function_musicless_prefix chord_body_element {
$$ = ly_append2 ($1, scm_list_1 ($2));
music_function_musicless_prefix post_event {
$$ = ly_append2 ($1, scm_list_1 ($2));
}
- | music_function_musicless_function {
- $$ = $1;
+ ;
+
+/*
+TODO: use code generation for this
+*/
+music_function_musicless_prefix:
+ MUSIC_FUNCTION_MUSIC {
+ $$ = scm_list_2 ($1, make_input (@$));
+ }
+ | MUSIC_FUNCTION_SCM_MUSIC function_scm_argument {
+ $$ = scm_list_3 ($1, make_input (@$), $2);
+ }
+ | MUSIC_FUNCTION_SCM_SCM_MUSIC function_scm_argument function_scm_argument {
+ $$ = scm_list_4 ($1, make_input (@$), $2, $3);
+ }
+ | MUSIC_FUNCTION_SCM_SCM_SCM_MUSIC function_scm_argument function_scm_argument function_scm_argument {
+ $$ = scm_list_5 ($1, make_input (@$), $2, $3, $4);
+ }
+ | MUSIC_FUNCTION_SCM_SCM_SCM_SCM_MUSIC function_scm_argument function_scm_argument function_scm_argument function_scm_argument {
+ $$ = scm_list_n ($1, make_input (@$), $2, $3, $4, $5, SCM_UNDEFINED);
}
;
-
+
command_element:
command_event {
| '|' {
$$ = scm_makfrom0str ("Bar");
}
- | ANGLE_CLOSE {
+ | '>' {
$$ = scm_makfrom0str ("Larger");
}
| '.' {