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>
17 * use of '-' in various places
23 #include "lily-guile.hh"
24 #include "notename-table.hh"
26 #include "translation-property.hh"
29 #include "my-lily-lexer.hh"
30 #include "paper-def.hh"
31 #include "midi-def.hh"
33 #include "file-path.hh"
36 #include "parseconstruct.hh"
37 #include "dimensions.hh"
38 #include "identifier.hh"
39 #include "command-request.hh"
40 #include "musical-request.hh"
41 #include "my-lily-parser.hh"
42 #include "context-specced-music.hh"
43 #include "translator-group.hh"
45 #include "music-list.hh"
46 #include "duration-convert.hh"
47 #include "change-translator.hh"
48 #include "file-results.hh"
49 #include "mudela-version.hh"
51 #include "relative-music.hh"
52 #include "transposed-music.hh"
53 #include "time-scaled-music.hh"
54 #include "new-repeated-music.hh"
59 Mudela_version oldest_version ("1.0.20");
60 Mudela_version version ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL );
64 print_mudela_versions (ostream &os)
66 os << "Mudela versions: oldest " << oldest_version.str () << " current " << version.str () <<endl;
68 // needed for bison.simple's malloc() and free()
75 #define YYERROR_VERBOSE 1
77 #define YYPARSE_PARAM my_lily_parser_l
78 #define YYLEX_PARAM my_lily_parser_l
79 #define THIS ((My_lily_parser *) my_lily_parser_l)
81 #define yyerror THIS->parser_error
82 #define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f("expecting %d arguments", s))
88 Array<Interval>* intarr;
89 Array<Musical_pitch> *pitch_arr;
90 Link_array<Request> *reqvec;
91 Array<String> * strvec;
93 Notename_table *chordmodifiertab;
97 Music_list *music_list;
102 Music_output_def * outputdef;
103 Musical_pitch * pitch;
106 Notename_table *notenametab;
122 yylex (YYSTYPE *s, void * v_l)
124 My_lily_parser *pars_l = (My_lily_parser*) v_l;
125 My_lily_lexer * lex_l = pars_l->lexer_p_;
127 lex_l->lexval_l = (void*) s;
128 return lex_l->yylex ();
136 /* tokens which are not keywords */
144 %token CHORDMODIFIERS
192 %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
194 %type <i> dots exclamations questions
196 %token <pitch> NOTENAME_PITCH
197 %token <pitch> TONICNAME_PITCH
198 %token <pitch> CHORDMODIFIER_PITCH
199 %token <id> DURATION_IDENTIFIER
200 %token <id> IDENTIFIER
201 %token <id> NOTENAME_TABLE_IDENTIFIER
202 %token <id> MUSIC_IDENTIFIER
203 %token <id> REQUEST_IDENTIFIER
204 %token <id> REAL_IDENTIFIER
205 %token <id> STRING_IDENTIFIER
206 %token <id> TRANS_IDENTIFIER
207 %token <id> INT_IDENTIFIER
208 %token <id> SCORE_IDENTIFIER
209 %token <id> MIDI_IDENTIFIER
210 %token <id> PAPER_IDENTIFIER
212 %token <string> DURATION RESTNAME
213 %token <string> STRING
217 %type <outputdef> output_def
218 %type <scope> mudela_header mudela_header_body
219 %type <request> open_request_parens close_request_parens open_request close_request
220 %type <request> request_with_dir request_that_take_dir verbose_request
221 %type <i> sub_quotes sup_quotes
222 %type <music> simple_element request_chord command_element Simple_music Composite_music
223 %type <music> Alternative_music Repeated_music
224 %type <i> abbrev_type
225 %type <i> int unsigned
227 %type <i> optional_modality
228 %type <id> identifier_init
229 %type <duration> steno_duration notemode_duration
230 %type <duration> entered_notemode_duration explicit_duration
231 %type <intvec> intastint_list int_list
232 %type <reqvec> pre_requests post_requests
233 %type <request> gen_text_def
234 %type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
235 %type <pitch> steno_tonic_pitch
237 %type <pitch_arr> pitch_list
238 %type <music> chord notemode_chord
239 %type <pitch_arr> chord_additions chord_subtractions chord_notes
240 %type <pitch> chord_addsub chord_note chord_inversion notemode_chord_inversion
241 %type <midi> midi_block midi_body
242 %type <duration> duration_length
244 %type <scalar> scalar
245 %type <music> Music relative_music Sequential_music Simultaneous_music Music_sequence
246 %type <music> property_def translator_change
247 %type <music_list> Music_list
248 %type <paper> paper_block paper_def_body
249 %type <real> real_expression real real_with_dimension
250 %type <request> abbrev_command_req
251 %type <request> post_request
252 %type <request> command_req verbose_command_req
253 %type <request> extender_req
254 %type <string> string
255 %type <score> score_block score_body
256 %type <intarr> shape_array
258 %type <string> script_abbreviation
259 %type <trans> translator_spec_block translator_spec_body
260 %type <tempo> tempo_request
261 %type <notenametab> notenames_body notenames_block chordmodifiers_block
273 | mudela toplevel_expression {}
274 | mudela assignment { }
276 | mudela check_version { }
281 THIS->lexer_p_->set_notename_table ($1);
283 | chordmodifiers_block {
284 THIS->lexer_p_->set_chordmodifier_table ($1);
287 delete header_global_p;
288 header_global_p = $1;
291 score_global_array.push ($1);
294 Identifier * id = new
295 Paper_def_identifier ($1, PAPER_IDENTIFIER);
296 THIS->lexer_p_->set_identifier ("$defaultpaper", id)
299 Identifier * id = new
300 Midi_def_identifier ($1, MIDI_IDENTIFIER);
301 THIS->lexer_p_->set_identifier ("$defaultmidi", id)
308 SCMFILE STRING semicolon {
309 read_lily_scm_file (*$2);
312 | SCM_T STRING semicolon {
313 gh_eval_str ($2->ch_l ());
318 VERSION STRING semicolon {
319 Mudela_version ver (*$2);
320 if (!((ver >= oldest_version) && (ver <= version))) {
321 if (THIS->ignore_version_b_) {
322 THIS->here_input ().error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
324 THIS->fatal_error_i_ = 1;
325 THIS->parser_error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
332 chordmodifiers_block:
333 CHORDMODIFIERS '{' notenames_body '}' { $$ = $3; }
338 NOTENAMES '{' notenames_body '}' { $$ = $3; }
345 $$ = new Notename_table;
347 | NOTENAME_TABLE_IDENTIFIER {
348 $$ = $1-> access_content_Notename_table(true);
350 | notenames_body STRING '=' explicit_musical_pitch {
361 THIS->lexer_p_-> scope_l_arr_.push ($$);
363 | mudela_header_body assignment semicolon {
369 HEADER '{' mudela_header_body '}' {
371 THIS->lexer_p_-> scope_l_arr_.pop ();
381 THIS->remember_spot ();
383 /* cont */ '=' identifier_init {
384 THIS->lexer_p_->set_identifier (*$1, $4);
385 $4->init_b_ = THIS->init_parse_b_;
386 $4->set_spot (THIS->pop_spot ());
394 $$ = new Score_identifier ($1, SCORE_IDENTIFIER);
397 | chordmodifiers_block {
398 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
401 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
404 $$ = new Paper_def_identifier ($1, PAPER_IDENTIFIER);
407 $$ = new Midi_def_identifier ($1, MIDI_IDENTIFIER);
410 | translator_spec_block {
411 $$ = new Translator_identifier ($1, TRANS_IDENTIFIER);
414 $$ = new Music_identifier ($1, MUSIC_IDENTIFIER);
418 $$ = new Request_identifier ($1, REQUEST_IDENTIFIER);
420 | explicit_duration {
421 $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
424 $$ = new Real_identifier (new Real ($1), REAL_IDENTIFIER);
427 $$ = new String_identifier ($1, STRING_IDENTIFIER);
430 $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
434 translator_spec_block:
435 TRANSLATOR '{' translator_spec_body '}'
441 translator_spec_body:
443 $$ = $1->access_content_Translator (true);
444 $$-> set_spot (THIS->here_input ());
446 | TYPE STRING semicolon {
447 Translator* t = get_translator_l (*$2);
448 Translator_group * tg = dynamic_cast<Translator_group*> (t);
451 THIS->parser_error (_("Need a translator group for a context"));
454 t->set_spot (THIS->here_input ());
458 | translator_spec_body STRING '=' identifier_init semicolon {
460 String_identifier *s = dynamic_cast<String_identifier*> (id);
461 Real_identifier *r= dynamic_cast<Real_identifier*>(id);
462 int_identifier *i = dynamic_cast<int_identifier*> (id);
465 if (s) str = *s->access_content_String (false);
466 if (i) str = to_str (*i->access_content_int (false));
467 if (r) str = to_str (*r->access_content_Real (false));
469 THIS->parser_error (_("Wrong type for property value"));
473 Translator_group * tr = dynamic_cast<Translator_group*>($$);
474 tr->set_property (*$2, str);
476 | translator_spec_body NAME STRING semicolon {
480 | translator_spec_body CONSISTS STRING semicolon {
481 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
484 | translator_spec_body CONSISTSEND STRING semicolon {
485 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
488 | translator_spec_body ACCEPTS STRING semicolon {
489 dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
492 | translator_spec_body REMOVE STRING semicolon {
493 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
502 SCORE { THIS->remember_spot ();
504 /*cont*/ '{' score_body '}' {
506 $$->set_spot (THIS->pop_spot ());
507 if (!$$->def_p_arr_.size ())
508 $$->add_output (THIS->default_paper_p ());
517 $$ = $1->access_content_Score (true);
519 | score_body mudela_header {
524 $2->warning (_ ("More than one music block"));
527 | score_body output_def {
545 /* */ { $$ =new Array<int>; }
546 | intastint_list int '*' int {
547 $$->push ($2); $$->push ($4);
549 | intastint_list int {
550 $$->push ($2); $$->push (1);
559 PAPER '{' paper_def_body '}' {
561 THIS-> lexer_p_->scope_l_arr_.pop ();
573 Paper_def *p = THIS->default_paper_p ();
574 THIS-> lexer_p_-> scope_l_arr_.push (p->scope_p_);
578 Paper_def *p = $1->access_content_Paper_def (true);
579 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
582 | paper_def_body int '=' FONT STRING { // ugh, what a syntax
583 Lookup * l = new Lookup;
586 $$->set_lookup ($2, l);
588 | paper_def_body assignment semicolon {
591 | paper_def_body translator_spec_block {
592 $$->assign_translator ($2);
594 | paper_def_body SHAPE '=' shape_array semicolon {
595 $$->shape_int_a_ = *$4;
598 | paper_def_body error {
605 real_expression { $$ = $1; }
628 | real_with_dimension
630 $$= *$1->access_content_Real (false);
632 | '-' real_expression %prec UNARY_MINUS {
635 | real_expression '*' real_expression {
638 | real_expression '/' real_expression {
641 | real_expression '+' real_expression {
644 | real_expression '-' real_expression {
647 | '(' real_expression ')' {
655 $$ = new Array<Interval>;
657 | shape_array real real {
658 $$->push(Interval($2, $2 + $3));
667 '{' midi_body '}' { $$ = $3; }
670 midi_body: /* empty */ {
671 $$ = THIS->default_midi_p ();
674 $$ = $1-> access_content_Midi_def (true);
676 | midi_body translator_spec_block {
677 $$-> assign_translator ($2);
679 | midi_body tempo_request semicolon {
680 $$->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
689 TEMPO steno_duration '=' unsigned {
693 $$-> metronome_i_ = $4;
697 Music_list: /* empty */ {
717 | ALTERNATIVE Music_sequence {
726 REPEAT STRING unsigned Music Alternative_music
728 Music_sequence* m = dynamic_cast <Music_sequence*> ($5);
730 New_repeated_music * r = new New_repeated_music ($4, $3 >? 1, m);
732 r->fold_b_ = (*$2 == "fold");
733 r->semi_fold_b_ = (*$2 == "semi");
738 Music_sequence: '{' Music_list '}' {
739 $$ = new Music_sequence ($2);
743 Sequential_music: '{' Music_list '}' {
744 $$ = new Sequential_music ($2);
748 Simultaneous_music: '<' Music_list '>' {
749 $$ = new Simultaneous_music ($2);
754 request_chord { $$ = $1; }
755 | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
758 | Simple_music '*' unsigned '/' unsigned {
760 $$ = new Time_scaled_music ($3, $5, $1);
762 | Simple_music '*' unsigned {
763 $$ = new Time_scaled_music ($3, 1, $1);
769 CONTEXT STRING Music {
770 Context_specced_music *csm = new Context_specced_music ($3);
772 csm->translator_type_str_ = *$2;
773 csm->translator_id_str_ = "";
778 | CONTEXT STRING '=' STRING Music {
779 Context_specced_music *csm = new Context_specced_music ($5);
781 csm->translator_type_str_ = *$2;
782 csm->translator_id_str_ = *$4;
789 THIS->remember_spot ();
792 unsigned '/' unsigned Music
795 $$ = new Time_scaled_music ($3, $5, $6);
796 $$->set_spot (THIS->pop_spot ());
798 | Repeated_music { $$ = $1; }
799 | Simultaneous_music { $$ = $1; }
800 | Sequential_music { $$ = $1; }
801 | TRANSPOSE musical_pitch Music {
802 $$ = new Transposed_music ($3, *$2);
805 | TRANSPOSE steno_tonic_pitch Music {
806 $$ = new Transposed_music ($3, *$2);
810 { THIS->lexer_p_->push_note_state (); }
813 THIS->lexer_p_->pop_state ();
816 { THIS->lexer_p_->push_chord_state (); }
820 THIS->lexer_p_->pop_state ();
823 { THIS->lexer_p_->push_lyric_state (); }
827 THIS->lexer_p_->pop_state ();
829 | relative_music { $$ = $1; }
833 RELATIVE absolute_musical_pitch Music {
834 $$ = new Relative_octave_music ($3, *$2);
840 TRANSLATOR STRING '=' STRING {
841 Change_translator * t = new Change_translator;
842 t-> change_to_type_str_ = *$2;
843 t-> change_to_id_str_ = *$4;
846 $$->set_spot (THIS->here_input ());
853 PROPERTY STRING '.' STRING '=' scalar {
854 Translation_property *t = new Translation_property;
859 Context_specced_music *csm = new Context_specced_music (t);
861 $$->set_spot (THIS->here_input ());
863 csm-> translator_type_str_ = *$2;
872 string { $$ = new Scalar (*$1); delete $1; }
873 | int { $$ = new Scalar ($1); }
878 pre_requests simple_element post_requests {
879 Music_sequence *l = dynamic_cast<Music_sequence*>($2);
880 for (int i=0; i < $1->size(); i++)
881 l->add_music ($1->elem(i));
882 for (int i=0; i < $3->size(); i++)
883 l->add_music ($3->elem(i));
892 $$ = new Request_chord;
893 $$-> set_spot (THIS->here_input ());
894 $1-> set_spot (THIS->here_input ());
895 ((Simultaneous_music*)$$) ->add_music ($1);//ugh
901 | verbose_command_req semicolon { $$ = $1; }
909 $$ = new Barcheck_req;
915 Span_req*b= new Span_req;
916 b->span_dir_ = START;
917 b->span_type_str_ = "beam";
921 Span_req*b= new Span_req;
923 b->span_type_str_ = "beam";
927 $$ = new Breathing_sign_req;
934 $$ = new Bar_req (*$2);
938 $$ = new Mark_req (*$2);
942 $$ = new Mark_req (to_str ($2));
944 | TIME_T unsigned '/' unsigned {
945 Time_signature_change_req *m = new Time_signature_change_req;
951 Break_req * b = new Break_req;
953 b-> set_spot (THIS->here_input ());
956 | SKIP duration_length {
957 Skip_req * skip_p = new Skip_req;
958 skip_p->duration_ = *$2;
966 $$ = new Cadenza_req ($2);
968 | PARTIAL duration_length {
969 $$ = new Partial_measure_req ($2->length_mom ());
973 $$ = new Clef_change_req (*$2);
976 | KEY NOTENAME_PITCH optional_modality {
977 Key_change_req *key_p= new Key_change_req;
978 key_p->pitch_arr_.push(*$2);
979 key_p->ordinary_key_b_ = true;
980 key_p->modality_i_ = $3;
984 | KEYSIGNATURE pitch_list {
985 Key_change_req *key_p= new Key_change_req;
986 key_p->pitch_arr_ = *$2;
987 key_p->ordinary_key_b_ = false;
991 | GROUPING intastint_list {
992 Measure_grouping_req * mr_p = new Measure_grouping_req;
993 for (int i=0; i < $2->size();)
995 mr_p->elt_length_arr_.push (Moment (1, $2->elem(i++)));
996 mr_p->beat_i_arr_.push ($2->elem(i++));
1007 $$ = new Link_array<Request>;
1009 | post_requests post_request {
1010 $2->set_spot (THIS->here_input ());
1022 request_that_take_dir:
1025 | script_abbreviation {
1026 Identifier*i = THIS->lexer_p_->lookup_identifier ("dash-" + *$1);
1027 Articulation_req *a = new Articulation_req;
1028 a->articulation_str_ = *i->access_content_String (false);
1035 script_dir request_that_take_dir {
1036 if (G_script_req * gs = dynamic_cast<G_script_req*> ($2))
1037 gs->dir_ = Direction ($1);
1039 $2->warning ("Can't specify direction for this request");
1045 REQUEST_IDENTIFIER {
1046 $$ = (Request*)$1->access_content_Request (true);
1047 $$->set_spot (THIS->here_input ());
1049 | TEXTSCRIPT STRING STRING {
1050 Text_script_req *ts_p = new Text_script_req;
1051 ts_p-> text_str_ = *$2;
1052 ts_p-> style_str_ = *$3;
1053 ts_p->set_spot (THIS->here_input ());
1058 | SPANREQUEST int STRING {
1059 Span_req * sp_p = new Span_req;
1060 sp_p-> span_dir_ = Direction($2);
1061 sp_p->span_type_str_ = *$3;
1062 sp_p->set_spot (THIS->here_input ());
1066 Tremolo_req* a = new Tremolo_req;
1067 a->set_spot (THIS->here_input ());
1072 Articulation_req * a = new Articulation_req;
1073 a->articulation_str_ = *$2;
1074 a->set_spot (THIS->here_input ());
1107 steno_musical_pitch:
1111 | NOTENAME_PITCH sup_quotes {
1113 $$->octave_i_ += $2;
1115 | NOTENAME_PITCH sub_quotes {
1117 $$->octave_i_ += - $2;
1125 | TONICNAME_PITCH sup_quotes {
1127 $$->octave_i_ += $2;
1129 | TONICNAME_PITCH sub_quotes {
1131 $$->octave_i_ += - $2;
1135 explicit_musical_pitch:
1136 MUSICAL_PITCH '{' int_list '}' {/* ugh */
1137 Array<int> &a = *$3;
1139 $$ = new Musical_pitch;
1140 $$->octave_i_ = a[0];
1141 $$->notename_i_ = a[1];
1142 $$->accidental_i_ = a[2];
1149 | explicit_musical_pitch
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;
1174 close_request_parens {
1176 dynamic_cast<Span_req*> ($$)->span_dir_ = START;
1179 close_request_parens:
1181 Span_req* s= new Span_req;
1183 s->span_type_str_ = "slur";
1186 Span_req*s =new Span_req;
1188 s->span_type_str_ = "crescendo";
1191 Span_req*s =new Span_req;
1193 s->span_type_str_ = "decrescendo";
1199 open_request_parens {
1201 dynamic_cast<Span_req*> ($$)->span_dir_ = STOP;
1205 open_request_parens:
1207 Span_req *s = new Span_req;
1208 s->span_type_str_ = "crescendo";
1212 Span_req* s= new Span_req;
1214 s->span_type_str_ = "slur";
1220 Text_script_req *t = new Text_script_req;
1224 $$->set_spot (THIS->here_input ());
1227 Text_script_req* t = new Text_script_req;
1229 t->text_str_ = to_str ($1);
1230 t->style_str_ = "finger";
1231 $$->set_spot (THIS->here_input ());
1235 script_abbreviation:
1237 $$ = new String ("hat");
1240 $$ = new String ("plus");
1243 $$ = new String ("dash");
1246 $$ = new String ("bar");
1249 $$ = new String ("larger");
1252 $$ = new String ("dot");
1260 | '-' { $$ = CENTER; }
1265 $$ = new Link_array<Request>;
1267 | pre_requests open_request {
1272 absolute_musical_pitch:
1273 steno_musical_pitch {
1282 | duration_length '*' unsigned {
1283 $$->plet_.iso_i_ *= $3;
1285 | duration_length '/' unsigned {
1286 $$->plet_.type_i_ *= $3;
1290 entered_notemode_duration:
1292 $$ = new Duration (THIS->default_duration_);
1297 THIS->set_last_duration ($1);
1302 entered_notemode_duration {
1310 if (!Duration::duration_type_b ($1))
1311 THIS->parser_error (_f ("not a duration: %d", $1));
1313 $$->durlog_i_ = Duration_convert::i2_type ($1);
1316 | DURATION_IDENTIFIER {
1317 $$ = $1->access_content_Duration (true);
1319 | steno_duration '.' {
1330 if (!Duration::duration_type_b ($2))
1331 THIS->parser_error (_f ("not a duration: %d", $2));
1333 THIS->parser_error (_ ("can't abbreviate"));
1340 musical_pitch exclamations questions notemode_duration {
1341 if (!THIS->lexer_p_->note_state_b ())
1342 THIS->parser_error (_ ("have to be in Note mode for notes"));
1345 Note_req *n = new Note_req;
1351 n->cautionary_b_ = $3 % 2;
1352 n->forceacc_b_ = $2 % 2 || n->cautionary_b_;
1354 Simultaneous_music*v = new Request_chord;
1355 v->set_spot (THIS->here_input ());
1356 n->set_spot (THIS->here_input ());
1362 | RESTNAME notemode_duration {
1363 $$ = THIS->get_rest_element (*$1, $2);
1364 delete $1; // delete notename
1366 | MEASURES notemode_duration {
1367 Multi_measure_rest_req* m = new Multi_measure_rest_req;
1371 Simultaneous_music*velt_p = new Request_chord;
1372 velt_p->set_spot (THIS->here_input ());
1373 velt_p->add_music (m);
1376 | STRING notemode_duration {
1377 if (!THIS->lexer_p_->lyric_state_b ())
1378 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1379 $$ = THIS->get_word_element (*$1, $2);
1383 if (!THIS->lexer_p_->chord_state_b ())
1384 THIS->parser_error (_ ("have to be in Chord mode for chords"));
1387 | '@' notemode_chord '@' {
1388 if (!THIS->lexer_p_->note_state_b ())
1389 THIS->parser_error (_ ("have to be in Note mode for @chords"));
1395 steno_tonic_pitch notemode_duration chord_additions chord_subtractions chord_inversion {
1396 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1400 steno_musical_pitch notemode_duration chord_additions chord_subtractions notemode_chord_inversion {
1401 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1407 $$ = new Array<Musical_pitch>;
1416 $$ = new Array<Musical_pitch>;
1418 | chord_notes chord_addsub {
1426 $$ = new Array<Musical_pitch>;
1435 forevery : X : optional_X sucks. Devise a solution.
1440 chord_note optional_dot
1441 | CHORDMODIFIER_PITCH optional_dot
1448 | '/' steno_tonic_pitch {
1453 notemode_chord_inversion:
1457 | '/' steno_musical_pitch {
1464 $$ = new Musical_pitch;
1465 $$->notename_i_ = ($1 - 1) % 7;
1466 $$->octave_i_ = $1 > 7 ? 1 : 0;
1467 $$->accidental_i_ = 0;
1470 $$ = new Musical_pitch;
1471 $$->notename_i_ = ($1 - 1) % 7;
1472 $$->octave_i_ = $1 > 7 ? 1 : 0;
1473 $$->accidental_i_ = 1;
1476 $$ = new Musical_pitch;
1477 $$->notename_i_ = ($1 - 1) % 7;
1478 $$->octave_i_ = $1 > 7 ? 1 : 0;
1479 $$->accidental_i_ = -1;
1487 $$ = new Array<Musical_pitch>;
1489 | pitch_list musical_pitch {
1521 $$ = *$1->access_content_int (false);
1530 | STRING_IDENTIFIER {
1531 $$ = $1->access_content_String (true);
1533 | string '+' string {
1544 | dots '.' { $$ ++; }
1551 | exclamations '!' { $$ ++; }
1556 | questions '?' { $$ ++; }
1566 My_lily_parser::set_yydebug (bool b)
1573 My_lily_parser::do_yyparse ()
1575 yyparse ((void*)this);