1 %{ // -*-Fundamental-*-
4 parser.yy -- Bison/C++ parser for mudela
6 source file of the GNU LilyPond music typesetter
8 (c) 1997 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 Jan Nieuwenhuizen <janneke@gnu.org>
13 #include "lily-guile.hh"
14 #include "notename-table.hh"
16 #include "translation-property.hh"
19 #include "my-lily-lexer.hh"
20 #include "paper-def.hh"
21 #include "midi-def.hh"
23 #include "file-path.hh"
26 #include "dimensions.hh"
27 #include "identifier.hh"
28 #include "command-request.hh"
29 #include "musical-request.hh"
30 #include "my-lily-parser.hh"
31 #include "context-specced-music.hh"
32 #include "translator-group.hh"
34 #include "music-list.hh"
35 #include "duration-convert.hh"
36 #include "change-translator.hh"
37 #include "file-results.hh"
39 #include "relative-music.hh"
40 #include "lyric-combine-music.hh"
41 #include "transposed-music.hh"
42 #include "time-scaled-music.hh"
43 #include "new-repeated-music.hh"
44 #include "mudela-version.hh"
45 #include "grace-music.hh"
48 Mudela_version oldest_version ("1.1.52");
53 print_mudela_versions (ostream &os)
55 os << "Oldest supported input version: " << oldest_version.str () << endl;
57 // needed for bison.simple's malloc() and free()
64 #define YYERROR_VERBOSE 1
66 #define YYPARSE_PARAM my_lily_parser_l
67 #define YYLEX_PARAM my_lily_parser_l
68 #define THIS ((My_lily_parser *) my_lily_parser_l)
70 #define yyerror THIS->parser_error
71 #define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f("expecting %d arguments", s))
78 Array<Musical_pitch> *pitch_arr;
79 Link_array<Request> *reqvec;
80 Array<String> * strvec;
82 Notename_table *chordmodifiertab;
86 Music_list *music_list;
91 Music_output_def * outputdef;
92 Musical_pitch * pitch;
95 Notename_table *notenametab;
111 yylex (YYSTYPE *s, void * v_l)
113 My_lily_parser *pars_l = (My_lily_parser*) v_l;
114 My_lily_lexer * lex_l = pars_l->lexer_p_;
116 lex_l->lexval_l = (void*) s;
117 return lex_l->yylex ();
125 /* tokens which are not keywords */
133 %token CHORDMODIFIERS
185 %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
187 %type <i> exclamations questions
189 %token <pitch> NOTENAME_PITCH
190 %token <pitch> TONICNAME_PITCH
191 %token <pitch> CHORDMODIFIER_PITCH
192 %token <id> DURATION_IDENTIFIER
193 %token <id> IDENTIFIER
194 %token <id> NOTENAME_TABLE_IDENTIFIER
195 %token <id> MUSIC_IDENTIFIER
196 %token <id> REQUEST_IDENTIFIER
197 %token <id> REAL_IDENTIFIER
198 %token <id> STRING_IDENTIFIER
199 %token <id> TRANS_IDENTIFIER
200 %token <id> INT_IDENTIFIER
201 %token <id> SCORE_IDENTIFIER
202 %token <id> MIDI_IDENTIFIER
203 %token <id> PAPER_IDENTIFIER
205 %token <string> DURATION RESTNAME
206 %token <string> STRING
210 %type <outputdef> output_def
211 %type <scope> mudela_header mudela_header_body
212 %type <request> open_request_parens close_request_parens open_request close_request
213 %type <request> request_with_dir request_that_take_dir verbose_request
214 %type <i> sub_quotes sup_quotes
215 %type <music> simple_element request_chord command_element Simple_music Composite_music
216 %type <music> Alternative_music Repeated_music
217 %type <i> abbrev_type
218 %type <i> int unsigned
220 %type <i> optional_modality
221 %type <id> identifier_init
222 %type <duration> steno_duration optional_notemode_duration
223 %type <duration> entered_notemode_duration explicit_duration
224 %type <intvec> int_list
225 %type <reqvec> pre_requests post_requests
226 %type <request> gen_text_def
227 %type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
228 %type <pitch> steno_tonic_pitch
230 %type <pitch_arr> pitch_list
232 %type <pitch_arr> chord_additions chord_subtractions chord_notes
233 %type <pitch> chord_note chord_inversion
234 %type <midi> midi_block midi_body
235 %type <duration> duration_length
237 %type <scalar> scalar
238 %type <music> Music Sequential_music Simultaneous_music Music_sequence
239 %type <music> relative_music re_rhythmed_music
240 %type <music> property_def translator_change
241 %type <music_list> Music_list
242 %type <paper> paper_block paper_def_body
243 %type <real> real real_with_dimension
244 %type <request> abbrev_command_req
245 %type <request> post_request
246 %type <request> command_req verbose_command_req
247 %type <request> extender_req
248 %type <request> hyphen_req
249 %type <string> string
250 %type <score> score_block score_body
251 %type <realarr> real_array
253 %type <string> script_abbreviation
254 %type <trans> translator_spec_block translator_spec_body
255 %type <tempo> tempo_request
256 %type <notenametab> notenames_body notenames_block chordmodifiers_block
267 | mudela toplevel_expression {}
268 | mudela assignment { }
271 THIS->error_level_i_ =1;
277 THIS->lexer_p_->set_notename_table ($1);
279 | chordmodifiers_block {
280 THIS->lexer_p_->set_chordmodifier_table ($1);
283 delete header_global_p;
284 header_global_p = $1;
287 score_global_array.push ($1);
290 Identifier * id = new
291 Paper_def_identifier ($1, PAPER_IDENTIFIER);
292 THIS->lexer_p_->set_identifier ("$defaultpaper", id)
295 Identifier * id = new
296 Midi_def_identifier ($1, MIDI_IDENTIFIER);
297 THIS->lexer_p_->set_identifier ("$defaultmidi", id)
304 SCMFILE STRING semicolon {
305 read_lily_scm_file (*$2);
308 | SCM_T STRING semicolon {
309 if (THIS->lexer_p_->main_input_b_ && safe_global_b)
310 error (_("Cannot evaluate Scheme in safe mode"));
311 gh_eval_str ($2->ch_l ());
316 chordmodifiers_block:
317 CHORDMODIFIERS '{' notenames_body '}' { $$ = $3; }
322 NOTENAMES '{' notenames_body '}' { $$ = $3; }
329 $$ = new Notename_table;
331 | NOTENAME_TABLE_IDENTIFIER {
332 $$ = $1-> access_content_Notename_table(true);
334 | notenames_body STRING '=' explicit_musical_pitch {
345 THIS->lexer_p_-> scope_l_arr_.push ($$);
347 | mudela_header_body assignment semicolon {
353 HEADER '{' mudela_header_body '}' {
355 THIS->lexer_p_-> scope_l_arr_.pop ();
365 THIS->remember_spot ();
367 /* cont */ '=' identifier_init {
368 THIS->lexer_p_->set_identifier (*$1, $4);
369 $4->init_b_ = THIS->init_parse_b_;
370 $4->set_spot (THIS->pop_spot ());
378 $$ = new Score_identifier ($1, SCORE_IDENTIFIER);
381 | chordmodifiers_block {
382 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
385 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
388 $$ = new Paper_def_identifier ($1, PAPER_IDENTIFIER);
391 $$ = new Midi_def_identifier ($1, MIDI_IDENTIFIER);
394 | translator_spec_block {
395 $$ = new Translator_identifier ($1, TRANS_IDENTIFIER);
398 $$ = new Music_identifier ($1, MUSIC_IDENTIFIER);
402 $$ = new Request_identifier ($1, REQUEST_IDENTIFIER);
404 | explicit_duration {
405 $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
408 $$ = new Real_identifier (new Real ($1), REAL_IDENTIFIER);
411 $$ = new String_identifier ($1, STRING_IDENTIFIER);
414 $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
418 translator_spec_block:
419 TRANSLATOR '{' translator_spec_body '}'
425 translator_spec_body:
427 $$ = $1->access_content_Translator (true);
428 $$-> set_spot (THIS->here_input ());
430 | TYPE STRING semicolon {
431 Translator* t = get_translator_l (*$2);
432 Translator_group * tg = dynamic_cast<Translator_group*> (t);
435 THIS->parser_error (_("Need a translator group for a context"));
438 t->set_spot (THIS->here_input ());
442 | translator_spec_body STRING '=' identifier_init semicolon {
444 String_identifier *s = dynamic_cast<String_identifier*> (id);
445 Real_identifier *r= dynamic_cast<Real_identifier*>(id);
446 int_identifier *i = dynamic_cast<int_identifier*> (id);
449 if (s) str = *s->access_content_String (false);
450 if (i) str = to_str (*i->access_content_int (false));
451 if (r) str = to_str (*r->access_content_Real (false));
453 THIS->parser_error (_("Wrong type for property value"));
457 Translator_group * tr = dynamic_cast<Translator_group*>($$);
458 tr->set_property (*$2, str);
460 | translator_spec_body NAME STRING semicolon {
464 | translator_spec_body CONSISTS STRING semicolon {
465 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
468 | translator_spec_body CONSISTSEND STRING semicolon {
469 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
472 | translator_spec_body ACCEPTS STRING semicolon {
473 dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
476 | translator_spec_body REMOVE STRING semicolon {
477 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
488 /*cont*/ '{' score_body '}' {
490 if (!$$->def_p_arr_.size ())
491 $$->add_output (THIS->default_paper_p ());
497 $$->set_spot (THIS->here_input ());
500 $$ = $1->access_content_Score (true);
502 | score_body mudela_header {
507 $2->warning (_ ("More than one music block"));
510 | score_body output_def {
532 PAPER '{' paper_def_body '}' {
534 THIS-> lexer_p_->scope_l_arr_.pop ();
541 Paper_def *p = THIS->default_paper_p ();
542 THIS-> lexer_p_-> scope_l_arr_.push (p->scope_p_);
546 Paper_def *p = $1->access_content_Paper_def (true);
547 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
550 | paper_def_body int '=' FONT STRING { // ugh, what a syntax
551 Lookup * l = new Lookup;
554 $$->set_lookup ($2, l);
556 | paper_def_body assignment semicolon {
559 | paper_def_body translator_spec_block {
560 $$->assign_translator ($2);
562 | paper_def_body SHAPE real_array semicolon {
567 warning ("Need even number of args for shape array");
569 for (int i=0; i < $3->size (); i+=2)
571 Real l = $3->elem (i);
572 $$->shape_int_a_.push (Interval (l,
573 l + $3->elem (i+1)));
577 | paper_def_body error {
603 | real_with_dimension
605 $$= *$1->access_content_Real (false);
607 | '-' real %prec UNARY_MINUS {
630 $$ = new Array<Real>;
634 $$ = new Array<Real>;
636 | real_array ',' real {
647 '{' midi_body '}' { $$ = $3; }
650 midi_body: /* empty */ {
651 $$ = THIS->default_midi_p ();
654 $$ = $1-> access_content_Midi_def (true);
656 | midi_body assignment semicolon {
659 | midi_body translator_spec_block {
660 $$-> assign_translator ($2);
662 | midi_body tempo_request semicolon {
663 $$->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
672 TEMPO steno_duration '=' unsigned {
676 $$-> metronome_i_ = $4;
680 Music_list: /* empty */ {
682 $$->set_spot (THIS->here_input ());
701 | ALTERNATIVE Music_sequence {
703 $2->set_spot (THIS->here_input ());
711 REPEAT STRING unsigned Music Alternative_music
713 Music_sequence* m = dynamic_cast <Music_sequence*> ($5);
714 if (m && $3 < m->length_i ())
715 $5->warning ("More alternatives than repeats. Junking excess alternatives.");
717 Repeated_music * r = new Repeated_music ($4, $3 >? 1, m);
719 r->fold_b_ = (*$2 == "fold");
720 r->semi_fold_b_ = (*$2 == "semi");
722 r->set_spot ($4->spot ());
726 Music_sequence: '{' Music_list '}' {
727 $$ = new Music_sequence ($2);
728 $$->set_spot ($2->spot ());
732 Sequential_music: '{' Music_list '}' {
733 $$ = new Sequential_music ($2);
734 $$->set_spot ($2->spot ());
738 Simultaneous_music: '<' Music_list '>' {
739 $$ = new Simultaneous_music ($2);
740 $$->set_spot ($2->spot ());
745 request_chord { $$ = $1; }
746 | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
749 | Simple_music '*' unsigned '/' unsigned {
751 $$ = new Time_scaled_music ($3, $5, $1);
753 | Simple_music '*' unsigned {
754 $$ = new Time_scaled_music ($3, 1, $1);
760 CONTEXT STRING Music {
761 Context_specced_music *csm = new Context_specced_music ($3);
763 csm->translator_type_str_ = *$2;
764 csm->translator_id_str_ = "";
770 $$ = new Grace_music ($2);
772 | CONTEXT STRING '=' STRING Music {
773 Context_specced_music *csm = new Context_specced_music ($5);
775 csm->translator_type_str_ = *$2;
776 csm->translator_id_str_ = *$4;
783 THIS->remember_spot ();
786 unsigned '/' unsigned Music
789 $$ = new Time_scaled_music ($3, $5, $6);
790 $$->set_spot (THIS->pop_spot ());
792 | Repeated_music { $$ = $1; }
793 | Simultaneous_music { $$ = $1; }
794 | Sequential_music { $$ = $1; }
795 | TRANSPOSE musical_pitch Music {
796 $$ = new Transposed_music ($3, *$2);
799 | TRANSPOSE steno_tonic_pitch Music {
800 $$ = new Transposed_music ($3, *$2);
804 { THIS->lexer_p_->push_note_state (); }
807 THIS->lexer_p_->pop_state ();
810 { THIS->lexer_p_->push_chord_state (); }
814 THIS->lexer_p_->pop_state ();
817 { THIS->lexer_p_->push_lyric_state (); }
821 THIS->lexer_p_->pop_state ();
823 | relative_music { $$ = $1; }
824 | re_rhythmed_music { $$ = $1; }
828 RELATIVE absolute_musical_pitch Music {
829 $$ = new Relative_octave_music ($3, *$2);
835 ADDLYRICS Music Music {
836 Lyric_combine_music * l = new Lyric_combine_music ($2, $3);
842 TRANSLATOR STRING '=' STRING {
843 Change_translator * t = new Change_translator;
844 t-> change_to_type_str_ = *$2;
845 t-> change_to_id_str_ = *$4;
848 $$->set_spot (THIS->here_input ());
855 PROPERTY STRING '.' STRING '=' scalar {
856 Translation_property *t = new Translation_property;
861 Context_specced_music *csm = new Context_specced_music (t);
863 $$->set_spot (THIS->here_input ());
865 csm-> translator_type_str_ = *$2;
874 string { $$ = new Scalar (*$1); delete $1; }
875 | int { $$ = new Scalar ($1); }
880 pre_requests simple_element post_requests {
881 Music_sequence *l = dynamic_cast<Music_sequence*>($2);
882 for (int i=0; i < $1->size(); i++)
883 l->add_music ($1->elem(i));
884 for (int i=0; i < $3->size(); i++)
885 l->add_music ($3->elem(i));
894 $$ = new Request_chord;
895 $$-> set_spot (THIS->here_input ());
896 $1-> set_spot (THIS->here_input ());
897 ((Simultaneous_music*)$$) ->add_music ($1);//ugh
903 | verbose_command_req semicolon { $$ = $1; }
914 $$ = new Barcheck_req;
920 Span_req*b= new Span_req;
921 b->span_dir_ = START;
922 b->span_type_str_ = "beam";
926 Span_req*b= new Span_req;
928 b->span_type_str_ = "beam";
932 $$ = new Breathing_sign_req;
939 $$ = new Bar_req (*$2);
943 $$ = new Mark_req (*$2);
947 $$ = new Mark_req (to_str ($2));
949 | TIME_T unsigned '/' unsigned {
950 Time_signature_change_req *m = new Time_signature_change_req;
956 Break_req * b = new Break_req;
958 b-> set_spot (THIS->here_input ());
961 | SKIP duration_length {
962 Skip_req * skip_p = new Skip_req;
963 skip_p->duration_ = *$2;
971 $$ = new Cadenza_req ($2);
973 | PARTIAL duration_length {
974 $$ = new Partial_measure_req ($2->length_mom ());
978 $$ = new Clef_change_req (*$2);
981 | KEY NOTENAME_PITCH optional_modality {
982 Key_change_req *key_p= new Key_change_req;
983 key_p->key_.pitch_arr_.push (*$2);
984 key_p->key_.ordinary_key_b_ = true;
985 key_p->key_.modality_i_ = $3;
989 | KEYSIGNATURE pitch_list {
990 Key_change_req *key_p= new Key_change_req;
991 key_p->key_.pitch_arr_ = *$2;
992 key_p->key_.ordinary_key_b_ = false;
1001 $$ = new Link_array<Request>;
1003 | post_requests post_request {
1004 $2->set_spot (THIS->here_input ());
1016 request_that_take_dir:
1019 | script_abbreviation {
1020 Identifier*i = THIS->lexer_p_->lookup_identifier ("dash-" + *$1);
1021 Articulation_req *a = new Articulation_req;
1022 a->articulation_str_ = *i->access_content_String (false);
1029 script_dir request_that_take_dir {
1030 if (Script_req * gs = dynamic_cast<Script_req*> ($2))
1031 gs->dir_ = Direction ($1);
1033 $2->warning ("Can't specify direction for this request");
1039 REQUEST_IDENTIFIER {
1040 $$ = (Request*)$1->access_content_Request (true);
1041 $$->set_spot (THIS->here_input ());
1043 | TEXTSCRIPT STRING STRING {
1044 Text_script_req *ts_p = new Text_script_req;
1045 ts_p-> text_str_ = *$2;
1046 ts_p-> style_str_ = *$3;
1047 ts_p->set_spot (THIS->here_input ());
1052 | SPANREQUEST int STRING {
1053 Span_req * sp_p = new Span_req;
1054 sp_p-> span_dir_ = Direction($2);
1055 sp_p->span_type_str_ = *$3;
1056 sp_p->set_spot (THIS->here_input ());
1060 Tremolo_req* a = new Tremolo_req;
1061 a->set_spot (THIS->here_input ());
1066 Articulation_req * a = new Articulation_req;
1067 a->articulation_str_ = *$2;
1068 a->set_spot (THIS->here_input ());
1101 steno_musical_pitch:
1105 | NOTENAME_PITCH sup_quotes {
1107 $$->octave_i_ += $2;
1109 | NOTENAME_PITCH sub_quotes {
1111 $$->octave_i_ += - $2;
1119 | TONICNAME_PITCH sup_quotes {
1121 $$->octave_i_ += $2;
1123 | TONICNAME_PITCH sub_quotes {
1125 $$->octave_i_ += - $2;
1129 explicit_musical_pitch:
1130 MUSICAL_PITCH '{' int_list '}' {/* ugh */
1131 Array<int> &a = *$3;
1133 $$ = new Musical_pitch;
1134 $$->octave_i_ = a[0];
1135 $$->notename_i_ = a[1];
1136 $$->accidental_i_ = a[2];
1142 steno_musical_pitch {
1144 THIS->set_last_pitch ($1);
1146 | explicit_musical_pitch {
1148 THIS->set_last_pitch ($1);
1153 DURATION '{' int_list '}' {
1155 Array<int> &a = *$3;
1158 $$-> durlog_i_ = a[0];
1159 $$-> dots_i_ = a[1];
1167 if (!THIS->lexer_p_->lyric_state_b ())
1168 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1169 $$ = new Extender_req;
1175 if (!THIS->lexer_p_->lyric_state_b ())
1176 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1177 $$ = new Hyphen_req;
1182 close_request_parens {
1184 dynamic_cast<Span_req*> ($$)->span_dir_ = START;
1187 close_request_parens:
1189 Span_req* s= new Span_req;
1191 s->span_type_str_ = "slur";
1194 Span_req*s =new Span_req;
1196 s->span_type_str_ = "crescendo";
1199 Span_req*s =new Span_req;
1201 s->span_type_str_ = "decrescendo";
1207 open_request_parens {
1209 dynamic_cast<Span_req*> ($$)->span_dir_ = STOP;
1213 open_request_parens:
1215 Span_req *s = new Span_req;
1216 s->span_type_str_ = "crescendo";
1220 Span_req* s= new Span_req;
1222 s->span_type_str_ = "slur";
1228 Text_script_req *t = new Text_script_req;
1232 $$->set_spot (THIS->here_input ());
1235 Text_script_req* t = new Text_script_req;
1237 t->text_str_ = to_str ($1);
1238 t->style_str_ = "finger";
1239 $$->set_spot (THIS->here_input ());
1243 script_abbreviation:
1245 $$ = new String ("hat");
1248 $$ = new String ("plus");
1251 $$ = new String ("dash");
1254 $$ = new String ("bar");
1257 $$ = new String ("larger");
1260 $$ = new String ("dot");
1268 | '-' { $$ = CENTER; }
1273 $$ = new Link_array<Request>;
1275 | pre_requests open_request {
1280 absolute_musical_pitch:
1281 steno_musical_pitch {
1290 | duration_length '*' unsigned {
1291 $$->plet_.iso_i_ *= $3;
1293 | duration_length '/' unsigned {
1294 $$->plet_.type_i_ *= $3;
1298 entered_notemode_duration:
1300 THIS->set_last_duration ($1);
1304 optional_notemode_duration:
1306 $$ = new Duration (THIS->default_duration_);
1308 | entered_notemode_duration {
1316 if (!Duration::duration_type_b ($1))
1317 THIS->parser_error (_f ("not a duration: %d", $1));
1319 $$->durlog_i_ = Duration_convert::i2_type ($1);
1322 | DURATION_IDENTIFIER {
1323 $$ = $1->access_content_Duration (true);
1325 | steno_duration '.' {
1336 if (!Duration::duration_type_b ($2))
1337 THIS->parser_error (_f ("not a duration: %d", $2));
1339 THIS->parser_error (_ ("can't abbreviate"));
1346 musical_pitch exclamations questions optional_notemode_duration {
1347 if (!THIS->lexer_p_->note_state_b ())
1348 THIS->parser_error (_ ("have to be in Note mode for notes"));
1351 Note_req *n = new Note_req;
1357 n->cautionary_b_ = $3 % 2;
1358 n->forceacc_b_ = $2 % 2 || n->cautionary_b_;
1360 Simultaneous_music*v = new Request_chord;
1361 v->set_spot (THIS->here_input ());
1362 n->set_spot (THIS->here_input ());
1368 | RESTNAME optional_notemode_duration {
1369 $$ = THIS->get_rest_element (*$1, $2);
1370 delete $1; // delete notename
1372 | MEASURES optional_notemode_duration {
1373 Multi_measure_rest_req* m = new Multi_measure_rest_req;
1377 Simultaneous_music*velt_p = new Request_chord;
1378 velt_p->set_spot (THIS->here_input ());
1379 velt_p->add_music (m);
1382 | REPETITIONS optional_notemode_duration {
1383 Repetitions_req* r = new Repetitions_req;
1387 Simultaneous_music*velt_p = new Request_chord;
1388 velt_p->set_spot (THIS->here_input ());
1389 velt_p->add_music (r);
1392 | STRING optional_notemode_duration {
1393 if (!THIS->lexer_p_->lyric_state_b ())
1394 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1395 $$ = THIS->get_word_element (*$1, $2);
1399 if (!THIS->lexer_p_->chord_state_b ())
1400 THIS->parser_error (_ ("have to be in Chord mode for chords"));
1406 steno_tonic_pitch optional_notemode_duration chord_additions chord_subtractions chord_inversion {
1407 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1412 $$ = new Array<Musical_pitch>;
1417 | '-' CHORDMODIFIER_PITCH {
1418 $$ = new Array<Musical_pitch>;
1421 | '-' CHORDMODIFIER_PITCH chord_notes {
1429 $$ = new Array<Musical_pitch>;
1432 | chord_notes '.' chord_note {
1440 $$ = new Array<Musical_pitch>;
1449 forevery : X : optional_X sucks. Devise a solution.
1456 | '/' steno_tonic_pitch {
1463 $$ = new Musical_pitch;
1464 $$->notename_i_ = ($1 - 1) % 7;
1465 $$->octave_i_ = $1 > 7 ? 1 : 0;
1466 $$->accidental_i_ = 0;
1469 $$ = new Musical_pitch;
1470 $$->notename_i_ = ($1 - 1) % 7;
1471 $$->octave_i_ = $1 > 7 ? 1 : 0;
1472 $$->accidental_i_ = 1;
1475 $$ = new Musical_pitch;
1476 $$->notename_i_ = ($1 - 1) % 7;
1477 $$->octave_i_ = $1 > 7 ? 1 : 0;
1478 $$->accidental_i_ = -1;
1486 $$ = new Array<Musical_pitch>;
1488 | pitch_list musical_pitch {
1521 $$ = *$1->access_content_int (false);
1530 | STRING_IDENTIFIER {
1531 $$ = $1->access_content_String (true);
1533 | string '+' string {
1542 | exclamations '!' { $$ ++; }
1547 | questions '?' { $$ ++; }
1557 My_lily_parser::set_yydebug (bool b)
1564 My_lily_parser::do_yyparse ()
1566 yyparse ((void*)this);