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 "parseconstruct.hh"
27 #include "dimensions.hh"
28 #include "identifier.hh"
29 #include "command-request.hh"
30 #include "musical-request.hh"
31 #include "my-lily-parser.hh"
32 #include "context-specced-music.hh"
33 #include "translator-group.hh"
35 #include "music-list.hh"
36 #include "duration-convert.hh"
37 #include "change-translator.hh"
38 #include "file-results.hh"
39 #include "mudela-version.hh"
41 #include "relative-music.hh"
42 #include "transposed-music.hh"
43 #include "time-scaled-music.hh"
44 #include "new-repeated-music.hh"
47 Mudela_version oldest_version ("1.0.16");
48 Mudela_version version ("1.0.19");
51 print_mudela_versions (ostream &os)
53 os << "Mudela versions: oldest " << oldest_version.str () << " current " << version.str () <<endl;
55 // needed for bison.simple's malloc() and free()
69 Assignment (Assignment const&s)
71 name_p_ = new String (*s.name_p_);
72 id_p_ = s.id_p_->clone ();
76 Paper_def* current_paper = 0;
82 #define YYERROR_VERBOSE 1
84 #define YYPARSE_PARAM my_lily_parser_l
85 #define YYLEX_PARAM my_lily_parser_l
86 #define THIS ((My_lily_parser *) my_lily_parser_l)
88 #define yyerror THIS->parser_error
89 #define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f("expecting %d arguments", s))
95 Array<Interval>* intarr;
96 Array<Musical_pitch> *pitch_arr;
97 Link_array<Request> *reqvec;
98 Array<String> * strvec;
100 Notename_table *chordmodifiertab;
104 Music_list *music_list;
109 Music_output_def * outputdef;
110 Musical_pitch * pitch;
113 Notename_table *notenametab;
129 yylex (YYSTYPE *s, void * v_l)
131 My_lily_parser *pars_l = (My_lily_parser*) v_l;
132 My_lily_lexer * lex_l = pars_l->lexer_p_;
134 lex_l->lexval_l = (void*) s;
135 return lex_l->yylex ();
143 /* tokens which are not keywords */
150 %token CHORDMODIFIERS
198 %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
200 %type <i> dots exclamations questions
202 %token <pitch> NOTENAME_PITCH
203 %token <pitch> TONICNAME_PITCH
204 %token <pitch> CHORDMODIFIER_PITCH
205 %token <id> DURATION_IDENTIFIER
206 %token <id> IDENTIFIER
207 %token <id> NOTENAME_TABLE_IDENTIFIER
208 %token <id> MUSIC_IDENTIFIER
209 %token <id> REQUEST_IDENTIFIER
210 %token <id> REAL_IDENTIFIER
211 %token <id> STRING_IDENTIFIER
212 %token <id> TRANS_IDENTIFIER
213 %token <id> INT_IDENTIFIER
214 %token <id> SCORE_IDENTIFIER
215 %token <id> MIDI_IDENTIFIER
216 %token <id> PAPER_IDENTIFIER
218 %token <string> DURATION RESTNAME
219 %token <string> STRING
223 %type <outputdef> output_def
224 %type <scope> mudela_header mudela_header_body
225 %type <request> open_request_parens close_request_parens open_request close_request
226 %type <request> request_with_dir request_that_take_dir verbose_request
227 %type <i> sub_quotes sup_quotes
228 %type <music> simple_element request_chord command_element Simple_music Composite_music
229 %type <music> Alternative_music Repeated_music
230 %type <i> abbrev_type
231 %type <i> int unsigned
233 %type <i> optional_modality
234 %type <id> identifier_init
235 %type <duration> steno_duration notemode_duration
236 %type <duration> entered_notemode_duration explicit_duration
237 %type <intvec> intastint_list int_list
238 %type <reqvec> pre_requests post_requests
239 %type <request> gen_text_def
240 %type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
241 %type <pitch> steno_tonic_pitch
243 %type <pitch_arr> pitch_list
244 %type <music> chord notemode_chord
245 %type <pitch_arr> chord_additions chord_subtractions chord_notes
246 %type <pitch> chord_addsub chord_note chord_inversion notemode_chord_inversion
247 %type <midi> midi_block midi_body
248 %type <duration> duration_length
250 %type <scalar> scalar
251 %type <music> Music relative_music Sequential_music Simultaneous_music Music_sequence
252 %type <music> property_def translator_change
253 %type <music_list> Music_list
254 %type <paper> paper_block paper_def_body
255 %type <real> real_expression real real_with_dimension
256 %type <request> abbrev_command_req
257 %type <request> post_request
258 %type <request> command_req verbose_command_req
259 %type <request> extender_req
260 %type <string> string
261 %type <score> score_block score_body
262 %type <intarr> shape_array
264 %type <string> script_abbreviation
265 %type <trans> translator_spec_block translator_spec_body
266 %type <tempo> tempo_request
267 %type <notenametab> notenames_body notenames_block chordmodifiers_block
279 | mudela toplevel_expression {}
280 | mudela assignment { }
282 | mudela check_version { }
287 THIS->lexer_p_->set_notename_table ($1);
289 | chordmodifiers_block {
290 THIS->lexer_p_->set_chordmodifier_table ($1);
293 delete header_global_p;
294 header_global_p = $1;
297 score_global_array.push ($1);
300 Identifier * id = new
301 Paper_def_identifier ($1, PAPER_IDENTIFIER);
302 THIS->lexer_p_->set_identifier ("$defaultpaper", id)
305 Identifier * id = new
306 Midi_def_identifier ($1, MIDI_IDENTIFIER);
307 THIS->lexer_p_->set_identifier ("$defaultmidi", id)
314 SCMFILE STRING semicolon {
315 read_lily_scm_file (*$2);
318 | SCM_T STRING semicolon {
319 gh_eval_str ($2->ch_l ());
324 VERSION STRING semicolon {
325 Mudela_version ver (*$2);
326 if (!((ver >= oldest_version) && (ver <= version))) {
327 if (THIS->ignore_version_b_) {
328 THIS->here_input ().error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
330 THIS->fatal_error_i_ = 1;
331 THIS->parser_error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
338 chordmodifiers_block:
339 CHORDMODIFIERS '{' notenames_body '}' { $$ = $3; }
344 NOTENAMES '{' notenames_body '}' { $$ = $3; }
351 $$ = new Notename_table;
353 | NOTENAME_TABLE_IDENTIFIER {
354 $$ = $1-> access_content_Notename_table(true);
356 | notenames_body STRING '=' explicit_musical_pitch {
367 THIS->lexer_p_-> scope_l_arr_.push ($$);
369 | mudela_header_body assignment semicolon {
375 HEADER '{' mudela_header_body '}' {
377 THIS->lexer_p_-> scope_l_arr_.pop ();
387 THIS->remember_spot ();
389 /* cont */ '=' identifier_init {
390 THIS->lexer_p_->set_identifier (*$1, $4);
391 $4->init_b_ = THIS->init_parse_b_;
392 $4->set_spot (THIS->pop_spot ());
400 $$ = new Score_identifier ($1, SCORE_IDENTIFIER);
403 | chordmodifiers_block {
404 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
407 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
410 $$ = new Paper_def_identifier ($1, PAPER_IDENTIFIER);
413 $$ = new Midi_def_identifier ($1, MIDI_IDENTIFIER);
416 | translator_spec_block {
417 $$ = new Translator_identifier ($1, TRANS_IDENTIFIER);
420 $$ = new Music_identifier ($1, MUSIC_IDENTIFIER);
424 $$ = new Request_identifier ($1, REQUEST_IDENTIFIER);
426 | explicit_duration {
427 $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
430 $$ = new Real_identifier (new Real ($1), REAL_IDENTIFIER);
433 $$ = new String_identifier ($1, STRING_IDENTIFIER);
436 $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
440 translator_spec_block:
441 TRANSLATOR '{' translator_spec_body '}'
447 translator_spec_body:
449 $$ = $1->access_content_Translator (true);
450 $$-> set_spot (THIS->here_input ());
452 | TYPE STRING semicolon {
453 Translator* t = get_translator_l (*$2);
454 Translator_group * tg = dynamic_cast<Translator_group*> (t);
457 THIS->parser_error (_("Need a translator group for a context"));
460 t->set_spot (THIS->here_input ());
464 | translator_spec_body STRING '=' identifier_init semicolon {
466 String_identifier *s = dynamic_cast<String_identifier*> (id);
467 Real_identifier *r= dynamic_cast<Real_identifier*>(id);
468 int_identifier *i = dynamic_cast<int_identifier*> (id);
471 if (s) str = *s->access_content_String (false);
472 if (i) str = to_str (*i->access_content_int (false));
473 if (r) str = to_str (*r->access_content_Real (false));
475 THIS->parser_error (_("Wrong type for property value"));
479 Translator_group * tr = dynamic_cast<Translator_group*>($$);
480 tr->set_property (*$2, str);
482 | translator_spec_body NAME STRING semicolon {
486 | translator_spec_body CONSISTS STRING semicolon {
487 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
490 | translator_spec_body CONSISTSEND STRING semicolon {
491 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
494 | translator_spec_body ACCEPTS STRING semicolon {
495 dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
498 | translator_spec_body REMOVE STRING semicolon {
499 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
508 SCORE { THIS->remember_spot ();
510 /*cont*/ '{' score_body '}' {
512 $$->set_spot (THIS->pop_spot ());
513 if (!$$->def_p_arr_.size ())
514 $$->add_output (THIS->default_paper_p ());
523 $$ = $1->access_content_Score (true);
525 | score_body mudela_header {
530 $2->warning (_ ("More than one music block"));
533 | score_body output_def {
551 /* */ { $$ =new Array<int>; }
552 | intastint_list int '*' int {
553 $$->push ($2); $$->push ($4);
555 | intastint_list int {
556 $$->push ($2); $$->push (1);
565 PAPER '{' paper_def_body '}' {
567 THIS-> lexer_p_->scope_l_arr_.pop ();
579 Paper_def *p = THIS->default_paper_p ();
580 THIS-> lexer_p_-> scope_l_arr_.push (p->scope_p_);
584 Paper_def *p = $1->access_content_Paper_def (true);
585 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
588 | paper_def_body int '=' FONT STRING { // ugh, what a syntax
589 Lookup * l = new Lookup;
592 $$->set_lookup ($2, l);
594 | paper_def_body assignment semicolon {
597 | paper_def_body translator_spec_block {
598 $$->assign_translator ($2);
600 | paper_def_body SHAPE '=' shape_array semicolon {
601 $$->shape_int_a_ = *$4;
604 | paper_def_body error {
611 real_expression { $$ = $1; }
634 | real_with_dimension
636 $$= *$1->access_content_Real (false);
638 | '-' real_expression %prec UNARY_MINUS {
641 | real_expression '*' real_expression {
644 | real_expression '/' real_expression {
647 | real_expression '+' real_expression {
650 | real_expression '-' real_expression {
653 | '(' real_expression ')' {
661 $$ = new Array<Interval>;
663 | shape_array real real {
664 $$->push(Interval($2, $2 + $3));
673 '{' midi_body '}' { $$ = $3; }
676 midi_body: /* empty */ {
677 $$ = THIS->default_midi_p ();
680 $$ = $1-> access_content_Midi_def (true);
682 | midi_body translator_spec_block {
683 $$-> assign_translator ($2);
685 | midi_body tempo_request semicolon {
686 $$->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
695 TEMPO steno_duration '=' unsigned {
699 $$-> metronome_i_ = $4;
703 Music_list: /* empty */ {
723 | ALTERNATIVE Music_sequence {
732 REPEAT STRING unsigned Music Alternative_music
734 Music_sequence* m = dynamic_cast <Music_sequence*> ($5);
736 New_repeated_music * r = new New_repeated_music ($4, $3 >? 1, m);
738 r->fold_b_ = (*$2 == "fold");
739 r->semi_fold_b_ = (*$2 == "semi");
744 Music_sequence: '{' Music_list '}' {
745 $$ = new Music_sequence ($2);
749 Sequential_music: '{' Music_list '}' {
750 $$ = new Sequential_music ($2);
754 Simultaneous_music: '<' Music_list '>' {
755 $$ = new Simultaneous_music ($2);
760 request_chord { $$ = $1; }
761 | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
764 | Simple_music '*' unsigned '/' unsigned {
766 $$ = new Time_scaled_music ($3, $5, $1);
768 | Simple_music '*' unsigned {
769 $$ = new Time_scaled_music ($3, 1, $1);
775 CONTEXT STRING Music {
776 Context_specced_music *csm = new Context_specced_music ($3);
778 csm->translator_type_str_ = *$2;
779 csm->translator_id_str_ = "";
784 | CONTEXT STRING '=' STRING Music {
785 Context_specced_music *csm = new Context_specced_music ($5);
787 csm->translator_type_str_ = *$2;
788 csm->translator_id_str_ = *$4;
795 THIS->remember_spot ();
798 unsigned '/' unsigned Music
801 $$ = new Time_scaled_music ($3, $5, $6);
802 $$->set_spot (THIS->pop_spot ());
804 | Repeated_music { $$ = $1; }
805 | Simultaneous_music { $$ = $1; }
806 | Sequential_music { $$ = $1; }
807 | TRANSPOSE musical_pitch Music {
808 $$ = new Transposed_music ($3, *$2);
811 | TRANSPOSE steno_tonic_pitch Music {
812 $$ = new Transposed_music ($3, *$2);
816 { THIS->lexer_p_->push_note_state (); }
819 THIS->lexer_p_->pop_state ();
822 { THIS->lexer_p_->push_chord_state (); }
826 THIS->lexer_p_->pop_state ();
829 { THIS->lexer_p_->push_lyric_state (); }
833 THIS->lexer_p_->pop_state ();
835 | relative_music { $$ = $1; }
839 RELATIVE absolute_musical_pitch Music {
840 $$ = new Relative_octave_music ($3, *$2);
846 TRANSLATOR STRING '=' STRING {
847 Change_translator * t = new Change_translator;
848 t-> change_to_type_str_ = *$2;
849 t-> change_to_id_str_ = *$4;
852 $$->set_spot (THIS->here_input ());
859 PROPERTY STRING '.' STRING '=' scalar {
860 Translation_property *t = new Translation_property;
865 Context_specced_music *csm = new Context_specced_music (t);
867 $$->set_spot (THIS->here_input ());
869 csm-> translator_type_str_ = *$2;
878 string { $$ = new Scalar (*$1); delete $1; }
879 | int { $$ = new Scalar ($1); }
884 pre_requests simple_element post_requests {
885 Music_sequence *l = dynamic_cast<Music_sequence*>($2);
886 for (int i=0; i < $1->size(); i++)
887 l->add_music ($1->elem(i));
888 for (int i=0; i < $3->size(); i++)
889 l->add_music ($3->elem(i));
898 $$ = new Request_chord;
899 $$-> set_spot (THIS->here_input ());
900 $1-> set_spot (THIS->here_input ());
901 ((Simultaneous_music*)$$) ->add_music ($1);//ugh
907 | 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";
937 $$ = new Bar_req (*$2);
941 $$ = new Mark_req (*$2);
945 $$ = new Mark_req (to_str ($2));
947 | TIME_T unsigned '/' unsigned {
948 Time_signature_change_req *m = new Time_signature_change_req;
954 Break_req * b = new Break_req;
956 b-> set_spot (THIS->here_input ());
959 | SKIP duration_length {
960 Skip_req * skip_p = new Skip_req;
961 skip_p->duration_ = *$2;
969 $$ = new Cadenza_req ($2);
971 | PARTIAL duration_length {
972 $$ = new Partial_measure_req ($2->length_mom ());
976 $$ = new Clef_change_req (*$2);
979 | KEY NOTENAME_PITCH optional_modality {
980 Key_change_req *key_p= new Key_change_req;
981 key_p->pitch_arr_.push(*$2);
982 key_p->ordinary_key_b_ = true;
983 key_p->modality_i_ = $3;
987 | KEYSIGNATURE pitch_list {
988 Key_change_req *key_p= new Key_change_req;
989 key_p->pitch_arr_ = *$2;
990 key_p->ordinary_key_b_ = false;
994 | GROUPING intastint_list {
995 Measure_grouping_req * mr_p = new Measure_grouping_req;
996 for (int i=0; i < $2->size();)
998 mr_p->elt_length_arr_.push (Moment (1, $2->elem(i++)));
999 mr_p->beat_i_arr_.push ($2->elem(i++));
1010 $$ = new Link_array<Request>;
1012 | post_requests post_request {
1013 $2->set_spot (THIS->here_input ());
1025 request_that_take_dir:
1028 | script_abbreviation {
1029 Identifier*i = THIS->lexer_p_->lookup_identifier ("dash-" + *$1);
1030 Articulation_req *a = new Articulation_req;
1031 a->articulation_str_ = *i->access_content_String (false);
1038 script_dir request_that_take_dir {
1039 if (G_script_req * gs = dynamic_cast<G_script_req*> ($2))
1042 $2->warning ("Can't specify direction for this request");
1048 REQUEST_IDENTIFIER {
1049 $$ = (Request*)$1->access_content_Request (true);
1050 $$->set_spot (THIS->here_input ());
1052 | TEXTSCRIPT STRING STRING {
1053 Text_script_req *ts_p = new Text_script_req;
1054 ts_p-> text_str_ = *$2;
1055 ts_p-> style_str_ = *$3;
1056 ts_p->set_spot (THIS->here_input ());
1061 | SPANREQUEST int STRING {
1062 Span_req * sp_p = new Span_req;
1063 sp_p-> span_dir_ = Direction($2);
1064 sp_p->span_type_str_ = *$3;
1065 sp_p->set_spot (THIS->here_input ());
1069 Abbreviation_req* a = new Abbreviation_req;
1070 a->set_spot (THIS->here_input ());
1075 Articulation_req * a = new Articulation_req;
1076 a->articulation_str_ = *$2;
1077 a->set_spot (THIS->here_input ());
1110 steno_musical_pitch:
1114 | NOTENAME_PITCH sup_quotes {
1116 $$->octave_i_ += $2;
1118 | NOTENAME_PITCH sub_quotes {
1120 $$->octave_i_ += - $2;
1128 | TONICNAME_PITCH sup_quotes {
1130 $$->octave_i_ += $2;
1132 | TONICNAME_PITCH sub_quotes {
1134 $$->octave_i_ += - $2;
1138 explicit_musical_pitch:
1139 MUSICAL_PITCH '{' int_list '}' {/* ugh */
1140 Array<int> &a = *$3;
1142 $$ = new Musical_pitch;
1143 $$->octave_i_ = a[0];
1144 $$->notename_i_ = a[1];
1145 $$->accidental_i_ = a[2];
1152 | explicit_musical_pitch
1156 DURATION '{' int_list '}' {
1158 Array<int> &a = *$3;
1161 $$-> durlog_i_ = a[0];
1162 $$-> dots_i_ = a[1];
1170 if (!THIS->lexer_p_->lyric_state_b ())
1171 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1172 $$ = new Extender_req;
1177 close_request_parens {
1179 dynamic_cast<Span_req*> ($$)->span_dir_ = START;
1182 close_request_parens:
1184 Span_req* s= new Span_req;
1186 s->span_type_str_ = "slur";
1189 Span_req*s =new Span_req;
1191 s->span_type_str_ = "crescendo";
1194 Span_req*s =new Span_req;
1196 s->span_type_str_ = "decrescendo";
1202 open_request_parens {
1204 dynamic_cast<Span_req*> ($$)->span_dir_ = STOP;
1208 open_request_parens:
1210 Span_req *s = new Span_req;
1211 s->span_type_str_ = "crescendo";
1215 Span_req* s= new Span_req;
1217 s->span_type_str_ = "slur";
1223 Text_script_req *t = new Text_script_req;
1227 $$->set_spot (THIS->here_input ());
1230 Text_script_req* t = new Text_script_req;
1232 t->text_str_ = to_str ($1);
1233 t->style_str_ = "finger";
1234 $$->set_spot (THIS->here_input ());
1238 script_abbreviation:
1240 $$ = new String ("hat");
1243 $$ = new String ("plus");
1246 $$ = new String ("dash");
1249 $$ = new String ("bar");
1252 $$ = new String ("larger");
1255 $$ = new String ("dot");
1263 | '-' { $$ = CENTER; }
1268 $$ = new Link_array<Request>;
1270 | pre_requests open_request {
1275 absolute_musical_pitch:
1276 steno_musical_pitch {
1285 | duration_length '*' unsigned {
1286 $$->plet_.iso_i_ *= $3;
1288 | duration_length '/' unsigned {
1289 $$->plet_.type_i_ *= $3;
1293 entered_notemode_duration:
1295 $$ = new Duration (THIS->default_duration_);
1300 THIS->set_last_duration ($1);
1305 entered_notemode_duration {
1313 if (!Duration::duration_type_b ($1))
1314 THIS->parser_error (_f ("not a duration: %d", $1));
1316 $$->durlog_i_ = Duration_convert::i2_type ($1);
1319 | DURATION_IDENTIFIER {
1320 $$ = $1->access_content_Duration (true);
1322 | steno_duration '.' {
1333 if (!Duration::duration_type_b ($2))
1334 THIS->parser_error (_f ("not a duration: %d", $2));
1336 THIS->parser_error (_ ("can't abbreviate"));
1343 musical_pitch exclamations questions notemode_duration {
1344 if (!THIS->lexer_p_->note_state_b ())
1345 THIS->parser_error (_ ("have to be in Note mode for notes"));
1348 Note_req *n = new Note_req;
1354 n->cautionary_b_ = $3 % 2;
1355 n->forceacc_b_ = $2 % 2 || n->cautionary_b_;
1357 Simultaneous_music*v = new Request_chord;
1358 v->set_spot (THIS->here_input ());
1359 n->set_spot (THIS->here_input ());
1365 | RESTNAME notemode_duration {
1366 $$ = THIS->get_rest_element (*$1, $2);
1367 delete $1; // delete notename
1369 | MEASURES notemode_duration {
1370 Multi_measure_rest_req* m = new Multi_measure_rest_req;
1374 Simultaneous_music*velt_p = new Request_chord;
1375 velt_p->set_spot (THIS->here_input ());
1376 velt_p->add_music (m);
1379 | STRING notemode_duration {
1380 if (!THIS->lexer_p_->lyric_state_b ())
1381 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1382 $$ = THIS->get_word_element (*$1, $2);
1386 if (!THIS->lexer_p_->chord_state_b ())
1387 THIS->parser_error (_ ("have to be in Chord mode for chords"));
1390 | '@' notemode_chord '@' {
1391 if (!THIS->lexer_p_->note_state_b ())
1392 THIS->parser_error (_ ("have to be in Note mode for @chords"));
1398 steno_tonic_pitch notemode_duration chord_additions chord_subtractions chord_inversion {
1399 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1403 steno_musical_pitch notemode_duration chord_additions chord_subtractions notemode_chord_inversion {
1404 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1410 $$ = new Array<Musical_pitch>;
1419 $$ = new Array<Musical_pitch>;
1421 | chord_notes chord_addsub {
1429 $$ = new Array<Musical_pitch>;
1438 forevery : X : optional_X sucks. Devise a solution.
1443 chord_note optional_dot
1444 | CHORDMODIFIER_PITCH optional_dot
1451 | '/' steno_tonic_pitch {
1456 notemode_chord_inversion:
1460 | '/' steno_musical_pitch {
1467 $$ = new Musical_pitch;
1468 $$->notename_i_ = ($1 - 1) % 7;
1469 $$->octave_i_ = $1 > 7 ? 1 : 0;
1470 $$->accidental_i_ = 0;
1473 $$ = new Musical_pitch;
1474 $$->notename_i_ = ($1 - 1) % 7;
1475 $$->octave_i_ = $1 > 7 ? 1 : 0;
1476 $$->accidental_i_ = 1;
1479 $$ = new Musical_pitch;
1480 $$->notename_i_ = ($1 - 1) % 7;
1481 $$->octave_i_ = $1 > 7 ? 1 : 0;
1482 $$->accidental_i_ = -1;
1490 $$ = new Array<Musical_pitch>;
1492 | pitch_list musical_pitch {
1524 $$ = *$1->access_content_int (false);
1533 | STRING_IDENTIFIER {
1534 $$ = $1->access_content_String (true);
1536 | string '+' string {
1547 | dots '.' { $$ ++; }
1554 | exclamations '!' { $$ ++; }
1559 | questions '?' { $$ ++; }
1569 My_lily_parser::set_yydebug (bool b)
1576 My_lily_parser::do_yyparse ()
1578 yyparse ((void*)this);