%type <scm> composite_music
%type <scm> grouped_music_list
%type <scm> closed_music
-%type <scm> open_music
%type <scm> music
%type <scm> prefix_composite_music
%type <scm> repeated_music
%type <scm> context_prop_spec
%type <scm> direction_less_char
%type <scm> duration_length
-%type <scm> closed_embedded_scm
%type <scm> embedded_scm
+%type <scm> embedded_scm_bare
+%type <scm> embedded_scm_closed
+%type <scm> embedded_scm_chord_body
+%type <scm> embedded_scm_event
%type <scm> figure_list
%type <scm> figure_spec
%type <scm> fraction
%type <scm> full_markup
%type <scm> full_markup_list
-%type <scm> function_scm_argument
%type <scm> function_arglist
-%type <scm> function_arglist_nonmusic_last
-%type <scm> closed_function_arglist
-%type <scm> open_function_arglist
+%type <scm> function_arglist_bare
+%type <scm> function_arglist_closed
%type <scm> identifier_init
%type <scm> lilypond
%type <scm> lilypond_header
%type <scm> markup_composed_list
%type <scm> markup_command_list
%type <scm> markup_command_list_arguments
-%type <scm> closed_markup_command_list_arguments
%type <scm> markup_command_basic_arguments
%type <scm> markup_head_1_item
%type <scm> markup_head_1_list
%type <scm> property_operation
%type <scm> property_path property_path_revved
%type <scm> scalar
-%type <scm> closed_scalar
-%type <scm> open_scm_function_call
-%type <scm> closed_scm_function_call
+%type <scm> scalar_bare
+%type <scm> scalar_closed
+%type <scm> scm_function_call
+%type <scm> scm_function_call_closed
%type <scm> script_abbreviation
%type <scm> simple_chord_elements
%type <scm> simple_markup
}
;
-closed_embedded_scm:
+embedded_scm_bare:
SCM_TOKEN
| SCM_IDENTIFIER
- | closed_scm_function_call
;
+/* The generic version may end in music, or not */
+
embedded_scm:
- closed_embedded_scm
- | open_scm_function_call
+ embedded_scm_bare
+ | scm_function_call
;
-closed_scm_function_call:
- SCM_FUNCTION closed_function_arglist
- {
- $$ = run_music_function (PARSER, @$,
- $1, $2);
- }
- ;
-
-open_scm_function_call:
- SCM_FUNCTION open_function_arglist
- {
+scm_function_call:
+ SCM_FUNCTION function_arglist {
$$ = run_music_function (PARSER, @$,
$1, $2);
}
TEMPO steno_duration '=' tempo_range {
$$ = MAKE_SYNTAX ("tempo", @$, SCM_EOL, $2, $4);
}
- | TEMPO closed_scalar steno_duration '=' tempo_range {
+ | TEMPO scalar_closed steno_duration '=' tempo_range {
$$ = MAKE_SYNTAX ("tempo", @$, $2, $3, $5);
}
- | TEMPO closed_scalar {
+ | TEMPO scalar {
$$ = MAKE_SYNTAX ("tempo", @$, $2);
}
;
| grouped_music_list
;
-/* Music that potentially accepts additional events or durations */
-open_music:
- simple_music
- | prefix_composite_music
- ;
-
grouped_music_list:
simultaneous_music { $$ = $1; }
| sequential_music { $$ = $1; }
;
-function_scm_argument:
- closed_embedded_scm
- | simple_string
- ;
-
/* An argument list. If a function \foo expects scm scm music, then the lexer expands \foo into the token sequence:
MUSIC_FUNCTION EXPECT_MUSIC EXPECT_SCM EXPECT_SCM EXPECT_NO_MORE_ARGS
and this rule returns the reversed list of arguments. */
function_arglist:
- closed_function_arglist
- | open_function_arglist
+ function_arglist_bare
+ | EXPECT_MUSIC function_arglist music {
+ $$ = scm_cons ($3, $2);
+ }
+ | EXPECT_SCM function_arglist embedded_scm {
+ $$ = scm_cons ($3, $2);
+ }
;
-open_function_arglist:
- EXPECT_MUSIC function_arglist open_music {
+function_arglist_closed:
+ function_arglist_bare
+ | EXPECT_MUSIC function_arglist closed_music {
$$ = scm_cons ($3, $2);
}
- | EXPECT_SCM function_arglist open_scm_function_call {
+ | EXPECT_SCM function_arglist embedded_scm_closed {
$$ = scm_cons ($3, $2);
}
;
-/* a closed argument list is one that does not end in a music
- expression that could still take a duration or event */
+embedded_scm_closed:
+ embedded_scm_bare
+ | scm_function_call_closed
+ ;
-closed_function_arglist:
- function_arglist_nonmusic_last
- | EXPECT_MUSIC function_arglist closed_music {
- $$ = scm_cons ($3, $2);
- }
+scm_function_call_closed:
+ SCM_FUNCTION function_arglist_closed {
+ $$ = run_music_function (PARSER, @$,
+ $1, $2);
+ }
;
-function_arglist_nonmusic_last:
+function_arglist_bare:
EXPECT_NO_MORE_ARGS {
/* This is for 0-ary functions, so they don't need to
read a lookahead token */
| EXPECT_PITCH function_arglist pitch_also_in_chords {
$$ = scm_cons ($3, $2);
}
- | EXPECT_DURATION closed_function_arglist duration_length {
+ | EXPECT_DURATION function_arglist_closed duration_length {
$$ = scm_cons ($3, $2);
}
- | EXPECT_SCM function_arglist function_scm_argument {
- $$ = scm_cons ($3, $2);
+ | EXPECT_SCM function_arglist simple_string {
+ $$ = scm_cons ($3, $2);
}
;
property_path_revved:
- closed_embedded_scm {
+ embedded_scm_closed {
$$ = scm_cons ($1, SCM_EOL);
}
- | property_path_revved closed_embedded_scm {
+ | property_path_revved embedded_scm_closed {
$$ = scm_cons ($2, $1);
}
;
}
;
-closed_scalar: string {
+scalar_bare:
+ string {
$$ = $1;
}
| lyric_element {
| bare_number {
$$ = $1;
}
- | closed_embedded_scm {
+ | embedded_scm_bare {
$$ = $1;
}
| full_markup {
}
;
-scalar: closed_scalar
- | open_scm_function_call
+scalar:
+ scalar_bare |
+ scm_function_call
+ ;
+
+scalar_closed:
+ scalar_bare |
+ scm_function_call_closed
;
+
event_chord:
/* TODO: Create a special case that avoids the creation of
EventChords around simple_elements that have no post_events?
*/
music_function_chord_body_arglist:
- function_arglist_nonmusic_last
+ function_arglist_bare
| EXPECT_MUSIC music_function_chord_body_arglist chord_body_element {
$$ = scm_cons ($3, $2);
}
+ | EXPECT_SCM function_arglist embedded_scm_chord_body {
+ $$ = scm_cons ($3, $2);
+ }
+ ;
+
+embedded_scm_chord_body:
+ embedded_scm_bare
+ | SCM_FUNCTION music_function_chord_body_arglist {
+ $$ = run_music_function (PARSER, @$,
+ $1, $2);
+ }
;
music_function_chord_body:
* refrain from doing so.
*/
music_function_event_arglist:
- function_arglist_nonmusic_last
+ function_arglist_bare
| EXPECT_MUSIC music_function_event_arglist post_event {
$$ = scm_cons ($3, $2);
}
+ | EXPECT_SCM function_arglist embedded_scm_event {
+ $$ = scm_cons ($3, $2);
+ }
+ ;
+
+embedded_scm_event:
+ embedded_scm_bare
+ | SCM_FUNCTION music_function_event_arglist {
+ $$ = run_music_function (PARSER, @$,
+ $1, $2);
+ }
;
music_function_event:
;
markup_command_list:
- MARKUP_LIST_FUNCTION closed_markup_command_list_arguments {
+ MARKUP_LIST_FUNCTION markup_command_list_arguments {
$$ = scm_cons ($1, scm_reverse_x($2, SCM_EOL));
}
;
EXPECT_MARKUP_LIST markup_command_list_arguments markup_list {
$$ = scm_cons ($3, $2);
}
- | EXPECT_SCM markup_command_list_arguments closed_embedded_scm {
+ | EXPECT_SCM markup_command_list_arguments embedded_scm_closed {
$$ = scm_cons ($3, $2);
}
| EXPECT_NO_MORE_ARGS {
}
;
-closed_markup_command_list_arguments:
+markup_command_list_arguments:
markup_command_basic_arguments { $$ = $1; }
| EXPECT_MARKUP markup_command_list_arguments markup {
$$ = scm_cons ($3, $2);
}
;
-markup_command_list_arguments:
- closed_markup_command_list_arguments
- | EXPECT_SCM markup_command_list_arguments open_scm_function_call
- {
- $$ = scm_cons ($3, $2);
- }
- ;
-
markup_head_1_item:
MARKUP_FUNCTION EXPECT_MARKUP markup_command_list_arguments {
$$ = scm_cons ($1, scm_reverse_x ($3, SCM_EOL));