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 chord_step
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 $$->compress (Moment($3, $5 ));
753 | Simple_music '*' unsigned {
755 $$->compress (Moment ($3, 1));
761 CONTEXT STRING Music {
762 Context_specced_music *csm = new Context_specced_music ($3);
764 csm->translator_type_str_ = *$2;
765 csm->translator_id_str_ = "";
771 $$ = new Grace_music ($2);
773 | CONTEXT STRING '=' STRING Music {
774 Context_specced_music *csm = new Context_specced_music ($5);
776 csm->translator_type_str_ = *$2;
777 csm->translator_id_str_ = *$4;
784 THIS->remember_spot ();
787 unsigned '/' unsigned Music
790 $$ = new Time_scaled_music ($3, $5, $6);
791 $$->set_spot (THIS->pop_spot ());
793 | Repeated_music { $$ = $1; }
794 | Simultaneous_music { $$ = $1; }
795 | Sequential_music { $$ = $1; }
796 | TRANSPOSE musical_pitch Music {
797 $$ = new Transposed_music ($3, *$2);
800 | TRANSPOSE steno_tonic_pitch Music {
801 $$ = new Transposed_music ($3, *$2);
805 { THIS->lexer_p_->push_note_state (); }
808 THIS->lexer_p_->pop_state ();
811 { THIS->lexer_p_->push_chord_state (); }
815 THIS->lexer_p_->pop_state ();
818 { THIS->lexer_p_->push_lyric_state (); }
822 THIS->lexer_p_->pop_state ();
824 | relative_music { $$ = $1; }
825 | re_rhythmed_music { $$ = $1; }
829 RELATIVE absolute_musical_pitch Music {
830 $$ = new Relative_octave_music ($3, *$2);
836 ADDLYRICS Music Music {
837 Lyric_combine_music * l = new Lyric_combine_music ($2, $3);
843 TRANSLATOR STRING '=' STRING {
844 Change_translator * t = new Change_translator;
845 t-> change_to_type_str_ = *$2;
846 t-> change_to_id_str_ = *$4;
849 $$->set_spot (THIS->here_input ());
856 PROPERTY STRING '.' STRING '=' scalar {
857 Translation_property *t = new Translation_property;
862 Context_specced_music *csm = new Context_specced_music (t);
864 $$->set_spot (THIS->here_input ());
866 csm-> translator_type_str_ = *$2;
875 string { $$ = new Scalar (*$1); delete $1; }
876 | int { $$ = new Scalar ($1); }
881 pre_requests simple_element post_requests {
882 Music_sequence *l = dynamic_cast<Music_sequence*>($2);
883 for (int i=0; i < $1->size(); i++)
884 l->add_music ($1->elem(i));
885 for (int i=0; i < $3->size(); i++)
886 l->add_music ($3->elem(i));
895 $$ = new Request_chord;
896 $$-> set_spot (THIS->here_input ());
897 $1-> set_spot (THIS->here_input ());
898 ((Simultaneous_music*)$$) ->add_music ($1);//ugh
904 | verbose_command_req semicolon { $$ = $1; }
915 $$ = new Barcheck_req;
921 Span_req*b= new Span_req;
922 b->span_dir_ = START;
923 b->span_type_str_ = "beam";
927 Span_req*b= new Span_req;
929 b->span_type_str_ = "beam";
933 $$ = new Breathing_sign_req;
940 $$ = new Bar_req (*$2);
944 $$ = new Mark_req (*$2);
948 $$ = new Mark_req (to_str ($2));
950 | TIME_T unsigned '/' unsigned {
951 Time_signature_change_req *m = new Time_signature_change_req;
957 Break_req * b = new Break_req;
959 b-> set_spot (THIS->here_input ());
962 | SKIP duration_length {
963 Skip_req * skip_p = new Skip_req;
964 skip_p->duration_ = *$2;
972 $$ = new Cadenza_req ($2);
974 | PARTIAL duration_length {
975 $$ = new Partial_measure_req ($2->length_mom ());
979 $$ = new Clef_change_req (*$2);
982 | KEY NOTENAME_PITCH optional_modality {
983 Key_change_req *key_p= new Key_change_req;
984 key_p->key_.pitch_arr_.push (*$2);
985 key_p->key_.ordinary_key_b_ = true;
986 key_p->key_.modality_i_ = $3;
990 | KEYSIGNATURE pitch_list {
991 Key_change_req *key_p= new Key_change_req;
992 key_p->key_.pitch_arr_ = *$2;
993 key_p->key_.ordinary_key_b_ = false;
1002 $$ = new Link_array<Request>;
1004 | post_requests post_request {
1005 $2->set_spot (THIS->here_input ());
1017 request_that_take_dir:
1020 | script_abbreviation {
1021 Identifier*i = THIS->lexer_p_->lookup_identifier ("dash-" + *$1);
1022 Articulation_req *a = new Articulation_req;
1023 a->articulation_str_ = *i->access_content_String (false);
1030 script_dir request_that_take_dir {
1031 if (Script_req * gs = dynamic_cast<Script_req*> ($2))
1032 gs->dir_ = Direction ($1);
1034 $2->warning ("Can't specify direction for this request");
1040 REQUEST_IDENTIFIER {
1041 $$ = (Request*)$1->access_content_Request (true);
1042 $$->set_spot (THIS->here_input ());
1044 | TEXTSCRIPT STRING STRING {
1045 Text_script_req *ts_p = new Text_script_req;
1046 ts_p-> text_str_ = *$2;
1047 ts_p-> style_str_ = *$3;
1048 ts_p->set_spot (THIS->here_input ());
1053 | SPANREQUEST int STRING {
1054 Span_req * sp_p = new Span_req;
1055 sp_p-> span_dir_ = Direction($2);
1056 sp_p->span_type_str_ = *$3;
1057 sp_p->set_spot (THIS->here_input ());
1061 Tremolo_req* a = new Tremolo_req;
1062 a->set_spot (THIS->here_input ());
1067 Articulation_req * a = new Articulation_req;
1068 a->articulation_str_ = *$2;
1069 a->set_spot (THIS->here_input ());
1102 steno_musical_pitch:
1106 | NOTENAME_PITCH sup_quotes {
1108 $$->octave_i_ += $2;
1110 | NOTENAME_PITCH sub_quotes {
1112 $$->octave_i_ += - $2;
1120 | TONICNAME_PITCH sup_quotes {
1122 $$->octave_i_ += $2;
1124 | TONICNAME_PITCH sub_quotes {
1126 $$->octave_i_ += - $2;
1130 explicit_musical_pitch:
1131 MUSICAL_PITCH '{' int_list '}' {/* ugh */
1132 Array<int> &a = *$3;
1134 $$ = new Musical_pitch;
1135 $$->octave_i_ = a[0];
1136 $$->notename_i_ = a[1];
1137 $$->accidental_i_ = a[2];
1143 steno_musical_pitch {
1145 THIS->set_last_pitch ($1);
1147 | explicit_musical_pitch {
1149 THIS->set_last_pitch ($1);
1154 DURATION '{' int_list '}' {
1156 Array<int> &a = *$3;
1159 $$-> durlog_i_ = a[0];
1160 $$-> dots_i_ = a[1];
1168 if (!THIS->lexer_p_->lyric_state_b ())
1169 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1170 $$ = new Extender_req;
1176 if (!THIS->lexer_p_->lyric_state_b ())
1177 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1178 $$ = new Hyphen_req;
1183 close_request_parens {
1185 dynamic_cast<Span_req*> ($$)->span_dir_ = START;
1188 close_request_parens:
1190 Span_req* s= new Span_req;
1192 s->span_type_str_ = "slur";
1195 Span_req*s =new Span_req;
1197 s->span_type_str_ = "crescendo";
1200 Span_req*s =new Span_req;
1202 s->span_type_str_ = "decrescendo";
1208 open_request_parens {
1210 dynamic_cast<Span_req*> ($$)->span_dir_ = STOP;
1214 open_request_parens:
1216 Span_req *s = new Span_req;
1217 s->span_type_str_ = "crescendo";
1221 Span_req* s= new Span_req;
1223 s->span_type_str_ = "slur";
1229 Text_script_req *t = new Text_script_req;
1233 $$->set_spot (THIS->here_input ());
1236 Text_script_req* t = new Text_script_req;
1238 t->text_str_ = to_str ($1);
1239 t->style_str_ = "finger";
1240 $$->set_spot (THIS->here_input ());
1244 script_abbreviation:
1246 $$ = new String ("hat");
1249 $$ = new String ("plus");
1252 $$ = new String ("dash");
1255 $$ = new String ("bar");
1258 $$ = new String ("larger");
1261 $$ = new String ("dot");
1269 | '-' { $$ = CENTER; }
1274 $$ = new Link_array<Request>;
1276 | pre_requests open_request {
1281 absolute_musical_pitch:
1282 steno_musical_pitch {
1291 | duration_length '*' unsigned {
1292 $$->plet_.iso_i_ *= $3;
1294 | duration_length '/' unsigned {
1295 $$->plet_.type_i_ *= $3;
1299 entered_notemode_duration:
1301 THIS->set_last_duration ($1);
1305 optional_notemode_duration:
1307 $$ = new Duration (THIS->default_duration_);
1309 | entered_notemode_duration {
1317 if (!Duration::duration_type_b ($1))
1318 THIS->parser_error (_f ("not a duration: %d", $1));
1320 $$->durlog_i_ = Duration_convert::i2_type ($1);
1323 | DURATION_IDENTIFIER {
1324 $$ = $1->access_content_Duration (true);
1326 | steno_duration '.' {
1337 if (!Duration::duration_type_b ($2))
1338 THIS->parser_error (_f ("not a duration: %d", $2));
1340 THIS->parser_error (_ ("can't abbreviate"));
1347 musical_pitch exclamations questions optional_notemode_duration {
1348 if (!THIS->lexer_p_->note_state_b ())
1349 THIS->parser_error (_ ("have to be in Note mode for notes"));
1352 Note_req *n = new Note_req;
1358 n->cautionary_b_ = $3 % 2;
1359 n->forceacc_b_ = $2 % 2 || n->cautionary_b_;
1361 Simultaneous_music*v = new Request_chord;
1362 v->set_spot (THIS->here_input ());
1363 n->set_spot (THIS->here_input ());
1369 | RESTNAME optional_notemode_duration {
1370 $$ = THIS->get_rest_element (*$1, $2);
1371 delete $1; // delete notename
1373 | MEASURES optional_notemode_duration {
1374 Multi_measure_rest_req* m = new Multi_measure_rest_req;
1378 Simultaneous_music*velt_p = new Request_chord;
1379 velt_p->set_spot (THIS->here_input ());
1380 velt_p->add_music (m);
1383 | REPETITIONS optional_notemode_duration {
1384 Repetitions_req* r = new Repetitions_req;
1388 Simultaneous_music*velt_p = new Request_chord;
1389 velt_p->set_spot (THIS->here_input ());
1390 velt_p->add_music (r);
1393 | STRING optional_notemode_duration {
1394 if (!THIS->lexer_p_->lyric_state_b ())
1395 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1396 $$ = THIS->get_word_element (*$1, $2);
1400 if (!THIS->lexer_p_->chord_state_b ())
1401 THIS->parser_error (_ ("have to be in Chord mode for chords"));
1407 steno_tonic_pitch optional_notemode_duration chord_additions chord_subtractions chord_inversion {
1408 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1413 $$ = new Array<Musical_pitch>;
1424 | chord_notes '.' chord_step {
1432 $$ = new Array<Musical_pitch>;
1441 forevery : X : optional_X sucks. Devise a solution.
1448 | '/' steno_tonic_pitch {
1455 $$ = new Array<Musical_pitch>;
1458 | CHORDMODIFIER_PITCH {
1459 $$ = new Array<Musical_pitch>;
1462 | CHORDMODIFIER_PITCH chord_note {
1463 $$ = new Array<Musical_pitch>;
1471 $$ = new Musical_pitch;
1472 $$->notename_i_ = ($1 - 1) % 7;
1473 $$->octave_i_ = $1 > 7 ? 1 : 0;
1474 $$->accidental_i_ = 0;
1477 $$ = new Musical_pitch;
1478 $$->notename_i_ = ($1 - 1) % 7;
1479 $$->octave_i_ = $1 > 7 ? 1 : 0;
1480 $$->accidental_i_ = 1;
1483 $$ = new Musical_pitch;
1484 $$->notename_i_ = ($1 - 1) % 7;
1485 $$->octave_i_ = $1 > 7 ? 1 : 0;
1486 $$->accidental_i_ = -1;
1494 $$ = new Array<Musical_pitch>;
1496 | pitch_list musical_pitch {
1529 $$ = *$1->access_content_int (false);
1538 | STRING_IDENTIFIER {
1539 $$ = $1->access_content_String (true);
1541 | string '+' string {
1550 | exclamations '!' { $$ ++; }
1555 | questions '?' { $$ ++; }
1565 My_lily_parser::set_yydebug (bool b)
1572 My_lily_parser::do_yyparse ()
1574 yyparse ((void*)this);