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"
56 #include "grace-music.hh"
59 Mudela_version oldest_version ("1.1.52");
60 Mudela_version version ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL );
64 print_mudela_versions (ostream &os)
66 os << "Oldest supported input version: " << oldest_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
193 %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
195 %type <i> dots exclamations questions
197 %token <pitch> NOTENAME_PITCH
198 %token <pitch> TONICNAME_PITCH
199 %token <pitch> CHORDMODIFIER_PITCH
200 %token <id> DURATION_IDENTIFIER
201 %token <id> IDENTIFIER
202 %token <id> NOTENAME_TABLE_IDENTIFIER
203 %token <id> MUSIC_IDENTIFIER
204 %token <id> REQUEST_IDENTIFIER
205 %token <id> REAL_IDENTIFIER
206 %token <id> STRING_IDENTIFIER
207 %token <id> TRANS_IDENTIFIER
208 %token <id> INT_IDENTIFIER
209 %token <id> SCORE_IDENTIFIER
210 %token <id> MIDI_IDENTIFIER
211 %token <id> PAPER_IDENTIFIER
213 %token <string> DURATION RESTNAME
214 %token <string> STRING
218 %type <outputdef> output_def
219 %type <scope> mudela_header mudela_header_body
220 %type <request> open_request_parens close_request_parens open_request close_request
221 %type <request> request_with_dir request_that_take_dir verbose_request
222 %type <i> sub_quotes sup_quotes
223 %type <music> simple_element request_chord command_element Simple_music Composite_music
224 %type <music> Alternative_music Repeated_music
225 %type <i> abbrev_type
226 %type <i> int unsigned
228 %type <i> optional_modality
229 %type <id> identifier_init
230 %type <duration> steno_duration notemode_duration
231 %type <duration> entered_notemode_duration explicit_duration
232 %type <intvec> int_list
233 %type <reqvec> pre_requests post_requests
234 %type <request> gen_text_def
235 %type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
236 %type <pitch> steno_tonic_pitch
238 %type <pitch_arr> pitch_list
239 %type <music> chord notemode_chord
240 %type <pitch_arr> chord_additions chord_subtractions chord_notes
241 %type <pitch> chord_addsub chord_note chord_inversion notemode_chord_inversion
242 %type <midi> midi_block midi_body
243 %type <duration> duration_length
245 %type <scalar> scalar
246 %type <music> Music relative_music Sequential_music Simultaneous_music Music_sequence
247 %type <music> property_def translator_change
248 %type <music_list> Music_list
249 %type <paper> paper_block paper_def_body
250 %type <real> real_expression real real_with_dimension
251 %type <request> abbrev_command_req
252 %type <request> post_request
253 %type <request> command_req verbose_command_req
254 %type <request> extender_req
255 %type <string> string
256 %type <score> score_block score_body
257 %type <intarr> shape_array
259 %type <string> script_abbreviation
260 %type <trans> translator_spec_block translator_spec_body
261 %type <tempo> tempo_request
262 %type <notenametab> notenames_body notenames_block chordmodifiers_block
274 | mudela toplevel_expression {}
275 | mudela assignment { }
277 | mudela check_version { }
282 THIS->lexer_p_->set_notename_table ($1);
284 | chordmodifiers_block {
285 THIS->lexer_p_->set_chordmodifier_table ($1);
288 delete header_global_p;
289 header_global_p = $1;
292 score_global_array.push ($1);
295 Identifier * id = new
296 Paper_def_identifier ($1, PAPER_IDENTIFIER);
297 THIS->lexer_p_->set_identifier ("$defaultpaper", id)
300 Identifier * id = new
301 Midi_def_identifier ($1, MIDI_IDENTIFIER);
302 THIS->lexer_p_->set_identifier ("$defaultmidi", id)
309 SCMFILE STRING semicolon {
310 read_lily_scm_file (*$2);
313 | SCM_T STRING semicolon {
314 gh_eval_str ($2->ch_l ());
319 VERSION STRING semicolon {
320 Mudela_version ver (*$2);
321 if (!((ver >= oldest_version) && (ver <= version))) {
322 if (THIS->ignore_version_b_) {
323 THIS->here_input ().error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
325 THIS->fatal_error_i_ = 1;
326 THIS->parser_error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
333 chordmodifiers_block:
334 CHORDMODIFIERS '{' notenames_body '}' { $$ = $3; }
339 NOTENAMES '{' notenames_body '}' { $$ = $3; }
346 $$ = new Notename_table;
348 | NOTENAME_TABLE_IDENTIFIER {
349 $$ = $1-> access_content_Notename_table(true);
351 | notenames_body STRING '=' explicit_musical_pitch {
362 THIS->lexer_p_-> scope_l_arr_.push ($$);
364 | mudela_header_body assignment semicolon {
370 HEADER '{' mudela_header_body '}' {
372 THIS->lexer_p_-> scope_l_arr_.pop ();
382 THIS->remember_spot ();
384 /* cont */ '=' identifier_init {
385 THIS->lexer_p_->set_identifier (*$1, $4);
386 $4->init_b_ = THIS->init_parse_b_;
387 $4->set_spot (THIS->pop_spot ());
395 $$ = new Score_identifier ($1, SCORE_IDENTIFIER);
398 | chordmodifiers_block {
399 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
402 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
405 $$ = new Paper_def_identifier ($1, PAPER_IDENTIFIER);
408 $$ = new Midi_def_identifier ($1, MIDI_IDENTIFIER);
411 | translator_spec_block {
412 $$ = new Translator_identifier ($1, TRANS_IDENTIFIER);
415 $$ = new Music_identifier ($1, MUSIC_IDENTIFIER);
419 $$ = new Request_identifier ($1, REQUEST_IDENTIFIER);
421 | explicit_duration {
422 $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
425 $$ = new Real_identifier (new Real ($1), REAL_IDENTIFIER);
428 $$ = new String_identifier ($1, STRING_IDENTIFIER);
431 $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
435 translator_spec_block:
436 TRANSLATOR '{' translator_spec_body '}'
442 translator_spec_body:
444 $$ = $1->access_content_Translator (true);
445 $$-> set_spot (THIS->here_input ());
447 | TYPE STRING semicolon {
448 Translator* t = get_translator_l (*$2);
449 Translator_group * tg = dynamic_cast<Translator_group*> (t);
452 THIS->parser_error (_("Need a translator group for a context"));
455 t->set_spot (THIS->here_input ());
459 | translator_spec_body STRING '=' identifier_init semicolon {
461 String_identifier *s = dynamic_cast<String_identifier*> (id);
462 Real_identifier *r= dynamic_cast<Real_identifier*>(id);
463 int_identifier *i = dynamic_cast<int_identifier*> (id);
466 if (s) str = *s->access_content_String (false);
467 if (i) str = to_str (*i->access_content_int (false));
468 if (r) str = to_str (*r->access_content_Real (false));
470 THIS->parser_error (_("Wrong type for property value"));
474 Translator_group * tr = dynamic_cast<Translator_group*>($$);
475 tr->set_property (*$2, str);
477 | translator_spec_body NAME STRING semicolon {
481 | translator_spec_body CONSISTS STRING semicolon {
482 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
485 | translator_spec_body CONSISTSEND STRING semicolon {
486 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
489 | translator_spec_body ACCEPTS STRING semicolon {
490 dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
493 | translator_spec_body REMOVE STRING semicolon {
494 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
503 SCORE { THIS->remember_spot ();
505 /*cont*/ '{' score_body '}' {
507 $$->set_spot (THIS->pop_spot ());
508 if (!$$->def_p_arr_.size ())
509 $$->add_output (THIS->default_paper_p ());
518 $$ = $1->access_content_Score (true);
520 | score_body mudela_header {
525 $2->warning (_ ("More than one music block"));
528 | score_body output_def {
550 PAPER '{' paper_def_body '}' {
552 THIS-> lexer_p_->scope_l_arr_.pop ();
564 Paper_def *p = THIS->default_paper_p ();
565 THIS-> lexer_p_-> scope_l_arr_.push (p->scope_p_);
569 Paper_def *p = $1->access_content_Paper_def (true);
570 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
573 | paper_def_body int '=' FONT STRING { // ugh, what a syntax
574 Lookup * l = new Lookup;
577 $$->set_lookup ($2, l);
579 | paper_def_body assignment semicolon {
582 | paper_def_body translator_spec_block {
583 $$->assign_translator ($2);
585 | paper_def_body SHAPE '=' shape_array semicolon {
586 $$->shape_int_a_ = *$4;
589 | paper_def_body error {
596 real_expression { $$ = $1; }
619 | real_with_dimension
621 $$= *$1->access_content_Real (false);
623 | '-' real_expression %prec UNARY_MINUS {
626 | real_expression '*' real_expression {
629 | real_expression '/' real_expression {
632 | real_expression '+' real_expression {
635 | real_expression '-' real_expression {
638 | '(' real_expression ')' {
646 $$ = new Array<Interval>;
648 | shape_array real real {
649 $$->push(Interval($2, $2 + $3));
658 '{' midi_body '}' { $$ = $3; }
661 midi_body: /* empty */ {
662 $$ = THIS->default_midi_p ();
665 $$ = $1-> access_content_Midi_def (true);
667 | midi_body translator_spec_block {
668 $$-> assign_translator ($2);
670 | midi_body tempo_request semicolon {
671 $$->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
680 TEMPO steno_duration '=' unsigned {
684 $$-> metronome_i_ = $4;
688 Music_list: /* empty */ {
708 | ALTERNATIVE Music_sequence {
710 $2->set_spot (THIS->here_input ());
718 REPEAT STRING unsigned Music Alternative_music
720 Music_sequence* m = dynamic_cast <Music_sequence*> ($5);
721 if (m && $3 < m->length_i ())
722 $5->warning ("More alternatives than repeats. Junking excess alternatives.");
724 Repeated_music * r = new Repeated_music ($4, $3 >? 1, m);
726 r->fold_b_ = (*$2 == "fold");
727 r->semi_fold_b_ = (*$2 == "semi");
729 r->set_spot (THIS->here_input ());
734 Music_sequence: '{' Music_list '}' {
735 $$ = new Music_sequence ($2);
739 Sequential_music: '{' Music_list '}' {
740 $$ = new Sequential_music ($2);
744 Simultaneous_music: '<' Music_list '>' {
745 $$ = new Simultaneous_music ($2);
750 request_chord { $$ = $1; }
751 | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
754 | Simple_music '*' unsigned '/' unsigned {
756 $$ = new Time_scaled_music ($3, $5, $1);
758 | Simple_music '*' unsigned {
759 $$ = new Time_scaled_music ($3, 1, $1);
765 CONTEXT STRING Music {
766 Context_specced_music *csm = new Context_specced_music ($3);
768 csm->translator_type_str_ = *$2;
769 csm->translator_id_str_ = "";
775 $$ = new Grace_music ($2);
777 | CONTEXT STRING '=' STRING Music {
778 Context_specced_music *csm = new Context_specced_music ($5);
780 csm->translator_type_str_ = *$2;
781 csm->translator_id_str_ = *$4;
788 THIS->remember_spot ();
791 unsigned '/' unsigned Music
794 $$ = new Time_scaled_music ($3, $5, $6);
795 $$->set_spot (THIS->pop_spot ());
797 | Repeated_music { $$ = $1; }
798 | Simultaneous_music { $$ = $1; }
799 | Sequential_music { $$ = $1; }
800 | TRANSPOSE musical_pitch Music {
801 $$ = new Transposed_music ($3, *$2);
804 | TRANSPOSE steno_tonic_pitch Music {
805 $$ = new Transposed_music ($3, *$2);
809 { THIS->lexer_p_->push_note_state (); }
812 THIS->lexer_p_->pop_state ();
815 { THIS->lexer_p_->push_chord_state (); }
819 THIS->lexer_p_->pop_state ();
822 { THIS->lexer_p_->push_lyric_state (); }
826 THIS->lexer_p_->pop_state ();
828 | relative_music { $$ = $1; }
832 RELATIVE absolute_musical_pitch Music {
833 $$ = new Relative_octave_music ($3, *$2);
839 TRANSLATOR STRING '=' STRING {
840 Change_translator * t = new Change_translator;
841 t-> change_to_type_str_ = *$2;
842 t-> change_to_id_str_ = *$4;
845 $$->set_spot (THIS->here_input ());
852 PROPERTY STRING '.' STRING '=' scalar {
853 Translation_property *t = new Translation_property;
858 Context_specced_music *csm = new Context_specced_music (t);
860 $$->set_spot (THIS->here_input ());
862 csm-> translator_type_str_ = *$2;
871 string { $$ = new Scalar (*$1); delete $1; }
872 | int { $$ = new Scalar ($1); }
877 pre_requests simple_element post_requests {
878 Music_sequence *l = dynamic_cast<Music_sequence*>($2);
879 for (int i=0; i < $1->size(); i++)
880 l->add_music ($1->elem(i));
881 for (int i=0; i < $3->size(); i++)
882 l->add_music ($3->elem(i));
891 $$ = new Request_chord;
892 $$-> set_spot (THIS->here_input ());
893 $1-> set_spot (THIS->here_input ());
894 ((Simultaneous_music*)$$) ->add_music ($1);//ugh
900 | verbose_command_req semicolon { $$ = $1; }
908 $$ = new Barcheck_req;
914 Span_req*b= new Span_req;
915 b->span_dir_ = START;
916 b->span_type_str_ = "beam";
920 Span_req*b= new Span_req;
922 b->span_type_str_ = "beam";
926 $$ = new Breathing_sign_req;
933 $$ = new Bar_req (*$2);
937 $$ = new Mark_req (*$2);
941 $$ = new Mark_req (to_str ($2));
943 | TIME_T unsigned '/' unsigned {
944 Time_signature_change_req *m = new Time_signature_change_req;
950 Break_req * b = new Break_req;
952 b-> set_spot (THIS->here_input ());
955 | SKIP duration_length {
956 Skip_req * skip_p = new Skip_req;
957 skip_p->duration_ = *$2;
965 $$ = new Cadenza_req ($2);
967 | PARTIAL duration_length {
968 $$ = new Partial_measure_req ($2->length_mom ());
972 $$ = new Clef_change_req (*$2);
975 | KEY NOTENAME_PITCH optional_modality {
976 Key_change_req *key_p= new Key_change_req;
977 key_p->key_.pitch_arr_.push (*$2);
978 key_p->key_.ordinary_key_b_ = true;
979 key_p->key_.modality_i_ = $3;
983 | KEYSIGNATURE pitch_list {
984 Key_change_req *key_p= new Key_change_req;
985 key_p->key_.pitch_arr_ = *$2;
986 key_p->key_.ordinary_key_b_ = false;
995 $$ = new Link_array<Request>;
997 | post_requests post_request {
998 $2->set_spot (THIS->here_input ());
1010 request_that_take_dir:
1013 | script_abbreviation {
1014 Identifier*i = THIS->lexer_p_->lookup_identifier ("dash-" + *$1);
1015 Articulation_req *a = new Articulation_req;
1016 a->articulation_str_ = *i->access_content_String (false);
1023 script_dir request_that_take_dir {
1024 if (Script_req * gs = dynamic_cast<Script_req*> ($2))
1025 gs->dir_ = Direction ($1);
1027 $2->warning ("Can't specify direction for this request");
1033 REQUEST_IDENTIFIER {
1034 $$ = (Request*)$1->access_content_Request (true);
1035 $$->set_spot (THIS->here_input ());
1037 | TEXTSCRIPT STRING STRING {
1038 Text_script_req *ts_p = new Text_script_req;
1039 ts_p-> text_str_ = *$2;
1040 ts_p-> style_str_ = *$3;
1041 ts_p->set_spot (THIS->here_input ());
1046 | SPANREQUEST int STRING {
1047 Span_req * sp_p = new Span_req;
1048 sp_p-> span_dir_ = Direction($2);
1049 sp_p->span_type_str_ = *$3;
1050 sp_p->set_spot (THIS->here_input ());
1054 Tremolo_req* a = new Tremolo_req;
1055 a->set_spot (THIS->here_input ());
1060 Articulation_req * a = new Articulation_req;
1061 a->articulation_str_ = *$2;
1062 a->set_spot (THIS->here_input ());
1095 steno_musical_pitch:
1099 | NOTENAME_PITCH sup_quotes {
1101 $$->octave_i_ += $2;
1103 | NOTENAME_PITCH sub_quotes {
1105 $$->octave_i_ += - $2;
1113 | TONICNAME_PITCH sup_quotes {
1115 $$->octave_i_ += $2;
1117 | TONICNAME_PITCH sub_quotes {
1119 $$->octave_i_ += - $2;
1123 explicit_musical_pitch:
1124 MUSICAL_PITCH '{' int_list '}' {/* ugh */
1125 Array<int> &a = *$3;
1127 $$ = new Musical_pitch;
1128 $$->octave_i_ = a[0];
1129 $$->notename_i_ = a[1];
1130 $$->accidental_i_ = a[2];
1137 | explicit_musical_pitch
1141 DURATION '{' int_list '}' {
1143 Array<int> &a = *$3;
1146 $$-> durlog_i_ = a[0];
1147 $$-> dots_i_ = a[1];
1155 if (!THIS->lexer_p_->lyric_state_b ())
1156 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1157 $$ = new Extender_req;
1162 close_request_parens {
1164 dynamic_cast<Span_req*> ($$)->span_dir_ = START;
1167 close_request_parens:
1169 Span_req* s= new Span_req;
1171 s->span_type_str_ = "slur";
1174 Span_req*s =new Span_req;
1176 s->span_type_str_ = "crescendo";
1179 Span_req*s =new Span_req;
1181 s->span_type_str_ = "decrescendo";
1187 open_request_parens {
1189 dynamic_cast<Span_req*> ($$)->span_dir_ = STOP;
1193 open_request_parens:
1195 Span_req *s = new Span_req;
1196 s->span_type_str_ = "crescendo";
1200 Span_req* s= new Span_req;
1202 s->span_type_str_ = "slur";
1208 Text_script_req *t = new Text_script_req;
1212 $$->set_spot (THIS->here_input ());
1215 Text_script_req* t = new Text_script_req;
1217 t->text_str_ = to_str ($1);
1218 t->style_str_ = "finger";
1219 $$->set_spot (THIS->here_input ());
1223 script_abbreviation:
1225 $$ = new String ("hat");
1228 $$ = new String ("plus");
1231 $$ = new String ("dash");
1234 $$ = new String ("bar");
1237 $$ = new String ("larger");
1240 $$ = new String ("dot");
1248 | '-' { $$ = CENTER; }
1253 $$ = new Link_array<Request>;
1255 | pre_requests open_request {
1260 absolute_musical_pitch:
1261 steno_musical_pitch {
1270 | duration_length '*' unsigned {
1271 $$->plet_.iso_i_ *= $3;
1273 | duration_length '/' unsigned {
1274 $$->plet_.type_i_ *= $3;
1278 entered_notemode_duration:
1280 $$ = new Duration (THIS->default_duration_);
1285 THIS->set_last_duration ($1);
1290 entered_notemode_duration {
1298 if (!Duration::duration_type_b ($1))
1299 THIS->parser_error (_f ("not a duration: %d", $1));
1301 $$->durlog_i_ = Duration_convert::i2_type ($1);
1304 | DURATION_IDENTIFIER {
1305 $$ = $1->access_content_Duration (true);
1307 | steno_duration '.' {
1318 if (!Duration::duration_type_b ($2))
1319 THIS->parser_error (_f ("not a duration: %d", $2));
1321 THIS->parser_error (_ ("can't abbreviate"));
1328 musical_pitch exclamations questions notemode_duration {
1329 if (!THIS->lexer_p_->note_state_b ())
1330 THIS->parser_error (_ ("have to be in Note mode for notes"));
1333 Note_req *n = new Note_req;
1339 n->cautionary_b_ = $3 % 2;
1340 n->forceacc_b_ = $2 % 2 || n->cautionary_b_;
1342 Simultaneous_music*v = new Request_chord;
1343 v->set_spot (THIS->here_input ());
1344 n->set_spot (THIS->here_input ());
1350 | RESTNAME notemode_duration {
1351 $$ = THIS->get_rest_element (*$1, $2);
1352 delete $1; // delete notename
1354 | MEASURES notemode_duration {
1355 Multi_measure_rest_req* m = new Multi_measure_rest_req;
1359 Simultaneous_music*velt_p = new Request_chord;
1360 velt_p->set_spot (THIS->here_input ());
1361 velt_p->add_music (m);
1364 | REPETITIONS notemode_duration {
1365 Repetitions_req* r = new Repetitions_req;
1369 Simultaneous_music*velt_p = new Request_chord;
1370 velt_p->set_spot (THIS->here_input ());
1371 velt_p->add_music (r);
1374 | STRING notemode_duration {
1375 if (!THIS->lexer_p_->lyric_state_b ())
1376 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1377 $$ = THIS->get_word_element (*$1, $2);
1381 if (!THIS->lexer_p_->chord_state_b ())
1382 THIS->parser_error (_ ("have to be in Chord mode for chords"));
1385 | '@' notemode_chord '@' {
1386 if (!THIS->lexer_p_->note_state_b ())
1387 THIS->parser_error (_ ("have to be in Note mode for @chords"));
1393 steno_tonic_pitch notemode_duration chord_additions chord_subtractions chord_inversion {
1394 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1398 steno_musical_pitch notemode_duration chord_additions chord_subtractions notemode_chord_inversion {
1399 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1405 $$ = new Array<Musical_pitch>;
1414 $$ = new Array<Musical_pitch>;
1416 | chord_notes chord_addsub {
1424 $$ = new Array<Musical_pitch>;
1433 forevery : X : optional_X sucks. Devise a solution.
1438 chord_note optional_dot
1439 | CHORDMODIFIER_PITCH optional_dot
1446 | '/' steno_tonic_pitch {
1451 notemode_chord_inversion:
1455 | '/' steno_musical_pitch {
1462 $$ = new Musical_pitch;
1463 $$->notename_i_ = ($1 - 1) % 7;
1464 $$->octave_i_ = $1 > 7 ? 1 : 0;
1465 $$->accidental_i_ = 0;
1468 $$ = new Musical_pitch;
1469 $$->notename_i_ = ($1 - 1) % 7;
1470 $$->octave_i_ = $1 > 7 ? 1 : 0;
1471 $$->accidental_i_ = 1;
1474 $$ = new Musical_pitch;
1475 $$->notename_i_ = ($1 - 1) % 7;
1476 $$->octave_i_ = $1 > 7 ? 1 : 0;
1477 $$->accidental_i_ = -1;
1485 $$ = new Array<Musical_pitch>;
1487 | pitch_list musical_pitch {
1519 $$ = *$1->access_content_int (false);
1528 | STRING_IDENTIFIER {
1529 $$ = $1->access_content_String (true);
1531 | string '+' string {
1542 | dots '.' { $$ ++; }
1549 | exclamations '!' { $$ ++; }
1554 | questions '?' { $$ ++; }
1564 My_lily_parser::set_yydebug (bool b)
1571 My_lily_parser::do_yyparse ()
1573 yyparse ((void*)this);