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"
57 Mudela_version oldest_version ("1.0.20");
58 Mudela_version version ("1.0.20");
61 print_mudela_versions (ostream &os)
63 os << "Mudela versions: oldest " << oldest_version.str () << " current " << version.str () <<endl;
65 // needed for bison.simple's malloc() and free()
79 Assignment (Assignment const&s)
81 name_p_ = new String (*s.name_p_);
82 id_p_ = s.id_p_->clone ();
86 Paper_def* current_paper = 0;
92 #define YYERROR_VERBOSE 1
94 #define YYPARSE_PARAM my_lily_parser_l
95 #define YYLEX_PARAM my_lily_parser_l
96 #define THIS ((My_lily_parser *) my_lily_parser_l)
98 #define yyerror THIS->parser_error
99 #define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f("expecting %d arguments", s))
105 Array<Interval>* intarr;
106 Array<Musical_pitch> *pitch_arr;
107 Link_array<Request> *reqvec;
108 Array<String> * strvec;
110 Notename_table *chordmodifiertab;
114 Music_list *music_list;
119 Music_output_def * outputdef;
120 Musical_pitch * pitch;
123 Notename_table *notenametab;
139 yylex (YYSTYPE *s, void * v_l)
141 My_lily_parser *pars_l = (My_lily_parser*) v_l;
142 My_lily_lexer * lex_l = pars_l->lexer_p_;
144 lex_l->lexval_l = (void*) s;
145 return lex_l->yylex ();
153 /* tokens which are not keywords */
160 %token CHORDMODIFIERS
208 %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
210 %type <i> dots exclamations questions
212 %token <pitch> NOTENAME_PITCH
213 %token <pitch> TONICNAME_PITCH
214 %token <pitch> CHORDMODIFIER_PITCH
215 %token <id> DURATION_IDENTIFIER
216 %token <id> IDENTIFIER
217 %token <id> NOTENAME_TABLE_IDENTIFIER
218 %token <id> MUSIC_IDENTIFIER
219 %token <id> REQUEST_IDENTIFIER
220 %token <id> REAL_IDENTIFIER
221 %token <id> STRING_IDENTIFIER
222 %token <id> TRANS_IDENTIFIER
223 %token <id> INT_IDENTIFIER
224 %token <id> SCORE_IDENTIFIER
225 %token <id> MIDI_IDENTIFIER
226 %token <id> PAPER_IDENTIFIER
228 %token <string> DURATION RESTNAME
229 %token <string> STRING
233 %type <outputdef> output_def
234 %type <scope> mudela_header mudela_header_body
235 %type <request> open_request_parens close_request_parens open_request close_request
236 %type <request> request_with_dir request_that_take_dir verbose_request
237 %type <i> sub_quotes sup_quotes
238 %type <music> simple_element request_chord command_element Simple_music Composite_music
239 %type <music> Alternative_music Repeated_music
240 %type <i> abbrev_type
241 %type <i> int unsigned
243 %type <i> optional_modality
244 %type <id> identifier_init
245 %type <duration> steno_duration notemode_duration
246 %type <duration> entered_notemode_duration explicit_duration
247 %type <intvec> intastint_list int_list
248 %type <reqvec> pre_requests post_requests
249 %type <request> gen_text_def
250 %type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
251 %type <pitch> steno_tonic_pitch
253 %type <pitch_arr> pitch_list
254 %type <music> chord notemode_chord
255 %type <pitch_arr> chord_additions chord_subtractions chord_notes
256 %type <pitch> chord_addsub chord_note chord_inversion notemode_chord_inversion
257 %type <midi> midi_block midi_body
258 %type <duration> duration_length
260 %type <scalar> scalar
261 %type <music> Music relative_music Sequential_music Simultaneous_music Music_sequence
262 %type <music> property_def translator_change
263 %type <music_list> Music_list
264 %type <paper> paper_block paper_def_body
265 %type <real> real_expression real real_with_dimension
266 %type <request> abbrev_command_req
267 %type <request> post_request
268 %type <request> command_req verbose_command_req
269 %type <request> extender_req
270 %type <string> string
271 %type <score> score_block score_body
272 %type <intarr> shape_array
274 %type <string> script_abbreviation
275 %type <trans> translator_spec_block translator_spec_body
276 %type <tempo> tempo_request
277 %type <notenametab> notenames_body notenames_block chordmodifiers_block
289 | mudela toplevel_expression {}
290 | mudela assignment { }
292 | mudela check_version { }
297 THIS->lexer_p_->set_notename_table ($1);
299 | chordmodifiers_block {
300 THIS->lexer_p_->set_chordmodifier_table ($1);
303 delete header_global_p;
304 header_global_p = $1;
307 score_global_array.push ($1);
310 Identifier * id = new
311 Paper_def_identifier ($1, PAPER_IDENTIFIER);
312 THIS->lexer_p_->set_identifier ("$defaultpaper", id)
315 Identifier * id = new
316 Midi_def_identifier ($1, MIDI_IDENTIFIER);
317 THIS->lexer_p_->set_identifier ("$defaultmidi", id)
324 SCMFILE STRING semicolon {
325 read_lily_scm_file (*$2);
328 | SCM_T STRING semicolon {
329 gh_eval_str ($2->ch_l ());
334 VERSION STRING semicolon {
335 Mudela_version ver (*$2);
336 if (!((ver >= oldest_version) && (ver <= version))) {
337 if (THIS->ignore_version_b_) {
338 THIS->here_input ().error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
340 THIS->fatal_error_i_ = 1;
341 THIS->parser_error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
348 chordmodifiers_block:
349 CHORDMODIFIERS '{' notenames_body '}' { $$ = $3; }
354 NOTENAMES '{' notenames_body '}' { $$ = $3; }
361 $$ = new Notename_table;
363 | NOTENAME_TABLE_IDENTIFIER {
364 $$ = $1-> access_content_Notename_table(true);
366 | notenames_body STRING '=' explicit_musical_pitch {
377 THIS->lexer_p_-> scope_l_arr_.push ($$);
379 | mudela_header_body assignment semicolon {
385 HEADER '{' mudela_header_body '}' {
387 THIS->lexer_p_-> scope_l_arr_.pop ();
397 THIS->remember_spot ();
399 /* cont */ '=' identifier_init {
400 THIS->lexer_p_->set_identifier (*$1, $4);
401 $4->init_b_ = THIS->init_parse_b_;
402 $4->set_spot (THIS->pop_spot ());
410 $$ = new Score_identifier ($1, SCORE_IDENTIFIER);
413 | chordmodifiers_block {
414 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
417 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
420 $$ = new Paper_def_identifier ($1, PAPER_IDENTIFIER);
423 $$ = new Midi_def_identifier ($1, MIDI_IDENTIFIER);
426 | translator_spec_block {
427 $$ = new Translator_identifier ($1, TRANS_IDENTIFIER);
430 $$ = new Music_identifier ($1, MUSIC_IDENTIFIER);
434 $$ = new Request_identifier ($1, REQUEST_IDENTIFIER);
436 | explicit_duration {
437 $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
440 $$ = new Real_identifier (new Real ($1), REAL_IDENTIFIER);
443 $$ = new String_identifier ($1, STRING_IDENTIFIER);
446 $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
450 translator_spec_block:
451 TRANSLATOR '{' translator_spec_body '}'
457 translator_spec_body:
459 $$ = $1->access_content_Translator (true);
460 $$-> set_spot (THIS->here_input ());
462 | TYPE STRING semicolon {
463 Translator* t = get_translator_l (*$2);
464 Translator_group * tg = dynamic_cast<Translator_group*> (t);
467 THIS->parser_error (_("Need a translator group for a context"));
470 t->set_spot (THIS->here_input ());
474 | translator_spec_body STRING '=' identifier_init semicolon {
476 String_identifier *s = dynamic_cast<String_identifier*> (id);
477 Real_identifier *r= dynamic_cast<Real_identifier*>(id);
478 int_identifier *i = dynamic_cast<int_identifier*> (id);
481 if (s) str = *s->access_content_String (false);
482 if (i) str = to_str (*i->access_content_int (false));
483 if (r) str = to_str (*r->access_content_Real (false));
485 THIS->parser_error (_("Wrong type for property value"));
489 Translator_group * tr = dynamic_cast<Translator_group*>($$);
490 tr->set_property (*$2, str);
492 | translator_spec_body NAME STRING semicolon {
496 | translator_spec_body CONSISTS STRING semicolon {
497 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
500 | translator_spec_body CONSISTSEND STRING semicolon {
501 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
504 | translator_spec_body ACCEPTS STRING semicolon {
505 dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
508 | translator_spec_body REMOVE STRING semicolon {
509 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
518 SCORE { THIS->remember_spot ();
520 /*cont*/ '{' score_body '}' {
522 $$->set_spot (THIS->pop_spot ());
523 if (!$$->def_p_arr_.size ())
524 $$->add_output (THIS->default_paper_p ());
533 $$ = $1->access_content_Score (true);
535 | score_body mudela_header {
540 $2->warning (_ ("More than one music block"));
543 | score_body output_def {
561 /* */ { $$ =new Array<int>; }
562 | intastint_list int '*' int {
563 $$->push ($2); $$->push ($4);
565 | intastint_list int {
566 $$->push ($2); $$->push (1);
575 PAPER '{' paper_def_body '}' {
577 THIS-> lexer_p_->scope_l_arr_.pop ();
589 Paper_def *p = THIS->default_paper_p ();
590 THIS-> lexer_p_-> scope_l_arr_.push (p->scope_p_);
594 Paper_def *p = $1->access_content_Paper_def (true);
595 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
598 | paper_def_body int '=' FONT STRING { // ugh, what a syntax
599 Lookup * l = new Lookup;
602 $$->set_lookup ($2, l);
604 | paper_def_body assignment semicolon {
607 | paper_def_body translator_spec_block {
608 $$->assign_translator ($2);
610 | paper_def_body SHAPE '=' shape_array semicolon {
611 $$->shape_int_a_ = *$4;
614 | paper_def_body error {
621 real_expression { $$ = $1; }
644 | real_with_dimension
646 $$= *$1->access_content_Real (false);
648 | '-' real_expression %prec UNARY_MINUS {
651 | real_expression '*' real_expression {
654 | real_expression '/' real_expression {
657 | real_expression '+' real_expression {
660 | real_expression '-' real_expression {
663 | '(' real_expression ')' {
671 $$ = new Array<Interval>;
673 | shape_array real real {
674 $$->push(Interval($2, $2 + $3));
683 '{' midi_body '}' { $$ = $3; }
686 midi_body: /* empty */ {
687 $$ = THIS->default_midi_p ();
690 $$ = $1-> access_content_Midi_def (true);
692 | midi_body translator_spec_block {
693 $$-> assign_translator ($2);
695 | midi_body tempo_request semicolon {
696 $$->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
705 TEMPO steno_duration '=' unsigned {
709 $$-> metronome_i_ = $4;
713 Music_list: /* empty */ {
733 | ALTERNATIVE Music_sequence {
742 REPEAT STRING unsigned Music Alternative_music
744 Music_sequence* m = dynamic_cast <Music_sequence*> ($5);
746 New_repeated_music * r = new New_repeated_music ($4, $3 >? 1, m);
748 r->fold_b_ = (*$2 == "fold");
749 r->semi_fold_b_ = (*$2 == "semi");
754 Music_sequence: '{' Music_list '}' {
755 $$ = new Music_sequence ($2);
759 Sequential_music: '{' Music_list '}' {
760 $$ = new Sequential_music ($2);
764 Simultaneous_music: '<' Music_list '>' {
765 $$ = new Simultaneous_music ($2);
770 request_chord { $$ = $1; }
771 | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
774 | Simple_music '*' unsigned '/' unsigned {
776 $$ = new Time_scaled_music ($3, $5, $1);
778 | Simple_music '*' unsigned {
779 $$ = new Time_scaled_music ($3, 1, $1);
785 CONTEXT STRING Music {
786 Context_specced_music *csm = new Context_specced_music ($3);
788 csm->translator_type_str_ = *$2;
789 csm->translator_id_str_ = "";
794 | CONTEXT STRING '=' STRING Music {
795 Context_specced_music *csm = new Context_specced_music ($5);
797 csm->translator_type_str_ = *$2;
798 csm->translator_id_str_ = *$4;
805 THIS->remember_spot ();
808 unsigned '/' unsigned Music
811 $$ = new Time_scaled_music ($3, $5, $6);
812 $$->set_spot (THIS->pop_spot ());
814 | Repeated_music { $$ = $1; }
815 | Simultaneous_music { $$ = $1; }
816 | Sequential_music { $$ = $1; }
817 | TRANSPOSE musical_pitch Music {
818 $$ = new Transposed_music ($3, *$2);
821 | TRANSPOSE steno_tonic_pitch Music {
822 $$ = new Transposed_music ($3, *$2);
826 { THIS->lexer_p_->push_note_state (); }
829 THIS->lexer_p_->pop_state ();
832 { THIS->lexer_p_->push_chord_state (); }
836 THIS->lexer_p_->pop_state ();
839 { THIS->lexer_p_->push_lyric_state (); }
843 THIS->lexer_p_->pop_state ();
845 | relative_music { $$ = $1; }
849 RELATIVE absolute_musical_pitch Music {
850 $$ = new Relative_octave_music ($3, *$2);
856 TRANSLATOR STRING '=' STRING {
857 Change_translator * t = new Change_translator;
858 t-> change_to_type_str_ = *$2;
859 t-> change_to_id_str_ = *$4;
862 $$->set_spot (THIS->here_input ());
869 PROPERTY STRING '.' STRING '=' scalar {
870 Translation_property *t = new Translation_property;
875 Context_specced_music *csm = new Context_specced_music (t);
877 $$->set_spot (THIS->here_input ());
879 csm-> translator_type_str_ = *$2;
888 string { $$ = new Scalar (*$1); delete $1; }
889 | int { $$ = new Scalar ($1); }
894 pre_requests simple_element post_requests {
895 Music_sequence *l = dynamic_cast<Music_sequence*>($2);
896 for (int i=0; i < $1->size(); i++)
897 l->add_music ($1->elem(i));
898 for (int i=0; i < $3->size(); i++)
899 l->add_music ($3->elem(i));
908 $$ = new Request_chord;
909 $$-> set_spot (THIS->here_input ());
910 $1-> set_spot (THIS->here_input ());
911 ((Simultaneous_music*)$$) ->add_music ($1);//ugh
917 | verbose_command_req semicolon { $$ = $1; }
925 $$ = new Barcheck_req;
931 Span_req*b= new Span_req;
932 b->span_dir_ = START;
933 b->span_type_str_ = "beam";
937 Span_req*b= new Span_req;
939 b->span_type_str_ = "beam";
947 $$ = new Bar_req (*$2);
951 $$ = new Mark_req (*$2);
955 $$ = new Mark_req (to_str ($2));
957 | TIME_T unsigned '/' unsigned {
958 Time_signature_change_req *m = new Time_signature_change_req;
964 Break_req * b = new Break_req;
966 b-> set_spot (THIS->here_input ());
969 | SKIP duration_length {
970 Skip_req * skip_p = new Skip_req;
971 skip_p->duration_ = *$2;
979 $$ = new Cadenza_req ($2);
981 | PARTIAL duration_length {
982 $$ = new Partial_measure_req ($2->length_mom ());
986 $$ = new Clef_change_req (*$2);
989 | KEY NOTENAME_PITCH optional_modality {
990 Key_change_req *key_p= new Key_change_req;
991 key_p->pitch_arr_.push(*$2);
992 key_p->ordinary_key_b_ = true;
993 key_p->modality_i_ = $3;
997 | KEYSIGNATURE pitch_list {
998 Key_change_req *key_p= new Key_change_req;
999 key_p->pitch_arr_ = *$2;
1000 key_p->ordinary_key_b_ = false;
1004 | GROUPING intastint_list {
1005 Measure_grouping_req * mr_p = new Measure_grouping_req;
1006 for (int i=0; i < $2->size();)
1008 mr_p->elt_length_arr_.push (Moment (1, $2->elem(i++)));
1009 mr_p->beat_i_arr_.push ($2->elem(i++));
1020 $$ = new Link_array<Request>;
1022 | post_requests post_request {
1023 $2->set_spot (THIS->here_input ());
1035 request_that_take_dir:
1038 | script_abbreviation {
1039 Identifier*i = THIS->lexer_p_->lookup_identifier ("dash-" + *$1);
1040 Articulation_req *a = new Articulation_req;
1041 a->articulation_str_ = *i->access_content_String (false);
1048 script_dir request_that_take_dir {
1049 if (G_script_req * gs = dynamic_cast<G_script_req*> ($2))
1050 gs->dir_ = Direction ($1);
1052 $2->warning ("Can't specify direction for this request");
1058 REQUEST_IDENTIFIER {
1059 $$ = (Request*)$1->access_content_Request (true);
1060 $$->set_spot (THIS->here_input ());
1062 | TEXTSCRIPT STRING STRING {
1063 Text_script_req *ts_p = new Text_script_req;
1064 ts_p-> text_str_ = *$2;
1065 ts_p-> style_str_ = *$3;
1066 ts_p->set_spot (THIS->here_input ());
1071 | SPANREQUEST int STRING {
1072 Span_req * sp_p = new Span_req;
1073 sp_p-> span_dir_ = Direction($2);
1074 sp_p->span_type_str_ = *$3;
1075 sp_p->set_spot (THIS->here_input ());
1079 Tremolo_req* a = new Tremolo_req;
1080 a->set_spot (THIS->here_input ());
1085 Articulation_req * a = new Articulation_req;
1086 a->articulation_str_ = *$2;
1087 a->set_spot (THIS->here_input ());
1120 steno_musical_pitch:
1124 | NOTENAME_PITCH sup_quotes {
1126 $$->octave_i_ += $2;
1128 | NOTENAME_PITCH sub_quotes {
1130 $$->octave_i_ += - $2;
1138 | TONICNAME_PITCH sup_quotes {
1140 $$->octave_i_ += $2;
1142 | TONICNAME_PITCH sub_quotes {
1144 $$->octave_i_ += - $2;
1148 explicit_musical_pitch:
1149 MUSICAL_PITCH '{' int_list '}' {/* ugh */
1150 Array<int> &a = *$3;
1152 $$ = new Musical_pitch;
1153 $$->octave_i_ = a[0];
1154 $$->notename_i_ = a[1];
1155 $$->accidental_i_ = a[2];
1162 | explicit_musical_pitch
1166 DURATION '{' int_list '}' {
1168 Array<int> &a = *$3;
1171 $$-> durlog_i_ = a[0];
1172 $$-> dots_i_ = a[1];
1180 if (!THIS->lexer_p_->lyric_state_b ())
1181 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1182 $$ = new Extender_req;
1187 close_request_parens {
1189 dynamic_cast<Span_req*> ($$)->span_dir_ = START;
1192 close_request_parens:
1194 Span_req* s= new Span_req;
1196 s->span_type_str_ = "slur";
1199 Span_req*s =new Span_req;
1201 s->span_type_str_ = "crescendo";
1204 Span_req*s =new Span_req;
1206 s->span_type_str_ = "decrescendo";
1212 open_request_parens {
1214 dynamic_cast<Span_req*> ($$)->span_dir_ = STOP;
1218 open_request_parens:
1220 Span_req *s = new Span_req;
1221 s->span_type_str_ = "crescendo";
1225 Span_req* s= new Span_req;
1227 s->span_type_str_ = "slur";
1233 Text_script_req *t = new Text_script_req;
1237 $$->set_spot (THIS->here_input ());
1240 Text_script_req* t = new Text_script_req;
1242 t->text_str_ = to_str ($1);
1243 t->style_str_ = "finger";
1244 $$->set_spot (THIS->here_input ());
1248 script_abbreviation:
1250 $$ = new String ("hat");
1253 $$ = new String ("plus");
1256 $$ = new String ("dash");
1259 $$ = new String ("bar");
1262 $$ = new String ("larger");
1265 $$ = new String ("dot");
1273 | '-' { $$ = CENTER; }
1278 $$ = new Link_array<Request>;
1280 | pre_requests open_request {
1285 absolute_musical_pitch:
1286 steno_musical_pitch {
1295 | duration_length '*' unsigned {
1296 $$->plet_.iso_i_ *= $3;
1298 | duration_length '/' unsigned {
1299 $$->plet_.type_i_ *= $3;
1303 entered_notemode_duration:
1305 $$ = new Duration (THIS->default_duration_);
1310 THIS->set_last_duration ($1);
1315 entered_notemode_duration {
1323 if (!Duration::duration_type_b ($1))
1324 THIS->parser_error (_f ("not a duration: %d", $1));
1326 $$->durlog_i_ = Duration_convert::i2_type ($1);
1329 | DURATION_IDENTIFIER {
1330 $$ = $1->access_content_Duration (true);
1332 | steno_duration '.' {
1343 if (!Duration::duration_type_b ($2))
1344 THIS->parser_error (_f ("not a duration: %d", $2));
1346 THIS->parser_error (_ ("can't abbreviate"));
1353 musical_pitch exclamations questions notemode_duration {
1354 if (!THIS->lexer_p_->note_state_b ())
1355 THIS->parser_error (_ ("have to be in Note mode for notes"));
1358 Note_req *n = new Note_req;
1364 n->cautionary_b_ = $3 % 2;
1365 n->forceacc_b_ = $2 % 2 || n->cautionary_b_;
1367 Simultaneous_music*v = new Request_chord;
1368 v->set_spot (THIS->here_input ());
1369 n->set_spot (THIS->here_input ());
1375 | RESTNAME notemode_duration {
1376 $$ = THIS->get_rest_element (*$1, $2);
1377 delete $1; // delete notename
1379 | MEASURES notemode_duration {
1380 Multi_measure_rest_req* m = new Multi_measure_rest_req;
1384 Simultaneous_music*velt_p = new Request_chord;
1385 velt_p->set_spot (THIS->here_input ());
1386 velt_p->add_music (m);
1389 | STRING notemode_duration {
1390 if (!THIS->lexer_p_->lyric_state_b ())
1391 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1392 $$ = THIS->get_word_element (*$1, $2);
1396 if (!THIS->lexer_p_->chord_state_b ())
1397 THIS->parser_error (_ ("have to be in Chord mode for chords"));
1400 | '@' notemode_chord '@' {
1401 if (!THIS->lexer_p_->note_state_b ())
1402 THIS->parser_error (_ ("have to be in Note mode for @chords"));
1408 steno_tonic_pitch notemode_duration chord_additions chord_subtractions chord_inversion {
1409 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1413 steno_musical_pitch notemode_duration chord_additions chord_subtractions notemode_chord_inversion {
1414 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1420 $$ = new Array<Musical_pitch>;
1429 $$ = new Array<Musical_pitch>;
1431 | chord_notes chord_addsub {
1439 $$ = new Array<Musical_pitch>;
1448 forevery : X : optional_X sucks. Devise a solution.
1453 chord_note optional_dot
1454 | CHORDMODIFIER_PITCH optional_dot
1461 | '/' steno_tonic_pitch {
1466 notemode_chord_inversion:
1470 | '/' steno_musical_pitch {
1477 $$ = new Musical_pitch;
1478 $$->notename_i_ = ($1 - 1) % 7;
1479 $$->octave_i_ = $1 > 7 ? 1 : 0;
1480 $$->accidental_i_ = 0;
1483 $$ = new Musical_pitch;
1484 $$->notename_i_ = ($1 - 1) % 7;
1485 $$->octave_i_ = $1 > 7 ? 1 : 0;
1486 $$->accidental_i_ = 1;
1489 $$ = new Musical_pitch;
1490 $$->notename_i_ = ($1 - 1) % 7;
1491 $$->octave_i_ = $1 > 7 ? 1 : 0;
1492 $$->accidental_i_ = -1;
1500 $$ = new Array<Musical_pitch>;
1502 | pitch_list musical_pitch {
1534 $$ = *$1->access_content_int (false);
1543 | STRING_IDENTIFIER {
1544 $$ = $1->access_content_String (true);
1546 | string '+' string {
1557 | dots '.' { $$ ++; }
1564 | exclamations '!' { $$ ++; }
1569 | questions '?' { $$ ++; }
1579 My_lily_parser::set_yydebug (bool b)
1586 My_lily_parser::do_yyparse ()
1588 yyparse ((void*)this);