+ THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
+ $$ = THIS->get_word_element (ly_scm2string ($1), $2);
+
+ }
+ | chord {
+ if (!THIS->lexer_p_->chord_state_b ())
+ THIS->parser_error (_ ("Have to be in Chord mode for chords"));
+ $$ = $1;
+ }
+ ;
+
+chord:
+ steno_tonic_pitch optional_notemode_duration chord_additions chord_subtractions chord_inversion chord_bass {
+ $$ = THIS->get_chord (*$1, $3, $4, $5, $6, *$2);
+ };
+
+chord_additions:
+ {
+ $$ = new Array<Musical_pitch>;
+ }
+ | CHORD_COLON chord_notes {
+ $$ = $2;
+ }
+ ;
+
+chord_notes:
+ chord_step {
+ $$ = $1
+ }
+ | chord_notes '.' chord_step {
+ $$ = $1;
+ $$->concat (*$3);
+ }
+ ;
+
+chord_subtractions:
+ {
+ $$ = new Array<Musical_pitch>;
+ }
+ | CHORD_CARET chord_notes {
+ $$ = $2;
+ }
+ ;
+
+
+chord_inversion:
+ {
+ $$ = 0;
+ }
+ | '/' steno_tonic_pitch {
+ $$ = $2;
+ $$->set_spot (THIS->here_input ());
+ }
+ ;
+
+chord_bass:
+ {
+ $$ = 0;
+ }
+ | CHORD_BASS steno_tonic_pitch {
+ $$ = $2;
+ $$->set_spot (THIS->here_input ());
+ }
+ ;
+
+chord_step:
+ chord_note {
+ $$ = new Array<Musical_pitch>;
+ $$->push (*$1);
+ }
+ | CHORDMODIFIER_PITCH {
+ $$ = new Array<Musical_pitch>;
+ $$->push (*$1);
+ }
+ | CHORDMODIFIER_PITCH chord_note { /* Ugh. */
+ $$ = new Array<Musical_pitch>;
+ $$->push (*$1);
+ $$->push (*$2);