source file of the GNU LilyPond music typesetter
- (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
/*
Two shift/reduce problems:
- - empty music-list
- - empty pre-events
-
-
-
-(bullshit.
-
-s/r:
1. foo = bar.
- "bar" -> String -> Lyric -> Music
+ "bar" -> String -> Lyric -> Music -> music-assignment
- "bar" -> String
+ "bar" -> String -> string-assignment
2. \repeat
%token <scm> DURATION_IDENTIFIER
%token <scm> FRACTION
%token <id> IDENTIFIER
+%token <scm> CHORDNAMES CHORDNAMES_IDENTIFIER
+%type <scm> chordnames_block chordnames_list chord_scm
%token <scm> SCORE_IDENTIFIER
else
scm_hashq_set_x (tab, ly_caar (s), pt);
}
-
$$ = tab;
}
;
| embedded_scm {
$$ = $1;
}
+ | chordnames_block {
+ $$ = $1;
+ }
+ ;
+
+chordnames_block:
+ CHORDNAMES '{'
+ { THIS->lexer_->push_chord_state (); }
+ chordnames_list
+ { THIS->lexer_->pop_state (); }
+ '}'
+ {
+ $$ = $4;
+ }
;
+chordnames_list:
+ /* empty */ {
+ $$ = SCM_EOL;
+ }
+ | CHORDNAMES_IDENTIFIER chordnames_list {
+ $$ = scm_append (scm_list_2 ($1, $2));
+ }
+ | chord_scm '=' full_markup chordnames_list {
+ $$ = scm_cons (scm_cons ($1, $3), $4);
+ };
+
+chord_scm:
+ steno_tonic_pitch optional_notemode_duration chord_additions chord_subtractions chord_inversion chord_bass {
+ $$ = Chord::tonic_add_sub_to_pitches ($1, $3, $4);
+ /* junk bass and inversion for now */
+ };
+
translator_spec_block:
TRANSLATOR '{' translator_spec_body '}'
{
string { $$ = $1; }
| bare_int { $$ = gh_int2scm ($1); }
| embedded_scm { $$ = $1; }
+ | full_markup { $$ = $1; }
;
$$ = t;
}
| string {
- $$ = make_simple_markup ($1);
+ Music *t = MY_MAKE_MUSIC("TextScriptEvent");
+ t->set_mus_property ("text", make_simple_markup ($1));
+ t->set_spot (THIS->here_input ());
+ $$ = t;
+
}
| DIGIT {
Music * t = MY_MAKE_MUSIC("FingerEvent");
full_markup:
- MARKUP
+ MARKUP_IDENTIFIER {
+ $$ = $1;
+ }
+ | MARKUP
{ THIS->lexer_->push_markup_state (); }
markup
{ $$ = $3;
| MARKUP_HEAD_MARKUP0 markup {
$$ = scm_list_n ($1, $2, SCM_UNDEFINED);
}
+ | MARKUP_HEAD_MARKUP0_MARKUP1 markup markup {
+ $$ = scm_list_n ($1, $2, $3, SCM_UNDEFINED);
+ }
| MARKUP_HEAD_SCM0_MARKUP1 SCM_T markup {
$$ = scm_list_n ($1, $2, $3, SCM_UNDEFINED);
}
;
markup_list:
- '<' markup_list_body '>' { $$ = scm_reverse_x ($2, SCM_EOL); }
+ CHORD_OPEN markup_list_body CHORD_CLOSE { $$ = scm_reverse_x ($2, SCM_EOL); }
;
markup_line: