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 Link_array<Request> *reqvec;
95 Array<String> * strvec;
97 Notename_table *chordmodifiertab;
99 General_script_def * script;
102 Music_list *music_list;
107 Music_output_def * outputdef;
108 Musical_pitch * pitch;
112 Notename_table *notenametab;
117 Simultaneous_music *chord;
130 yylex (YYSTYPE *s, void * v_l)
132 My_lily_parser *pars_l = (My_lily_parser*) v_l;
133 My_lily_lexer * lex_l = pars_l->lexer_p_;
135 lex_l->lexval_l = (void*) s;
136 return lex_l->yylex ();
144 /* tokens which are not keywords */
151 %token CHORDMODIFIERS
197 %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
201 %token <pitch> NOTENAME_PITCH
202 %token <pitch> TONICNAME_PITCH
203 %token <pitch> CHORDMODIFIER_PITCH
204 %token <id> DURATION_IDENTIFIER
205 %token <id> IDENTIFIER
206 %token <id> NOTENAME_TABLE_IDENTIFIER
207 %token <id> MUSIC_IDENTIFIER
208 %token <id> POST_REQUEST_IDENTIFIER
209 %token <id> SCRIPT_IDENTIFIER
210 %token <id> COMMAND_IDENTIFIER
211 %token <id> REAL_IDENTIFIER
212 %token <id> STRING_IDENTIFIER
213 %token <id> TRANS_IDENTIFIER
214 %token <id> INT_IDENTIFIER
215 %token <id> SCORE_IDENTIFIER
216 %token <id> MIDI_IDENTIFIER
217 %token <id> PAPER_IDENTIFIER
219 %token <string> DURATION RESTNAME
220 %token <string> STRING
224 %type <outputdef> output_def
225 %type <scope> mudela_header mudela_header_body
226 %type <request> open_request_parens close_request_parens open_request close_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
240 %type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
241 %type <pitch> steno_tonic_pitch
242 %type <notereq> steno_notepitch
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
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 structured_post_request
258 %type <request> command_req verbose_command_req
259 %type <request> script_req dynamic_req extender_req
260 %type <string> string
261 %type <score> score_block score_body
262 %type <intarr> shape_array
263 %type <script> script_definition script_body mudela_script gen_script_def
264 %type <textdef> text_def finger
265 %type <string> script_abbreviation
266 %type <trans> translator_spec_block translator_spec_body
267 %type <tempo> tempo_request
268 %type <notenametab> notenames_body notenames_block chordmodifiers_block
280 | mudela toplevel_expression {}
281 | mudela assignment { }
283 | mudela check_version { }
288 THIS->lexer_p_->set_notename_table ($1);
290 | chordmodifiers_block {
291 THIS->lexer_p_->set_chordmodifier_table ($1);
294 delete header_global_p;
295 header_global_p = $1;
298 score_global_array.push ($1);
301 Identifier * id = new
302 Paper_def_identifier ($1, PAPER_IDENTIFIER);
303 THIS->lexer_p_->set_identifier ("$defaultpaper", id)
306 Identifier * id = new
307 Midi_def_identifier ($1, MIDI_IDENTIFIER);
308 THIS->lexer_p_->set_identifier ("$defaultmidi", id)
316 read_lily_scm_file (*$2);
320 gh_eval_str ($2->ch_l ());
326 Mudela_version ver (*$2);
327 if (!((ver >= oldest_version) && (ver <= version))) {
328 if (THIS->ignore_version_b_) {
329 THIS->here_input ().error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
331 THIS->fatal_error_i_ = 1;
332 THIS->parser_error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
339 chordmodifiers_block:
340 CHORDMODIFIERS '{' notenames_body '}' { $$ = $3; }
345 NOTENAMES '{' notenames_body '}' { $$ = $3; }
352 $$ = new Notename_table;
354 | NOTENAME_TABLE_IDENTIFIER {
355 $$ = $1-> access_content_Notename_table(true);
357 | notenames_body STRING '=' explicit_musical_pitch {
368 THIS->lexer_p_-> scope_l_arr_.push ($$);
370 | mudela_header_body assignment ';' {
376 HEADER '{' mudela_header_body '}' {
378 THIS->lexer_p_-> scope_l_arr_.pop ();
388 THIS->remember_spot ();
390 /* cont */ '=' identifier_init {
391 THIS->lexer_p_->set_identifier (*$1, $4);
392 $4->init_b_ = THIS->init_parse_b_;
393 $4->set_spot (THIS->pop_spot ());
401 $$ = new Score_identifier ($1, SCORE_IDENTIFIER);
404 | chordmodifiers_block {
405 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
408 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
411 $$ = new Paper_def_identifier ($1, PAPER_IDENTIFIER);
414 $$ = new Midi_def_identifier ($1, MIDI_IDENTIFIER);
417 | translator_spec_block {
418 $$ = new Translator_identifier ($1, TRANS_IDENTIFIER);
421 $$ = new Music_identifier ($1, MUSIC_IDENTIFIER);
425 $$ = new Request_identifier ($1, POST_REQUEST_IDENTIFIER);
427 | explicit_duration {
428 $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
431 $$ = new Real_identifier (new Real ($1), REAL_IDENTIFIER);
434 $$ = new String_identifier ($1, STRING_IDENTIFIER);
437 $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
439 | script_definition {
440 $$ = new General_script_def_identifier ($1, SCRIPT_IDENTIFIER);
445 translator_spec_block:
446 TRANSLATOR '{' translator_spec_body '}'
450 translator_spec_body:
452 $$ = $1->access_content_Translator (true);
453 $$-> set_spot (THIS->here_input ());
456 Translator* t = get_translator_l (*$2);
457 Translator_group * tg = dynamic_cast<Translator_group*> (t);
460 THIS->parser_error (_("Need a translator group for a context"));
463 t->set_spot (THIS->here_input ());
467 | translator_spec_body STRING '=' identifier_init ';' {
469 String_identifier *s = dynamic_cast<String_identifier*> (id);
470 Real_identifier *r= dynamic_cast<Real_identifier*>(id);
471 int_identifier *i = dynamic_cast<int_identifier*> (id);
474 if (s) str = *s->access_content_String (false);
475 if (i) str = to_str (*i->access_content_int (false));
476 if (r) str = to_str (*r->access_content_Real (false));
478 THIS->parser_error (_("Wrong type for property value"));
482 Translator_group * tr = dynamic_cast<Translator_group*>($$);
483 tr->set_property (*$2, str);
485 | translator_spec_body NAME STRING ';' {
489 | translator_spec_body CONSISTS STRING ';' {
490 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
493 | translator_spec_body ACCEPTS STRING ';' {
494 dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
497 | translator_spec_body REMOVE STRING ';' {
498 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
507 SCORE { THIS->remember_spot ();
509 /*cont*/ '{' score_body '}' {
511 $$->set_spot (THIS->pop_spot ());
512 if (!$$->def_p_arr_.size ())
513 $$->add_output (THIS->default_paper_p ());
522 $$ = $1->access_content_Score (true);
524 | score_body mudela_header {
529 $2->warning (_ ("More than one music block"));
532 | score_body output_def {
550 /* */ { $$ =new Array<int>; }
551 | intastint_list int '*' int {
552 $$->push ($2); $$->push ($4);
554 | intastint_list int {
555 $$->push ($2); $$->push (1);
564 PAPER '{' paper_def_body '}' {
566 THIS-> lexer_p_->scope_l_arr_.pop ();
577 Paper_def *p = THIS->default_paper_p ();
578 THIS-> lexer_p_-> scope_l_arr_.push (p->scope_p_);
582 Paper_def *p = $1->access_content_Paper_def (true);
583 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
586 | paper_def_body int '=' FONT STRING { // ugh, what a syntax
587 Lookup * l = new Lookup;
590 $$->set_lookup ($2, l);
592 | paper_def_body assignment ';' {
595 | paper_def_body translator_spec_block {
596 $$->assign_translator ($2);
598 | paper_def_body SHAPE '=' shape_array ';' {
599 $$->shape_int_a_ = *$4;
602 | paper_def_body error {
609 real_expression { $$ = $1; }
632 | real_with_dimension
634 $$= *$1->access_content_Real (false);
636 | '-' real_expression %prec UNARY_MINUS {
639 | real_expression '*' real_expression {
642 | real_expression '/' real_expression {
645 | real_expression '+' real_expression {
648 | real_expression '-' real_expression {
651 | '(' real_expression ')' {
659 $$ = new Array<Interval>;
661 | shape_array real real {
662 $$->push(Interval($2, $2 + $3));
671 '{' midi_body '}' { $$ = $3; }
674 midi_body: /* empty */ {
675 $$ = THIS->default_midi_p ();
678 $$ = $1-> access_content_Midi_def (true);
680 | midi_body translator_spec_block {
681 $$-> assign_translator ($2);
683 | midi_body tempo_request ';' {
684 $$->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
693 TEMPO steno_duration '=' unsigned {
697 $$-> metronome_i_ = $4;
701 Music_list: /* empty */ {
718 Music_list* m = new Music_list;
719 $$ = new Sequential_music (m);
721 | ALTERNATIVE Simultaneous_music {
724 | ALTERNATIVE Sequential_music {
729 Repeated_music: REPEAT unsigned Music Alternative_music {
730 Music_sequence* m = dynamic_cast <Music_sequence*> ($4);
732 $$ = new Repeated_music ($3, $2 >? 1, m);
736 Sequential_music: '{' Music_list '}' {
737 $$ = new Sequential_music ($2);
741 Simultaneous_music: '<' Music_list '>' {
742 $$ = new Simultaneous_music ($2);
747 request_chord { $$ = $1; }
748 | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
751 | Simple_music '*' unsigned '/' unsigned {
753 $$ = new Compressed_music ($3, $5, $1);
755 | Simple_music '*' unsigned {
756 $$ = new Compressed_music ($3, 1, $1);
764 $$->translator_type_str_ = *$2;
767 | TYPE STRING '=' STRING Music {
769 $$->translator_type_str_ = *$2;
770 $$->translator_id_str_ = *$4;
775 THIS->remember_spot ();
778 unsigned '/' unsigned Music
781 $$ = new Compressed_music ($3, $5, $6);
782 $$->set_spot (THIS->pop_spot ());
784 | Repeated_music { $$ = $1; }
785 | Simultaneous_music { $$ = $1; }
786 | Sequential_music { $$ = $1; }
787 | TRANSPOSE musical_pitch Music {
788 $$ = new Transposed_music ($3, *$2);
791 | TRANSPOSE steno_tonic_pitch Music {
792 $$ = new Transposed_music ($3, *$2);
796 { THIS->lexer_p_->push_note_state (); }
799 THIS->lexer_p_->pop_state ();
802 { THIS->lexer_p_->push_chord_state (); }
806 THIS->lexer_p_->pop_state ();
809 { THIS->lexer_p_->push_lyric_state (); }
813 THIS->lexer_p_->pop_state ();
815 | relative_music { $$ = $1; }
819 RELATIVE absolute_musical_pitch Music {
820 $$ = new Relative_octave_music ($3, *$2);
826 TRANSLATOR STRING '=' STRING {
827 Change_translator * t = new Change_translator;
828 t-> change_to_type_str_ = *$2;
829 t-> change_to_id_str_ = *$4;
832 $$->set_spot (THIS->here_input ());
839 PROPERTY STRING '.' STRING '=' scalar {
840 Translation_property *t = new Translation_property;
841 t-> translator_type_str_ = *$2;
845 $$->set_spot (THIS->here_input ());
853 STRING { $$ = new Scalar (*$1); delete $1; }
854 | int { $$ = new Scalar ($1); }
859 pre_requests simple_element post_requests {
860 Music_sequence *l = dynamic_cast<Music_sequence*>($2);
861 for (int i=0; i < $1->size(); i++)
862 l->add_music ($1->elem(i));
863 for (int i=0; i < $3->size(); i++)
864 l->add_music ($3->elem(i));
873 $$ = new Request_chord;
874 $$-> set_spot (THIS->here_input ());
875 $1-> set_spot (THIS->here_input ());
876 ((Simultaneous_music*)$$) ->add_music ($1);//ugh
882 | verbose_command_req ';' { $$ = $1; }
890 $$ = new Barcheck_req;
892 | COMMAND_IDENTIFIER {
893 $$ = $1->access_content_Request (true);
899 Beam_req*b= new Beam_req;
900 b->spantype_ = START;
904 Beam_req*b= new Beam_req;
913 $$ = new Bar_req (*$2);
917 $$ = new Mark_req (*$2);
921 $$ = new Mark_req (to_str ($2));
923 | TIME_T unsigned '/' unsigned {
924 Time_signature_change_req *m = new Time_signature_change_req;
930 Break_req * b = new Break_req;
932 b-> set_spot (THIS->here_input ());
935 | SKIP duration_length {
936 Skip_req * skip_p = new Skip_req;
937 skip_p->duration_ = *$2;
945 $$ = new Cadenza_req ($2);
947 | PARTIAL duration_length {
948 $$ = new Partial_measure_req ($2->length_mom ());
952 $$ = new Clef_change_req (*$2);
955 | KEY NOTENAME_PITCH optional_modality {
956 Key_change_req *key_p= new Key_change_req;
957 key_p->pitch_arr_.push(*$2);
958 key_p->ordinary_key_b_ = true;
959 key_p->modality_i_ = $3;
963 | KEYSIGNATURE pitch_list {
964 Key_change_req *key_p= new Key_change_req;
965 key_p->pitch_arr_ = *$2;
966 key_p->ordinary_key_b_ = false;
970 | GROUPING intastint_list {
971 Measure_grouping_req * mr_p = new Measure_grouping_req;
972 for (int i=0; i < $2->size();)
974 mr_p->elt_length_arr_.push (Moment (1, $2->elem(i++)));
975 mr_p->beat_i_arr_.push ($2->elem(i++));
986 $$ = new Link_array<Request>;
988 | post_requests structured_post_request {
989 $2->set_spot (THIS->here_input ());
992 | post_requests close_request {
997 structured_post_request:
1003 POST_REQUEST_IDENTIFIER {
1004 $$ = (Request*)$1->access_content_Request (true);
1010 Abbreviation_req* a = new Abbreviation_req;
1044 steno_musical_pitch:
1048 | NOTENAME_PITCH sup_quotes {
1050 $$->octave_i_ += $2;
1052 | NOTENAME_PITCH sub_quotes {
1054 $$->octave_i_ += - $2;
1062 | TONICNAME_PITCH sup_quotes {
1064 $$->octave_i_ += $2;
1066 | TONICNAME_PITCH sub_quotes {
1068 $$->octave_i_ += - $2;
1072 explicit_musical_pitch:
1073 MUSICAL_PITCH '{' int_list '}' {/* ugh */
1074 Array<int> &a = *$3;
1076 $$ = new Musical_pitch;
1077 $$->octave_i_ = a[0];
1078 $$->notename_i_ = a[1];
1079 $$->accidental_i_ = a[2];
1086 | explicit_musical_pitch
1096 | steno_notepitch '!' {
1097 $$->forceacc_b_ = ! $$->forceacc_b_;
1099 | steno_notepitch '?' {
1100 $$->forceacc_b_ = ! $$->forceacc_b_;
1101 $$->cautionary_b_ = ! $$->cautionary_b_;
1107 DURATION '{' int_list '}' {
1109 Array<int> &a = *$3;
1112 $$-> durlog_i_ = a[0];
1113 $$-> dots_i_ = a[1];
1121 if (!THIS->lexer_p_->lyric_state_b ())
1122 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1123 $$ = new Extender_req;
1128 ABSDYNAMIC '{' STRING '}' {
1129 Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
1130 ad_p ->loudness_str_ = *$3;
1134 | SPANDYNAMIC '{' int int '}' {
1135 Span_dynamic_req * sp_p = new Span_dynamic_req;
1136 sp_p-> dynamic_dir_ = Direction($3);
1137 sp_p->spantype_ = Direction($4);
1144 close_request_parens {
1146 dynamic_cast<Span_req*> ($$)->spantype_ = START;
1149 close_request_parens:
1154 Span_dynamic_req*s =new Span_dynamic_req;
1156 s->dynamic_dir_ = SMALLER;
1159 Span_dynamic_req*s =new Span_dynamic_req;
1161 s->dynamic_dir_ = BIGGER;
1167 open_request_parens {
1169 dynamic_cast<Span_req*> ($$)->spantype_ = STOP;
1173 open_request_parens:
1175 Span_dynamic_req *s = new Span_dynamic_req;
1176 s->dynamic_dir_ = SMALLER;
1188 SCRIPT '{' script_body '}' { $$ = $3; }
1192 STRING int int int int int {
1193 Script_def *s = new Script_def;
1194 s->set_from_input (*$1,$2, $3,$4,$5, $6);
1201 script_dir gen_script_def {
1202 Musical_script_req *m = new Musical_script_req;
1204 m->scriptdef_p_ = $2;
1205 m->set_spot (THIS->here_input ());
1207 m->dir_ = (Direction)$1;
1214 ((Text_def*) $$)->align_dir_ = LEFT; /* UGH */
1218 $$-> set_spot (THIS->here_input ());
1222 ((Text_def*)$$)->align_dir_ = RIGHT; /* UGH */
1228 Text_def *t = new Text_def;
1232 $$->set_spot (THIS->here_input ());
1238 Text_def* t = new Text_def;
1240 t->text_str_ = to_str ($1);
1241 t->style_str_ = "finger";
1242 $$->set_spot (THIS->here_input ());
1246 script_abbreviation:
1249 ->lookup_identifier ("dash-hat")->access_content_String (true)
1254 ->lookup_identifier ("dash-plus")->access_content_String (true)
1258 ->lookup_identifier ("dash-dash")->access_content_String (true)
1262 ->lookup_identifier ("dash-bar")->access_content_String (true)
1266 ->lookup_identifier ("dash-larger")->access_content_String (true)
1270 ->lookup_identifier ("dash-dot")->access_content_String (true);
1275 SCRIPT_IDENTIFIER { $$ = $1->access_content_General_script_def (true); }
1276 | script_definition { $$ = $1; }
1277 | script_abbreviation {
1278 $$ = THIS->lexer_p_->lookup_identifier (*$1)->access_content_General_script_def (true);
1285 | '^' { $$ = CENTER; }
1291 $$ = new Link_array<Request>;
1293 | pre_requests open_request {
1298 absolute_musical_pitch:
1299 steno_musical_pitch {
1308 | duration_length '*' unsigned {
1309 $$->plet_.iso_i_ *= $3;
1311 | duration_length '/' unsigned {
1312 $$->plet_.type_i_ *= $3;
1318 | dots '.' { $$ ++; }
1321 entered_notemode_duration:
1323 $$ = new Duration (THIS->default_duration_);
1326 $$ = new Duration (THIS->default_duration_);
1330 THIS->set_last_duration ($1);
1335 entered_notemode_duration {
1343 if (!Duration::duration_type_b ($1))
1344 THIS->parser_error (_f ("not a duration: %d", $1));
1346 $$->durlog_i_ = Duration_convert::i2_type ($1);
1349 | DURATION_IDENTIFIER {
1350 $$ = $1->access_content_Duration (true);
1352 | steno_duration '.' {
1363 if (!Duration::duration_type_b ($2))
1364 THIS->parser_error (_f ("not a duration: %d", $2));
1366 THIS->parser_error (_ ("can't abbreviate"));
1374 steno_notepitch notemode_duration {
1375 if (!THIS->lexer_p_->note_state_b ())
1376 THIS->parser_error (_ ("have to be in Note mode for notes"));
1377 $1->duration_ = *$2;
1378 $$ = THIS->get_note_element ($1, $2);
1380 | RESTNAME notemode_duration {
1381 $$ = THIS->get_rest_element (*$1, $2);
1382 delete $1; // delete notename
1384 | MEASURES notemode_duration {
1385 Multi_measure_rest_req* m = new Multi_measure_rest_req;
1389 Simultaneous_music*velt_p = new Request_chord;
1390 velt_p->set_spot (THIS->here_input ());
1391 velt_p->add_music (m);
1394 | STRING notemode_duration {
1395 if (!THIS->lexer_p_->lyric_state_b ())
1396 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1397 $$ = THIS->get_word_element (*$1, $2);
1401 if (!THIS->lexer_p_->chord_state_b ())
1402 THIS->parser_error (_ ("have to be in Chord mode for chords"));
1405 | '@' notemode_chord '@' {
1406 if (!THIS->lexer_p_->note_state_b ())
1407 THIS->parser_error (_ ("have to be in Note mode for @chords"));
1413 steno_tonic_pitch notemode_duration chord_additions chord_subtractions chord_inversion {
1414 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1418 steno_musical_pitch notemode_duration chord_additions chord_subtractions notemode_chord_inversion {
1419 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1424 $$ = new Array<Musical_pitch>;
1433 $$ = new Array<Musical_pitch>;
1435 | chord_notes chord_addsub {
1442 chord_note optional_dot
1443 | CHORDMODIFIER_PITCH optional_dot
1450 | '/' steno_tonic_pitch {
1455 notemode_chord_inversion:
1459 | '/' steno_musical_pitch {
1466 $$ = new Musical_pitch;
1467 $$->notename_i_ = ($1 - 1) % 7;
1468 $$->octave_i_ = $1 > 7 ? 1 : 0;
1469 $$->accidental_i_ = 0;
1472 $$ = new Musical_pitch;
1473 $$->notename_i_ = ($1 - 1) % 7;
1474 $$->octave_i_ = $1 > 7 ? 1 : 0;
1475 $$->accidental_i_ = 1;
1478 $$ = new Musical_pitch;
1479 $$->notename_i_ = ($1 - 1) % 7;
1480 $$->octave_i_ = $1 > 7 ? 1 : 0;
1481 $$->accidental_i_ = -1;
1487 $$ = new Array<Musical_pitch>;
1498 $$ = new Array<Musical_pitch>;
1500 | pitch_list musical_pitch {
1532 $$ = *$1->access_content_int (false);
1541 | STRING_IDENTIFIER {
1542 $$ = $1->access_content_String (true);
1544 | string '+' string {
1558 My_lily_parser::set_yydebug (bool b)
1565 My_lily_parser::do_yyparse ()
1567 yyparse ((void*)this);