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"
17 #include "script-def.hh"
20 #include "my-lily-lexer.hh"
21 #include "paper-def.hh"
22 #include "midi-def.hh"
24 #include "file-path.hh"
27 #include "parseconstruct.hh"
28 #include "dimensions.hh"
29 #include "identifier.hh"
30 #include "command-request.hh"
31 #include "musical-request.hh"
32 #include "my-lily-parser.hh"
33 #include "text-def.hh"
34 #include "translator-group.hh"
36 #include "music-list.hh"
37 #include "duration-convert.hh"
38 #include "change-translator.hh"
39 #include "file-results.hh"
40 #include "mudela-version.hh"
42 #include "relative-music.hh"
43 #include "transposed-music.hh"
44 #include "compressed-music.hh"
45 #include "repeated-music.hh"
48 Mudela_version oldest_version ("1.0.14");
49 Mudela_version version ("1.0.15");
52 // needed for bison.simple's malloc() and free()
66 Assignment (Assignment const&s)
68 name_p_ = new String (*s.name_p_);
69 id_p_ = s.id_p_->clone ();
73 Paper_def* current_paper = 0;
79 #define YYERROR_VERBOSE 1
81 #define YYPARSE_PARAM my_lily_parser_l
82 #define YYLEX_PARAM my_lily_parser_l
83 #define THIS ((My_lily_parser *) my_lily_parser_l)
85 #define yyerror THIS->parser_error
86 #define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f("expecting %d arguments", s))
92 Array<Interval>* intarr;
93 Array<Musical_pitch> *pitch_arr;
94 Array<String> * strvec;
96 Notename_table *chordmodifiertab;
98 General_script_def * script;
101 Music_list *music_list;
106 Music_output_def * outputdef;
107 Musical_pitch * pitch;
111 Notename_table *notenametab;
116 Simultaneous_music *chord;
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
196 %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
200 %token <pitch> NOTENAME_PITCH
201 %token <pitch> TONICNAME_PITCH
202 %token <pitch> CHORDMODIFIER_PITCH
203 %token <id> DURATION_IDENTIFIER
204 %token <id> IDENTIFIER
205 %token <id> NOTENAME_TABLE_IDENTIFIER
206 %token <id> MUSIC_IDENTIFIER
207 %token <id> POST_REQUEST_IDENTIFIER
208 %token <id> SCRIPT_IDENTIFIER
209 %token <id> COMMAND_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 <i> open_request_parens close_request_parens
226 %type <i> sub_quotes sup_quotes
227 %type <music> simple_element request_chord command_element Simple_music Composite_music
228 %type <music> Alternative_music Repeated_music
229 %type <i> abbrev_type
230 %type <i> int unsigned
232 %type <i> optional_modality
233 %type <id> identifier_init simple_identifier_init block_identifier
234 %type <duration> steno_duration notemode_duration
235 %type <duration> entered_notemode_duration explicit_duration
236 %type <intvec> intastint_list int_list
238 %type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
239 %type <pitch> steno_tonic_pitch
240 %type <notereq> steno_notepitch
241 %type <pitch_arr> pitch_list
242 %type <music> chord notemode_chord
243 %type <pitch_arr> chord_additions chord_subtractions chord_notes
244 %type <pitch> chord_addsub chord_note chord_inversion notemode_chord_inversion
245 %type <midi> midi_block midi_body
246 %type <duration> duration_length
248 %type <scalar> scalar
249 %type <music> Music relative_music Sequential_music Simultaneous_music
250 %type <music> property_def translator_change
251 %type <music_list> Music_list
252 %type <paper> paper_block paper_def_body
253 %type <real> real_expression real dimension
254 %type <request> abbrev_command_req
255 %type <request> post_request structured_post_request
256 %type <request> command_req verbose_command_req
257 %type <request> script_req dynamic_req extender_req
258 %type <string> string
259 %type <score> score_block score_body
260 %type <intarr> shape_array
261 %type <script> script_definition script_body mudela_script gen_script_def
262 %type <textdef> text_def finger
263 %type <string> script_abbreviation
264 %type <trans> translator_spec translator_spec_body
265 %type <tempo> tempo_request
266 %type <notenametab> notenames_body notenames_block chordmodifiers_block
278 | mudela toplevel_expression {}
279 | mudela assignment { }
281 | mudela check_version { }
286 THIS->lexer_p_->set_notename_table ($1);
288 | chordmodifiers_block {
289 THIS->lexer_p_->set_chordmodifier_table ($1);
292 delete header_global_p;
293 header_global_p = $1;
296 score_global_array.push ($1);
299 Identifier * id = new
300 Paper_def_identifier ($1, PAPER_IDENTIFIER);
301 THIS->lexer_p_->set_identifier ("$defaultpaper", id)
304 Identifier * id = new
305 Midi_def_identifier ($1, MIDI_IDENTIFIER);
306 THIS->lexer_p_->set_identifier ("$defaultmidi", id)
314 read_lily_scm_file (*$2);
318 gh_eval_str ($2->ch_l ());
324 Mudela_version ver (*$2);
325 if (!((ver >= oldest_version) && (ver <= version))) {
326 if (THIS->ignore_version_b_) {
327 THIS->here_input ().error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
329 THIS->fatal_error_i_ = 1;
330 THIS->parser_error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
337 chordmodifiers_block:
338 CHORDMODIFIERS '{' notenames_body '}' { $$ = $3; }
343 NOTENAMES '{' notenames_body '}' { $$ = $3; }
350 $$ = new Notename_table;
352 | NOTENAME_TABLE_IDENTIFIER {
353 $$ = $1-> access_content_Notename_table(true);
355 | notenames_body STRING '=' explicit_musical_pitch {
366 THIS->lexer_p_-> scope_l_arr_.push ($$);
368 | mudela_header_body assignment ';' {
374 HEADER '{' mudela_header_body '}' {
376 THIS->lexer_p_-> scope_l_arr_.pop ();
386 THIS->remember_spot ();
388 /* cont */ '=' identifier_init {
389 THIS->lexer_p_->set_identifier (*$1, $4);
390 $4->init_b_ = THIS->init_parse_b_;
391 $4->set_spot (THIS->pop_spot ());
396 simple_identifier_init: identifier_init
405 $$ = new Score_identifier ($1, SCORE_IDENTIFIER);
408 | chordmodifiers_block {
409 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
412 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
415 $$ = new Paper_def_identifier ($1, PAPER_IDENTIFIER);
418 $$ = new Midi_def_identifier ($1, MIDI_IDENTIFIER);
422 $$ = new Translator_identifier ($1, TRANS_IDENTIFIER);
425 $$ = new Music_identifier ($1, MUSIC_IDENTIFIER);
429 $$ = new Request_identifier ($1, POST_REQUEST_IDENTIFIER);
431 | explicit_duration {
432 $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
435 $$ = new Real_identifier (new Real ($1), REAL_IDENTIFIER);
438 $$ = new String_identifier ($1, STRING_IDENTIFIER);
441 $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
443 | script_definition {
444 $$ = new General_script_def_identifier ($1, SCRIPT_IDENTIFIER);
450 TRANSLATOR '{' translator_spec_body '}'
454 translator_spec_body:
456 $$ = $1->access_content_Translator (true);
457 $$-> set_spot (THIS->here_input ());
460 Translator* t = get_translator_l (*$2);
461 Translator_group * tg = dynamic_cast<Translator_group*> (t);
464 THIS->parser_error (_("Need a translator group for a context"));
467 t->set_spot (THIS->here_input ());
471 | translator_spec_body STRING '=' simple_identifier_init ';' {
473 String_identifier *s = dynamic_cast<String_identifier*> (id);
474 Real_identifier *r= dynamic_cast<Real_identifier*>(id);
475 int_identifier *i = dynamic_cast<int_identifier*> (id);
478 if (s) str = *s->access_content_String (false);
479 if (i) str = to_str (*i->access_content_int (false));
480 if (r) str = to_str (*r->access_content_Real (false));
482 THIS->parser_error (_("Wrong type for property value"));
486 Translator_group * tr = dynamic_cast<Translator_group*>($$);
487 tr->set_property (*$2, str);
489 | translator_spec_body NAME STRING ';' {
493 | translator_spec_body CONSISTS STRING ';' {
494 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
497 | translator_spec_body ACCEPTS STRING ';' {
498 dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
501 | translator_spec_body REMOVE STRING ';' {
502 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
511 SCORE { THIS->remember_spot ();
513 /*cont*/ '{' score_body '}' {
515 $$->set_spot (THIS->pop_spot ());
516 if (!$$->def_p_arr_.size ())
517 $$->add_output (THIS->default_paper_p ());
526 $$ = $1->access_content_Score (true);
528 | score_body mudela_header {
533 $2->warning (_ ("More than one music block"));
536 | score_body output_def {
554 /* */ { $$ =new Array<int>; }
555 | intastint_list int '*' int {
556 $$->push ($2); $$->push ($4);
558 | intastint_list int {
559 $$->push ($2); $$->push (1);
568 PAPER '{' paper_def_body '}' {
570 THIS-> lexer_p_->scope_l_arr_.pop ();
586 Paper_def *p = THIS->default_paper_p ();
587 THIS-> lexer_p_-> scope_l_arr_.push (p->scope_p_);
590 | PAPER_IDENTIFIER optional_semicolon {
591 Paper_def *p = $1->access_content_Paper_def (true);
592 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
595 | paper_def_body int '=' FONT STRING { // ugh, what a syntax
596 Lookup * l = new Lookup;
599 $$->set_lookup ($2, l);
601 | paper_def_body assignment ';' {
604 | paper_def_body translator_spec {
605 $$->assign_translator ($2);
607 | paper_def_body SHAPE '=' shape_array ';' {
608 $$->shape_int_a_ = *$4;
611 | paper_def_body error {
618 real_expression { $$ = $1; }
643 $$= *$1->access_content_Real (false);
645 | '-' real_expression %prec UNARY_MINUS {
648 | real_expression '*' real_expression {
651 | real_expression '/' real_expression {
654 | real_expression '+' real_expression {
657 | real_expression '-' real_expression {
660 | '(' real_expression ')' {
668 $$ = new Array<Interval>;
670 | shape_array real real {
671 $$->push(Interval($2, $2 + $3));
680 '{' midi_body '}' { $$ = $3; }
683 midi_body: /* empty */ {
684 $$ = THIS->default_midi_p ();
687 $$ = $1-> access_content_Midi_def (true);
689 | midi_body translator_spec {
690 $$-> assign_translator ($2);
692 | midi_body tempo_request ';' {
693 $$->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
702 TEMPO steno_duration '=' unsigned {
706 $$-> metronome_i_ = $4;
710 Music_list: /* empty */ {
727 Music_list* m = new Music_list;
728 $$ = new Sequential_music (m);
730 | ALTERNATIVE Simultaneous_music {
733 | ALTERNATIVE Sequential_music {
738 Repeated_music: REPEAT unsigned Music Alternative_music {
739 Music_sequence* m = dynamic_cast <Music_sequence*> ($4);
741 $$ = new Repeated_music ($3, $2 >? 1, m);
745 Sequential_music: '{' Music_list '}' {
746 $$ = new Sequential_music ($2);
750 Simultaneous_music: '<' Music_list '>' {
751 $$ = new Simultaneous_music ($2);
756 request_chord { $$ = $1; }
757 | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
760 | Simple_music '*' unsigned '/' unsigned {
762 $$ = new Compressed_music ($3, $5, $1);
764 | Simple_music '*' unsigned {
765 $$ = new Compressed_music ($3, 1, $1);
773 $$->translator_type_str_ = *$2;
776 | TYPE STRING '=' STRING Music {
778 $$->translator_type_str_ = *$2;
779 $$->translator_id_str_ = *$4;
784 THIS->remember_spot ();
787 unsigned '/' unsigned Music
790 $$ = new Compressed_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; }
828 RELATIVE absolute_musical_pitch Music {
829 $$ = new Relative_octave_music ($3, *$2);
835 TRANSLATOR STRING '=' STRING {
836 Change_translator * t = new Change_translator;
837 t-> change_to_type_str_ = *$2;
838 t-> change_to_id_str_ = *$4;
841 $$->set_spot (THIS->here_input ());
848 PROPERTY STRING '.' STRING '=' scalar {
849 Translation_property *t = new Translation_property;
850 t-> translator_type_str_ = *$2;
854 $$->set_spot (THIS->here_input ());
862 STRING { $$ = new Scalar (*$1); delete $1; }
863 | int { $$ = new Scalar ($1); }
868 pre_requests simple_element post_requests {
869 THIS->add_requests ((Simultaneous_music*)$2);//ugh
877 $$ = new Request_chord;
878 $$-> set_spot (THIS->here_input ());
879 $1-> set_spot (THIS->here_input ());
880 ((Simultaneous_music*)$$) ->add_music ($1);//ugh
886 | verbose_command_req ';' { $$ = $1; }
891 $$ = new Barcheck_req;
893 | COMMAND_IDENTIFIER {
894 $$ = $1->access_content_Request (true);
900 Beam_req*b= new Beam_req;
901 b->spantype_ = START;
905 Beam_req*b= new Beam_req;
914 $$ = new Bar_req (*$2);
918 $$ = new Mark_req (*$2);
922 $$ = new Mark_req (to_str ($2));
924 | TIME_T unsigned '/' unsigned {
925 Time_signature_change_req *m = new Time_signature_change_req;
931 Break_req * b = new Break_req;
933 b-> set_spot (THIS->here_input ());
936 | SKIP duration_length {
937 Skip_req * skip_p = new Skip_req;
938 skip_p->duration_ = *$2;
946 $$ = new Cadenza_req ($2);
948 | PARTIAL duration_length {
949 $$ = new Partial_measure_req ($2->length_mom ());
953 $$ = new Clef_change_req (*$2);
956 | KEY NOTENAME_PITCH optional_modality {
957 Key_change_req *key_p= new Key_change_req;
958 key_p->pitch_arr_.push(*$2);
959 key_p->ordinary_key_b_ = true;
960 key_p->modality_i_ = $3;
964 | KEYSIGNATURE pitch_list {
965 Key_change_req *key_p= new Key_change_req;
966 key_p->pitch_arr_ = *$2;
967 key_p->ordinary_key_b_ = false;
971 | GROUPING intastint_list {
972 $$ = get_grouping_req (*$2); delete $2;
978 /* something silly happened. Junk this stuff*/
979 if (!THIS->post_reqs.empty ())
981 warning ("Junking post-requests");
982 THIS->post_reqs.clear ();
985 | post_requests structured_post_request {
986 $2->set_spot (THIS->here_input ());
987 THIS->post_reqs.push ($2);
989 | post_requests close_request_parens {
990 Array<Request*>& r = *THIS->get_parens_request ($2);
991 for (int i = 0; i < r.size (); i++ )
992 r[i]->set_spot (THIS->here_input ());
993 THIS->post_reqs.concat (r);
998 structured_post_request:
1004 POST_REQUEST_IDENTIFIER {
1005 $$ = (Request*)$1->access_content_Request (true);
1011 Abbreviation_req* a = new Abbreviation_req;
1046 steno_musical_pitch:
1050 | NOTENAME_PITCH sup_quotes {
1052 $$->octave_i_ += $2;
1054 | NOTENAME_PITCH sub_quotes {
1056 $$->octave_i_ += - $2;
1064 | TONICNAME_PITCH sup_quotes {
1066 $$->octave_i_ += $2;
1068 | TONICNAME_PITCH sub_quotes {
1070 $$->octave_i_ += - $2;
1074 explicit_musical_pitch:
1075 MUSICAL_PITCH '{' int_list '}' {/* ugh */
1076 Array<int> &a = *$3;
1078 $$ = new Musical_pitch;
1079 $$->octave_i_ = a[0];
1080 $$->notename_i_ = a[1];
1081 $$->accidental_i_ = a[2];
1088 | explicit_musical_pitch
1098 | steno_notepitch '!' {
1099 $$->forceacc_b_ = ! $$->forceacc_b_;
1101 | steno_notepitch '?' {
1102 $$->forceacc_b_ = ! $$->forceacc_b_;
1103 $$->cautionary_b_ = ! $$->cautionary_b_;
1109 DURATION '{' int_list '}' {
1111 Array<int> &a = *$3;
1114 $$-> durlog_i_ = a[0];
1115 $$-> dots_i_ = a[1];
1123 if (!THIS->lexer_p_->lyric_state_b ())
1124 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1125 Extender_req * e_p = new Extender_req;
1126 e_p->spantype_ = START;
1128 THIS->extender_req = e_p;
1132 ABSDYNAMIC '{' unsigned '}' {
1133 Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
1134 ad_p ->loudness_ = (Dynamic_req::Loudness)$3;
1137 | SPANDYNAMIC '{' int int '}' {
1138 Span_dynamic_req * sp_p = new Span_dynamic_req;
1139 sp_p->spantype_ = (Direction)$4;
1140 sp_p-> dynamic_dir_ = (Direction)$3;
1147 close_request_parens:
1161 open_request_parens:
1173 SCRIPT '{' script_body '}' { $$ = $3; }
1177 STRING int int int int int {
1178 Script_def *s = new Script_def;
1179 s->set_from_input (*$1,$2, $3,$4,$5, $6);
1186 script_dir gen_script_def {
1187 Musical_script_req *m = new Musical_script_req;
1189 m->scriptdef_p_ = $2;
1190 m->set_spot (THIS->here_input ());
1192 m->dir_ = (Direction)$1;
1199 ((Text_def*) $$)->align_dir_ = LEFT; /* UGH */
1203 $$-> set_spot (THIS->here_input ());
1207 ((Text_def*)$$)->align_dir_ = RIGHT; /* UGH */
1213 Text_def *t = new Text_def;
1217 $$->set_spot (THIS->here_input ());
1223 Text_def* t = new Text_def;
1225 t->text_str_ = to_str ($1);
1226 t->style_str_ = "finger";
1227 $$->set_spot (THIS->here_input ());
1231 script_abbreviation:
1232 '^' { $$ = get_scriptdef ('^'); }
1233 | '+' { $$ = get_scriptdef ('+'); }
1234 | '-' { $$ = get_scriptdef ('-'); }
1235 | '|' { $$ = get_scriptdef ('|'); }
1236 | 'o' { $$ = get_scriptdef ('o'); }
1237 | '>' { $$ = get_scriptdef ('>'); }
1239 $$ = get_scriptdef ('.');
1244 SCRIPT_IDENTIFIER { $$ = $1->access_content_General_script_def (true); }
1245 | script_definition { $$ = $1; }
1246 | script_abbreviation {
1247 $$ = THIS->lexer_p_->lookup_identifier (*$1)->access_content_General_script_def (true);
1260 if (THIS->extender_req)
1262 Extender_req * e_p = new Extender_req;
1263 e_p->spantype_ = STOP;
1264 THIS->pre_reqs.push (e_p);
1265 THIS->extender_req = 0;
1269 | pre_requests open_request_parens {
1271 Array<Request*>& r = *THIS->get_parens_request ($2);
1272 for (int i = 0; i < r.size (); i++ )
1273 r[i]->set_spot (THIS->here_input ());
1274 THIS->pre_reqs.concat (r);
1279 absolute_musical_pitch:
1280 steno_musical_pitch {
1289 | duration_length '*' unsigned {
1290 $$->plet_.iso_i_ *= $3;
1292 | duration_length '/' unsigned {
1293 $$->plet_.type_i_ *= $3;
1299 | dots '.' { $$ ++; }
1302 entered_notemode_duration:
1304 $$ = new Duration (THIS->default_duration_);
1307 $$ = new Duration (THIS->default_duration_);
1311 THIS->set_last_duration ($1);
1316 entered_notemode_duration {
1324 if (!Duration::duration_type_b ($1))
1325 THIS->parser_error (_f ("not a duration: %d", $1));
1327 $$->durlog_i_ = Duration_convert::i2_type ($1);
1330 | DURATION_IDENTIFIER {
1331 $$ = $1->access_content_Duration (true);
1333 | steno_duration '.' {
1344 if (!Duration::duration_type_b ($2))
1345 THIS->parser_error (_f ("not a duration: %d", $2));
1347 THIS->parser_error (_ ("can't abbreviate"));
1355 steno_notepitch notemode_duration {
1356 if (!THIS->lexer_p_->note_state_b ())
1357 THIS->parser_error (_ ("have to be in Note mode for notes"));
1358 $1->duration_ = *$2;
1359 $$ = THIS->get_note_element ($1, $2);
1361 | RESTNAME notemode_duration {
1362 $$ = THIS->get_rest_element (*$1, $2);
1363 delete $1; // delete notename
1365 | MEASURES notemode_duration {
1366 Multi_measure_rest_req* m = new Multi_measure_rest_req;
1370 Simultaneous_music*velt_p = new Request_chord;
1371 velt_p->set_spot (THIS->here_input ());
1372 velt_p->add_music (m);
1375 | STRING notemode_duration {
1376 if (!THIS->lexer_p_->lyric_state_b ())
1377 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1378 $$ = THIS->get_word_element (*$1, $2);
1382 if (!THIS->lexer_p_->chord_state_b ())
1383 THIS->parser_error (_ ("have to be in Chord mode for chords"));
1386 | '@' notemode_chord '@' {
1387 if (!THIS->lexer_p_->note_state_b ())
1388 THIS->parser_error (_ ("have to be in Note mode for @chords"));
1394 steno_tonic_pitch notemode_duration chord_additions chord_subtractions chord_inversion {
1395 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1399 steno_musical_pitch notemode_duration chord_additions chord_subtractions notemode_chord_inversion {
1400 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1405 $$ = new Array<Musical_pitch>;
1414 $$ = new Array<Musical_pitch>;
1416 | chord_notes chord_addsub {
1423 chord_note optional_dot
1424 | CHORDMODIFIER_PITCH optional_dot
1431 | '/' steno_tonic_pitch {
1436 notemode_chord_inversion:
1440 | '/' steno_musical_pitch {
1447 $$ = new Musical_pitch;
1448 $$->notename_i_ = ($1 - 1) % 7;
1449 $$->octave_i_ = $1 > 7 ? 1 : 0;
1450 $$->accidental_i_ = 0;
1453 $$ = new Musical_pitch;
1454 $$->notename_i_ = ($1 - 1) % 7;
1455 $$->octave_i_ = $1 > 7 ? 1 : 0;
1456 $$->accidental_i_ = 1;
1459 $$ = new Musical_pitch;
1460 $$->notename_i_ = ($1 - 1) % 7;
1461 $$->octave_i_ = $1 > 7 ? 1 : 0;
1462 $$->accidental_i_ = -1;
1468 $$ = new Array<Musical_pitch>;
1479 $$ = new Array<Musical_pitch>;
1481 | pitch_list musical_pitch {
1513 $$ = *$1->access_content_int (false);
1522 | STRING_IDENTIFIER {
1523 $$ = $1->access_content_String (true);
1525 | string '+' string {
1539 My_lily_parser::set_yydebug (bool b)
1546 My_lily_parser::do_yyparse ()
1548 yyparse ((void*)this);