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"
19 #include "my-lily-lexer.hh"
20 #include "paper-def.hh"
21 #include "midi-def.hh"
23 #include "file-path.hh"
26 #include "parseconstruct.hh"
27 #include "dimensions.hh"
28 #include "identifier.hh"
29 #include "command-request.hh"
30 #include "musical-request.hh"
31 #include "my-lily-parser.hh"
33 #include "translator-group.hh"
35 #include "music-list.hh"
36 #include "duration-convert.hh"
37 #include "change-translator.hh"
38 #include "file-results.hh"
39 #include "mudela-version.hh"
41 #include "relative-music.hh"
42 #include "transposed-music.hh"
43 #include "compressed-music.hh"
44 #include "repeated-music.hh"
47 Mudela_version oldest_version ("1.0.14");
48 Mudela_version version ("1.0.15");
51 // needed for bison.simple's malloc() and free()
65 Assignment (Assignment const&s)
67 name_p_ = new String (*s.name_p_);
68 id_p_ = s.id_p_->clone ();
72 Paper_def* current_paper = 0;
78 #define YYERROR_VERBOSE 1
80 #define YYPARSE_PARAM my_lily_parser_l
81 #define YYLEX_PARAM my_lily_parser_l
82 #define THIS ((My_lily_parser *) my_lily_parser_l)
84 #define yyerror THIS->parser_error
85 #define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f("expecting %d arguments", s))
91 Array<Interval>* intarr;
92 Array<Musical_pitch> *pitch_arr;
93 Link_array<Request> *reqvec;
94 Array<String> * strvec;
96 Notename_table *chordmodifiertab;
100 Music_list *music_list;
105 Music_output_def * outputdef;
106 Musical_pitch * pitch;
110 Notename_table *notenametab;
115 Simultaneous_music *chord;
127 yylex (YYSTYPE *s, void * v_l)
129 My_lily_parser *pars_l = (My_lily_parser*) v_l;
130 My_lily_lexer * lex_l = pars_l->lexer_p_;
132 lex_l->lexval_l = (void*) s;
133 return lex_l->yylex ();
141 /* tokens which are not keywords */
148 %token CHORDMODIFIERS
194 %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
198 %token <pitch> NOTENAME_PITCH
199 %token <pitch> TONICNAME_PITCH
200 %token <pitch> CHORDMODIFIER_PITCH
201 %token <id> DURATION_IDENTIFIER
202 %token <id> IDENTIFIER
203 %token <id> NOTENAME_TABLE_IDENTIFIER
204 %token <id> MUSIC_IDENTIFIER
205 %token <id> REQUEST_IDENTIFIER
206 %token <id> REAL_IDENTIFIER
207 %token <id> STRING_IDENTIFIER
208 %token <id> TRANS_IDENTIFIER
209 %token <id> INT_IDENTIFIER
210 %token <id> SCORE_IDENTIFIER
211 %token <id> MIDI_IDENTIFIER
212 %token <id> PAPER_IDENTIFIER
214 %token <string> DURATION RESTNAME
215 %token <string> STRING
219 %type <outputdef> output_def
220 %type <scope> mudela_header mudela_header_body
221 %type <request> open_request_parens close_request_parens open_request close_request
222 %type <request> request_with_dir request_that_take_dir verbose_request
223 %type <i> sub_quotes sup_quotes
224 %type <music> simple_element request_chord command_element Simple_music Composite_music
225 %type <music> Alternative_music Repeated_music
226 %type <i> abbrev_type
227 %type <i> int unsigned
229 %type <i> optional_modality
230 %type <id> identifier_init
231 %type <duration> steno_duration notemode_duration
232 %type <duration> entered_notemode_duration explicit_duration
233 %type <intvec> intastint_list int_list
234 %type <reqvec> pre_requests post_requests
235 %type <request> gen_text_def
236 %type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
237 %type <pitch> steno_tonic_pitch
238 %type <notereq> steno_notepitch
239 %type <pitch_arr> pitch_list
240 %type <music> chord notemode_chord
241 %type <pitch_arr> chord_additions chord_subtractions chord_notes
242 %type <pitch> chord_addsub chord_note chord_inversion notemode_chord_inversion
243 %type <midi> midi_block midi_body
244 %type <duration> duration_length
246 %type <scalar> scalar
247 %type <music> Music relative_music Sequential_music Simultaneous_music
248 %type <music> property_def translator_change
249 %type <music_list> Music_list
250 %type <paper> paper_block paper_def_body
251 %type <real> real_expression real real_with_dimension
252 %type <request> abbrev_command_req
253 %type <request> post_request
254 %type <request> command_req verbose_command_req
255 %type <request> extender_req
256 %type <string> string
257 %type <score> score_block score_body
258 %type <intarr> shape_array
260 %type <string> script_abbreviation
261 %type <trans> translator_spec_block translator_spec_body
262 %type <tempo> tempo_request
263 %type <notenametab> notenames_body notenames_block chordmodifiers_block
275 | mudela toplevel_expression {}
276 | mudela assignment { }
278 | mudela check_version { }
283 THIS->lexer_p_->set_notename_table ($1);
285 | chordmodifiers_block {
286 THIS->lexer_p_->set_chordmodifier_table ($1);
289 delete header_global_p;
290 header_global_p = $1;
293 score_global_array.push ($1);
296 Identifier * id = new
297 Paper_def_identifier ($1, PAPER_IDENTIFIER);
298 THIS->lexer_p_->set_identifier ("$defaultpaper", id)
301 Identifier * id = new
302 Midi_def_identifier ($1, MIDI_IDENTIFIER);
303 THIS->lexer_p_->set_identifier ("$defaultmidi", id)
311 read_lily_scm_file (*$2);
315 gh_eval_str ($2->ch_l ());
321 Mudela_version ver (*$2);
322 if (!((ver >= oldest_version) && (ver <= version))) {
323 if (THIS->ignore_version_b_) {
324 THIS->here_input ().error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
326 THIS->fatal_error_i_ = 1;
327 THIS->parser_error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
334 chordmodifiers_block:
335 CHORDMODIFIERS '{' notenames_body '}' { $$ = $3; }
340 NOTENAMES '{' notenames_body '}' { $$ = $3; }
347 $$ = new Notename_table;
349 | NOTENAME_TABLE_IDENTIFIER {
350 $$ = $1-> access_content_Notename_table(true);
352 | notenames_body STRING '=' explicit_musical_pitch {
363 THIS->lexer_p_-> scope_l_arr_.push ($$);
365 | mudela_header_body assignment ';' {
371 HEADER '{' mudela_header_body '}' {
373 THIS->lexer_p_-> scope_l_arr_.pop ();
383 THIS->remember_spot ();
385 /* cont */ '=' identifier_init {
386 THIS->lexer_p_->set_identifier (*$1, $4);
387 $4->init_b_ = THIS->init_parse_b_;
388 $4->set_spot (THIS->pop_spot ());
396 $$ = new Score_identifier ($1, SCORE_IDENTIFIER);
399 | chordmodifiers_block {
400 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
403 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
406 $$ = new Paper_def_identifier ($1, PAPER_IDENTIFIER);
409 $$ = new Midi_def_identifier ($1, MIDI_IDENTIFIER);
412 | translator_spec_block {
413 $$ = new Translator_identifier ($1, TRANS_IDENTIFIER);
416 $$ = new Music_identifier ($1, MUSIC_IDENTIFIER);
420 $$ = new Request_identifier ($1, REQUEST_IDENTIFIER);
422 | explicit_duration {
423 $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
426 $$ = new Real_identifier (new Real ($1), REAL_IDENTIFIER);
429 $$ = new String_identifier ($1, STRING_IDENTIFIER);
432 $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
436 translator_spec_block:
437 TRANSLATOR '{' translator_spec_body '}'
443 translator_spec_body:
445 $$ = $1->access_content_Translator (true);
446 $$-> set_spot (THIS->here_input ());
449 Translator* t = get_translator_l (*$2);
450 Translator_group * tg = dynamic_cast<Translator_group*> (t);
453 THIS->parser_error (_("Need a translator group for a context"));
456 t->set_spot (THIS->here_input ());
460 | translator_spec_body STRING '=' identifier_init ';' {
462 String_identifier *s = dynamic_cast<String_identifier*> (id);
463 Real_identifier *r= dynamic_cast<Real_identifier*>(id);
464 int_identifier *i = dynamic_cast<int_identifier*> (id);
467 if (s) str = *s->access_content_String (false);
468 if (i) str = to_str (*i->access_content_int (false));
469 if (r) str = to_str (*r->access_content_Real (false));
471 THIS->parser_error (_("Wrong type for property value"));
475 Translator_group * tr = dynamic_cast<Translator_group*>($$);
476 tr->set_property (*$2, str);
478 | translator_spec_body NAME STRING ';' {
482 | translator_spec_body CONSISTS STRING ';' {
483 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
486 | translator_spec_body ACCEPTS STRING ';' {
487 dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
490 | translator_spec_body REMOVE STRING ';' {
491 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
500 SCORE { THIS->remember_spot ();
502 /*cont*/ '{' score_body '}' {
504 $$->set_spot (THIS->pop_spot ());
505 if (!$$->def_p_arr_.size ())
506 $$->add_output (THIS->default_paper_p ());
515 $$ = $1->access_content_Score (true);
517 | score_body mudela_header {
522 $2->warning (_ ("More than one music block"));
525 | score_body output_def {
543 /* */ { $$ =new Array<int>; }
544 | intastint_list int '*' int {
545 $$->push ($2); $$->push ($4);
547 | intastint_list int {
548 $$->push ($2); $$->push (1);
557 PAPER '{' paper_def_body '}' {
559 THIS-> lexer_p_->scope_l_arr_.pop ();
571 Paper_def *p = THIS->default_paper_p ();
572 THIS-> lexer_p_-> scope_l_arr_.push (p->scope_p_);
576 Paper_def *p = $1->access_content_Paper_def (true);
577 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
580 | paper_def_body int '=' FONT STRING { // ugh, what a syntax
581 Lookup * l = new Lookup;
584 $$->set_lookup ($2, l);
586 | paper_def_body assignment ';' {
589 | paper_def_body translator_spec_block {
590 $$->assign_translator ($2);
592 | paper_def_body SHAPE '=' shape_array ';' {
593 $$->shape_int_a_ = *$4;
596 | paper_def_body error {
603 real_expression { $$ = $1; }
626 | real_with_dimension
628 $$= *$1->access_content_Real (false);
630 | '-' real_expression %prec UNARY_MINUS {
633 | real_expression '*' real_expression {
636 | real_expression '/' real_expression {
639 | real_expression '+' real_expression {
642 | real_expression '-' real_expression {
645 | '(' real_expression ')' {
653 $$ = new Array<Interval>;
655 | shape_array real real {
656 $$->push(Interval($2, $2 + $3));
665 '{' midi_body '}' { $$ = $3; }
668 midi_body: /* empty */ {
669 $$ = THIS->default_midi_p ();
672 $$ = $1-> access_content_Midi_def (true);
674 | midi_body translator_spec_block {
675 $$-> assign_translator ($2);
677 | midi_body tempo_request ';' {
678 $$->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
687 TEMPO steno_duration '=' unsigned {
691 $$-> metronome_i_ = $4;
695 Music_list: /* empty */ {
712 ALTERNATIVE Simultaneous_music {
715 | ALTERNATIVE Sequential_music {
720 Repeated_music: REPEAT unsigned Music Alternative_music {
721 Music_sequence* m = dynamic_cast <Music_sequence*> ($4);
723 $$ = new Repeated_music ($3, $2 >? 1, m);
727 Sequential_music: '{' Music_list '}' {
728 $$ = new Sequential_music ($2);
732 Simultaneous_music: '<' Music_list '>' {
733 $$ = new Simultaneous_music ($2);
738 request_chord { $$ = $1; }
739 | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
742 | Simple_music '*' unsigned '/' unsigned {
744 $$ = new Compressed_music ($3, $5, $1);
746 | Simple_music '*' unsigned {
747 $$ = new Compressed_music ($3, 1, $1);
755 $$->translator_type_str_ = *$2;
758 | TYPE STRING '=' STRING Music {
760 $$->translator_type_str_ = *$2;
761 $$->translator_id_str_ = *$4;
766 THIS->remember_spot ();
769 unsigned '/' unsigned Music
772 $$ = new Compressed_music ($3, $5, $6);
773 $$->set_spot (THIS->pop_spot ());
775 | Repeated_music { $$ = $1; }
776 | Simultaneous_music { $$ = $1; }
777 | Sequential_music { $$ = $1; }
778 | TRANSPOSE musical_pitch Music {
779 $$ = new Transposed_music ($3, *$2);
782 | TRANSPOSE steno_tonic_pitch Music {
783 $$ = new Transposed_music ($3, *$2);
787 { THIS->lexer_p_->push_note_state (); }
790 THIS->lexer_p_->pop_state ();
793 { THIS->lexer_p_->push_chord_state (); }
797 THIS->lexer_p_->pop_state ();
800 { THIS->lexer_p_->push_lyric_state (); }
804 THIS->lexer_p_->pop_state ();
806 | relative_music { $$ = $1; }
810 RELATIVE absolute_musical_pitch Music {
811 $$ = new Relative_octave_music ($3, *$2);
817 TRANSLATOR STRING '=' STRING {
818 Change_translator * t = new Change_translator;
819 t-> change_to_type_str_ = *$2;
820 t-> change_to_id_str_ = *$4;
823 $$->set_spot (THIS->here_input ());
830 PROPERTY STRING '.' STRING '=' scalar {
831 Translation_property *t = new Translation_property;
832 t-> translator_type_str_ = *$2;
836 $$->set_spot (THIS->here_input ());
844 STRING { $$ = new Scalar (*$1); delete $1; }
845 | int { $$ = new Scalar ($1); }
850 pre_requests simple_element post_requests {
851 Music_sequence *l = dynamic_cast<Music_sequence*>($2);
852 for (int i=0; i < $1->size(); i++)
853 l->add_music ($1->elem(i));
854 for (int i=0; i < $3->size(); i++)
855 l->add_music ($3->elem(i));
864 $$ = new Request_chord;
865 $$-> set_spot (THIS->here_input ());
866 $1-> set_spot (THIS->here_input ());
867 ((Simultaneous_music*)$$) ->add_music ($1);//ugh
873 | verbose_command_req ';' { $$ = $1; }
881 $$ = new Barcheck_req;
887 Beam_req*b= new Beam_req;
888 b->spantype_ = START;
892 Beam_req*b= new Beam_req;
901 $$ = new Bar_req (*$2);
905 $$ = new Mark_req (*$2);
909 $$ = new Mark_req (to_str ($2));
911 | TIME_T unsigned '/' unsigned {
912 Time_signature_change_req *m = new Time_signature_change_req;
918 Break_req * b = new Break_req;
920 b-> set_spot (THIS->here_input ());
923 | SKIP duration_length {
924 Skip_req * skip_p = new Skip_req;
925 skip_p->duration_ = *$2;
933 $$ = new Cadenza_req ($2);
935 | PARTIAL duration_length {
936 $$ = new Partial_measure_req ($2->length_mom ());
940 $$ = new Clef_change_req (*$2);
943 | KEY NOTENAME_PITCH optional_modality {
944 Key_change_req *key_p= new Key_change_req;
945 key_p->pitch_arr_.push(*$2);
946 key_p->ordinary_key_b_ = true;
947 key_p->modality_i_ = $3;
951 | KEYSIGNATURE pitch_list {
952 Key_change_req *key_p= new Key_change_req;
953 key_p->pitch_arr_ = *$2;
954 key_p->ordinary_key_b_ = false;
958 | GROUPING intastint_list {
959 Measure_grouping_req * mr_p = new Measure_grouping_req;
960 for (int i=0; i < $2->size();)
962 mr_p->elt_length_arr_.push (Moment (1, $2->elem(i++)));
963 mr_p->beat_i_arr_.push ($2->elem(i++));
974 $$ = new Link_array<Request>;
976 | post_requests post_request {
977 $2->set_spot (THIS->here_input ());
989 request_that_take_dir:
992 | script_abbreviation {
993 Identifier*i = THIS->lexer_p_->lookup_identifier ("dash-" + *$1);
994 Articulation_req *a = new Articulation_req;
995 a->articulation_str_ = *i->access_content_String (false);
1002 script_dir request_that_take_dir {
1003 if (G_script_req * gs = dynamic_cast<G_script_req*> ($2))
1006 $2->warning ("Can't specify direction for this request");
1012 REQUEST_IDENTIFIER {
1013 $$ = (Request*)$1->access_content_Request (true);
1014 $$->set_spot (THIS->here_input ());
1016 | ABSDYNAMIC '{' STRING '}' {
1017 Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
1018 ad_p ->loudness_str_ = *$3;
1019 ad_p->set_spot (THIS->here_input ());
1023 | SPANDYNAMIC '{' int int '}' {
1024 Span_dynamic_req * sp_p = new Span_dynamic_req;
1025 sp_p-> dynamic_dir_ = Direction($3);
1026 sp_p->spantype_ = Direction($4);
1027 sp_p->set_spot (THIS->here_input ());
1031 Abbreviation_req* a = new Abbreviation_req;
1032 a->set_spot (THIS->here_input ());
1037 Articulation_req * a = new Articulation_req;
1038 a->articulation_str_ = *$2;
1039 a->set_spot (THIS->here_input ());
1072 steno_musical_pitch:
1076 | NOTENAME_PITCH sup_quotes {
1078 $$->octave_i_ += $2;
1080 | NOTENAME_PITCH sub_quotes {
1082 $$->octave_i_ += - $2;
1090 | TONICNAME_PITCH sup_quotes {
1092 $$->octave_i_ += $2;
1094 | TONICNAME_PITCH sub_quotes {
1096 $$->octave_i_ += - $2;
1100 explicit_musical_pitch:
1101 MUSICAL_PITCH '{' int_list '}' {/* ugh */
1102 Array<int> &a = *$3;
1104 $$ = new Musical_pitch;
1105 $$->octave_i_ = a[0];
1106 $$->notename_i_ = a[1];
1107 $$->accidental_i_ = a[2];
1114 | explicit_musical_pitch
1124 | steno_notepitch '!' {
1125 $$->forceacc_b_ = ! $$->forceacc_b_;
1127 | steno_notepitch '?' {
1128 $$->forceacc_b_ = ! $$->forceacc_b_;
1129 $$->cautionary_b_ = ! $$->cautionary_b_;
1135 DURATION '{' int_list '}' {
1137 Array<int> &a = *$3;
1140 $$-> durlog_i_ = a[0];
1141 $$-> dots_i_ = a[1];
1149 if (!THIS->lexer_p_->lyric_state_b ())
1150 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1151 $$ = new Extender_req;
1156 close_request_parens {
1158 dynamic_cast<Span_req*> ($$)->spantype_ = START;
1161 close_request_parens:
1166 Span_dynamic_req*s =new Span_dynamic_req;
1168 s->dynamic_dir_ = UP;
1171 Span_dynamic_req*s =new Span_dynamic_req;
1173 s->dynamic_dir_ = DOWN;
1179 open_request_parens {
1181 dynamic_cast<Span_req*> ($$)->spantype_ = STOP;
1185 open_request_parens:
1187 Span_dynamic_req *s = new Span_dynamic_req;
1188 s->dynamic_dir_ = SMALLER;
1199 Text_script_req *t = new Text_script_req;
1203 $$->set_spot (THIS->here_input ());
1206 Text_script_req* t = new Text_script_req;
1208 t->text_str_ = to_str ($1);
1209 t->style_str_ = "finger";
1210 $$->set_spot (THIS->here_input ());
1214 script_abbreviation:
1216 $$ = new String ("hat");
1219 $$ = new String ("plus");
1222 $$ = new String ("dash");
1225 $$ = new String ("bar");
1228 $$ = new String ("larger");
1231 $$ = new String ("dot");
1239 | '-' { $$ = CENTER; }
1244 $$ = new Link_array<Request>;
1246 | pre_requests open_request {
1251 absolute_musical_pitch:
1252 steno_musical_pitch {
1261 | duration_length '*' unsigned {
1262 $$->plet_.iso_i_ *= $3;
1264 | duration_length '/' unsigned {
1265 $$->plet_.type_i_ *= $3;
1271 | dots '.' { $$ ++; }
1274 entered_notemode_duration:
1276 $$ = new Duration (THIS->default_duration_);
1279 $$ = new Duration (THIS->default_duration_);
1283 THIS->set_last_duration ($1);
1288 entered_notemode_duration {
1296 if (!Duration::duration_type_b ($1))
1297 THIS->parser_error (_f ("not a duration: %d", $1));
1299 $$->durlog_i_ = Duration_convert::i2_type ($1);
1302 | DURATION_IDENTIFIER {
1303 $$ = $1->access_content_Duration (true);
1305 | steno_duration '.' {
1316 if (!Duration::duration_type_b ($2))
1317 THIS->parser_error (_f ("not a duration: %d", $2));
1319 THIS->parser_error (_ ("can't abbreviate"));
1327 steno_notepitch notemode_duration {
1328 if (!THIS->lexer_p_->note_state_b ())
1329 THIS->parser_error (_ ("have to be in Note mode for notes"));
1330 $1->duration_ = *$2;
1331 $$ = THIS->get_note_element ($1, $2);
1333 | RESTNAME notemode_duration {
1334 $$ = THIS->get_rest_element (*$1, $2);
1335 delete $1; // delete notename
1337 | MEASURES notemode_duration {
1338 Multi_measure_rest_req* m = new Multi_measure_rest_req;
1342 Simultaneous_music*velt_p = new Request_chord;
1343 velt_p->set_spot (THIS->here_input ());
1344 velt_p->add_music (m);
1347 | STRING notemode_duration {
1348 if (!THIS->lexer_p_->lyric_state_b ())
1349 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1350 $$ = THIS->get_word_element (*$1, $2);
1354 if (!THIS->lexer_p_->chord_state_b ())
1355 THIS->parser_error (_ ("have to be in Chord mode for chords"));
1358 | '@' notemode_chord '@' {
1359 if (!THIS->lexer_p_->note_state_b ())
1360 THIS->parser_error (_ ("have to be in Note mode for @chords"));
1366 steno_tonic_pitch notemode_duration chord_additions chord_subtractions chord_inversion {
1367 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1371 steno_musical_pitch notemode_duration chord_additions chord_subtractions notemode_chord_inversion {
1372 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1378 $$ = new Array<Musical_pitch>;
1387 $$ = new Array<Musical_pitch>;
1389 | chord_notes chord_addsub {
1397 $$ = new Array<Musical_pitch>;
1406 forevery : X : optional_X sucks. Devise a solution.
1411 chord_note optional_dot
1412 | CHORDMODIFIER_PITCH optional_dot
1419 | '/' steno_tonic_pitch {
1424 notemode_chord_inversion:
1428 | '/' steno_musical_pitch {
1435 $$ = new Musical_pitch;
1436 $$->notename_i_ = ($1 - 1) % 7;
1437 $$->octave_i_ = $1 > 7 ? 1 : 0;
1438 $$->accidental_i_ = 0;
1441 $$ = new Musical_pitch;
1442 $$->notename_i_ = ($1 - 1) % 7;
1443 $$->octave_i_ = $1 > 7 ? 1 : 0;
1444 $$->accidental_i_ = 1;
1447 $$ = new Musical_pitch;
1448 $$->notename_i_ = ($1 - 1) % 7;
1449 $$->octave_i_ = $1 > 7 ? 1 : 0;
1450 $$->accidental_i_ = -1;
1458 $$ = new Array<Musical_pitch>;
1460 | pitch_list musical_pitch {
1492 $$ = *$1->access_content_int (false);
1501 | STRING_IDENTIFIER {
1502 $$ = $1->access_content_String (true);
1504 | string '+' string {
1518 My_lily_parser::set_yydebug (bool b)
1525 My_lily_parser::do_yyparse ()
1527 yyparse ((void*)this);