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;
109 Notename_table *notenametab;
125 yylex (YYSTYPE *s, void * v_l)
127 My_lily_parser *pars_l = (My_lily_parser*) v_l;
128 My_lily_lexer * lex_l = pars_l->lexer_p_;
130 lex_l->lexval_l = (void*) s;
131 return lex_l->yylex ();
139 /* tokens which are not keywords */
146 %token CHORDMODIFIERS
192 %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
194 %type <i> dots exclamations questions
196 %token <pitch> NOTENAME_PITCH
197 %token <pitch> TONICNAME_PITCH
198 %token <pitch> CHORDMODIFIER_PITCH
199 %token <id> DURATION_IDENTIFIER
200 %token <id> IDENTIFIER
201 %token <id> NOTENAME_TABLE_IDENTIFIER
202 %token <id> MUSIC_IDENTIFIER
203 %token <id> REQUEST_IDENTIFIER
204 %token <id> REAL_IDENTIFIER
205 %token <id> STRING_IDENTIFIER
206 %token <id> TRANS_IDENTIFIER
207 %token <id> INT_IDENTIFIER
208 %token <id> SCORE_IDENTIFIER
209 %token <id> MIDI_IDENTIFIER
210 %token <id> PAPER_IDENTIFIER
212 %token <string> DURATION RESTNAME
213 %token <string> STRING
217 %type <outputdef> output_def
218 %type <scope> mudela_header mudela_header_body
219 %type <request> open_request_parens close_request_parens open_request close_request
220 %type <request> request_with_dir request_that_take_dir verbose_request
221 %type <i> sub_quotes sup_quotes
222 %type <music> simple_element request_chord command_element Simple_music Composite_music
223 %type <music> Alternative_music Repeated_music
224 %type <i> abbrev_type
225 %type <i> int unsigned
227 %type <i> optional_modality
228 %type <id> identifier_init
229 %type <duration> steno_duration notemode_duration
230 %type <duration> entered_notemode_duration explicit_duration
231 %type <intvec> intastint_list int_list
232 %type <reqvec> pre_requests post_requests
233 %type <request> gen_text_def
234 %type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
235 %type <pitch> steno_tonic_pitch
237 %type <pitch_arr> pitch_list
238 %type <music> chord notemode_chord
239 %type <pitch_arr> chord_additions chord_subtractions chord_notes
240 %type <pitch> chord_addsub chord_note chord_inversion notemode_chord_inversion
241 %type <midi> midi_block midi_body
242 %type <duration> duration_length
244 %type <scalar> scalar
245 %type <music> Music relative_music Sequential_music Simultaneous_music
246 %type <music> property_def translator_change
247 %type <music_list> Music_list
248 %type <paper> paper_block paper_def_body
249 %type <real> real_expression real real_with_dimension
250 %type <request> abbrev_command_req
251 %type <request> post_request
252 %type <request> command_req verbose_command_req
253 %type <request> extender_req
254 %type <string> string
255 %type <score> score_block score_body
256 %type <intarr> shape_array
258 %type <string> script_abbreviation
259 %type <trans> translator_spec_block translator_spec_body
260 %type <tempo> tempo_request
261 %type <notenametab> notenames_body notenames_block chordmodifiers_block
273 | mudela toplevel_expression {}
274 | mudela assignment { }
276 | mudela check_version { }
281 THIS->lexer_p_->set_notename_table ($1);
283 | chordmodifiers_block {
284 THIS->lexer_p_->set_chordmodifier_table ($1);
287 delete header_global_p;
288 header_global_p = $1;
291 score_global_array.push ($1);
294 Identifier * id = new
295 Paper_def_identifier ($1, PAPER_IDENTIFIER);
296 THIS->lexer_p_->set_identifier ("$defaultpaper", id)
299 Identifier * id = new
300 Midi_def_identifier ($1, MIDI_IDENTIFIER);
301 THIS->lexer_p_->set_identifier ("$defaultmidi", id)
308 SCMFILE STRING semicolon {
309 read_lily_scm_file (*$2);
312 | SCM_T STRING semicolon {
313 gh_eval_str ($2->ch_l ());
318 VERSION STRING semicolon {
319 Mudela_version ver (*$2);
320 if (!((ver >= oldest_version) && (ver <= version))) {
321 if (THIS->ignore_version_b_) {
322 THIS->here_input ().error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
324 THIS->fatal_error_i_ = 1;
325 THIS->parser_error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
332 chordmodifiers_block:
333 CHORDMODIFIERS '{' notenames_body '}' { $$ = $3; }
338 NOTENAMES '{' notenames_body '}' { $$ = $3; }
345 $$ = new Notename_table;
347 | NOTENAME_TABLE_IDENTIFIER {
348 $$ = $1-> access_content_Notename_table(true);
350 | notenames_body STRING '=' explicit_musical_pitch {
361 THIS->lexer_p_-> scope_l_arr_.push ($$);
363 | mudela_header_body assignment semicolon {
369 HEADER '{' mudela_header_body '}' {
371 THIS->lexer_p_-> scope_l_arr_.pop ();
381 THIS->remember_spot ();
383 /* cont */ '=' identifier_init {
384 THIS->lexer_p_->set_identifier (*$1, $4);
385 $4->init_b_ = THIS->init_parse_b_;
386 $4->set_spot (THIS->pop_spot ());
394 $$ = new Score_identifier ($1, SCORE_IDENTIFIER);
397 | chordmodifiers_block {
398 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
401 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
404 $$ = new Paper_def_identifier ($1, PAPER_IDENTIFIER);
407 $$ = new Midi_def_identifier ($1, MIDI_IDENTIFIER);
410 | translator_spec_block {
411 $$ = new Translator_identifier ($1, TRANS_IDENTIFIER);
414 $$ = new Music_identifier ($1, MUSIC_IDENTIFIER);
418 $$ = new Request_identifier ($1, REQUEST_IDENTIFIER);
420 | explicit_duration {
421 $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
424 $$ = new Real_identifier (new Real ($1), REAL_IDENTIFIER);
427 $$ = new String_identifier ($1, STRING_IDENTIFIER);
430 $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
434 translator_spec_block:
435 TRANSLATOR '{' translator_spec_body '}'
441 translator_spec_body:
443 $$ = $1->access_content_Translator (true);
444 $$-> set_spot (THIS->here_input ());
446 | TYPE STRING semicolon {
447 Translator* t = get_translator_l (*$2);
448 Translator_group * tg = dynamic_cast<Translator_group*> (t);
451 THIS->parser_error (_("Need a translator group for a context"));
454 t->set_spot (THIS->here_input ());
458 | translator_spec_body STRING '=' identifier_init semicolon {
460 String_identifier *s = dynamic_cast<String_identifier*> (id);
461 Real_identifier *r= dynamic_cast<Real_identifier*>(id);
462 int_identifier *i = dynamic_cast<int_identifier*> (id);
465 if (s) str = *s->access_content_String (false);
466 if (i) str = to_str (*i->access_content_int (false));
467 if (r) str = to_str (*r->access_content_Real (false));
469 THIS->parser_error (_("Wrong type for property value"));
473 Translator_group * tr = dynamic_cast<Translator_group*>($$);
474 tr->set_property (*$2, str);
476 | translator_spec_body NAME STRING semicolon {
480 | translator_spec_body CONSISTS STRING semicolon {
481 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
484 | translator_spec_body ACCEPTS STRING semicolon {
485 dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
488 | translator_spec_body REMOVE STRING semicolon {
489 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
498 SCORE { THIS->remember_spot ();
500 /*cont*/ '{' score_body '}' {
502 $$->set_spot (THIS->pop_spot ());
503 if (!$$->def_p_arr_.size ())
504 $$->add_output (THIS->default_paper_p ());
513 $$ = $1->access_content_Score (true);
515 | score_body mudela_header {
520 $2->warning (_ ("More than one music block"));
523 | score_body output_def {
541 /* */ { $$ =new Array<int>; }
542 | intastint_list int '*' int {
543 $$->push ($2); $$->push ($4);
545 | intastint_list int {
546 $$->push ($2); $$->push (1);
555 PAPER '{' paper_def_body '}' {
557 THIS-> lexer_p_->scope_l_arr_.pop ();
569 Paper_def *p = THIS->default_paper_p ();
570 THIS-> lexer_p_-> scope_l_arr_.push (p->scope_p_);
574 Paper_def *p = $1->access_content_Paper_def (true);
575 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
578 | paper_def_body int '=' FONT STRING { // ugh, what a syntax
579 Lookup * l = new Lookup;
582 $$->set_lookup ($2, l);
584 | paper_def_body assignment semicolon {
587 | paper_def_body translator_spec_block {
588 $$->assign_translator ($2);
590 | paper_def_body SHAPE '=' shape_array semicolon {
591 $$->shape_int_a_ = *$4;
594 | paper_def_body error {
601 real_expression { $$ = $1; }
624 | real_with_dimension
626 $$= *$1->access_content_Real (false);
628 | '-' real_expression %prec UNARY_MINUS {
631 | real_expression '*' real_expression {
634 | real_expression '/' real_expression {
637 | real_expression '+' real_expression {
640 | real_expression '-' real_expression {
643 | '(' real_expression ')' {
651 $$ = new Array<Interval>;
653 | shape_array real real {
654 $$->push(Interval($2, $2 + $3));
663 '{' midi_body '}' { $$ = $3; }
666 midi_body: /* empty */ {
667 $$ = THIS->default_midi_p ();
670 $$ = $1-> access_content_Midi_def (true);
672 | midi_body translator_spec_block {
673 $$-> assign_translator ($2);
675 | midi_body tempo_request semicolon {
676 $$->set_tempo ($2->dur_.length_mom (), $2->metronome_i_);
685 TEMPO steno_duration '=' unsigned {
689 $$-> metronome_i_ = $4;
693 Music_list: /* empty */ {
710 ALTERNATIVE Simultaneous_music {
713 | ALTERNATIVE Sequential_music {
718 Repeated_music: REPEAT unsigned Music Alternative_music {
719 Music_sequence* m = dynamic_cast <Music_sequence*> ($4);
721 $$ = new Repeated_music ($3, $2 >? 1, m);
725 Sequential_music: '{' Music_list '}' {
726 $$ = new Sequential_music ($2);
730 Simultaneous_music: '<' Music_list '>' {
731 $$ = new Simultaneous_music ($2);
736 request_chord { $$ = $1; }
737 | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
740 | Simple_music '*' unsigned '/' unsigned {
742 $$ = new Compressed_music ($3, $5, $1);
744 | Simple_music '*' unsigned {
745 $$ = new Compressed_music ($3, 1, $1);
753 $$->translator_type_str_ = *$2;
756 | TYPE STRING '=' STRING Music {
758 $$->translator_type_str_ = *$2;
759 $$->translator_id_str_ = *$4;
764 THIS->remember_spot ();
767 unsigned '/' unsigned Music
770 $$ = new Compressed_music ($3, $5, $6);
771 $$->set_spot (THIS->pop_spot ());
773 | Repeated_music { $$ = $1; }
774 | Simultaneous_music { $$ = $1; }
775 | Sequential_music { $$ = $1; }
776 | TRANSPOSE musical_pitch Music {
777 $$ = new Transposed_music ($3, *$2);
780 | TRANSPOSE steno_tonic_pitch Music {
781 $$ = new Transposed_music ($3, *$2);
785 { THIS->lexer_p_->push_note_state (); }
788 THIS->lexer_p_->pop_state ();
791 { THIS->lexer_p_->push_chord_state (); }
795 THIS->lexer_p_->pop_state ();
798 { THIS->lexer_p_->push_lyric_state (); }
802 THIS->lexer_p_->pop_state ();
804 | relative_music { $$ = $1; }
808 RELATIVE absolute_musical_pitch Music {
809 $$ = new Relative_octave_music ($3, *$2);
815 TRANSLATOR STRING '=' STRING {
816 Change_translator * t = new Change_translator;
817 t-> change_to_type_str_ = *$2;
818 t-> change_to_id_str_ = *$4;
821 $$->set_spot (THIS->here_input ());
828 PROPERTY STRING '.' STRING '=' scalar {
829 Translation_property *t = new Translation_property;
830 t-> translator_type_str_ = *$2;
834 $$->set_spot (THIS->here_input ());
842 STRING { $$ = new Scalar (*$1); delete $1; }
843 | int { $$ = new Scalar ($1); }
848 pre_requests simple_element post_requests {
849 Music_sequence *l = dynamic_cast<Music_sequence*>($2);
850 for (int i=0; i < $1->size(); i++)
851 l->add_music ($1->elem(i));
852 for (int i=0; i < $3->size(); i++)
853 l->add_music ($3->elem(i));
862 $$ = new Request_chord;
863 $$-> set_spot (THIS->here_input ());
864 $1-> set_spot (THIS->here_input ());
865 ((Simultaneous_music*)$$) ->add_music ($1);//ugh
871 | verbose_command_req semicolon { $$ = $1; }
879 $$ = new Barcheck_req;
885 Beam_req*b= new Beam_req;
886 b->spantype_ = START;
890 Beam_req*b= new Beam_req;
899 $$ = new Bar_req (*$2);
903 $$ = new Mark_req (*$2);
907 $$ = new Mark_req (to_str ($2));
909 | TIME_T unsigned '/' unsigned {
910 Time_signature_change_req *m = new Time_signature_change_req;
916 Break_req * b = new Break_req;
918 b-> set_spot (THIS->here_input ());
921 | SKIP duration_length {
922 Skip_req * skip_p = new Skip_req;
923 skip_p->duration_ = *$2;
931 $$ = new Cadenza_req ($2);
933 | PARTIAL duration_length {
934 $$ = new Partial_measure_req ($2->length_mom ());
938 $$ = new Clef_change_req (*$2);
941 | KEY NOTENAME_PITCH optional_modality {
942 Key_change_req *key_p= new Key_change_req;
943 key_p->pitch_arr_.push(*$2);
944 key_p->ordinary_key_b_ = true;
945 key_p->modality_i_ = $3;
949 | KEYSIGNATURE pitch_list {
950 Key_change_req *key_p= new Key_change_req;
951 key_p->pitch_arr_ = *$2;
952 key_p->ordinary_key_b_ = false;
956 | GROUPING intastint_list {
957 Measure_grouping_req * mr_p = new Measure_grouping_req;
958 for (int i=0; i < $2->size();)
960 mr_p->elt_length_arr_.push (Moment (1, $2->elem(i++)));
961 mr_p->beat_i_arr_.push ($2->elem(i++));
972 $$ = new Link_array<Request>;
974 | post_requests post_request {
975 $2->set_spot (THIS->here_input ());
987 request_that_take_dir:
990 | script_abbreviation {
991 Identifier*i = THIS->lexer_p_->lookup_identifier ("dash-" + *$1);
992 Articulation_req *a = new Articulation_req;
993 a->articulation_str_ = *i->access_content_String (false);
1000 script_dir request_that_take_dir {
1001 if (G_script_req * gs = dynamic_cast<G_script_req*> ($2))
1004 $2->warning ("Can't specify direction for this request");
1010 REQUEST_IDENTIFIER {
1011 $$ = (Request*)$1->access_content_Request (true);
1012 $$->set_spot (THIS->here_input ());
1014 | ABSDYNAMIC '{' STRING '}' {
1015 Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
1016 ad_p ->loudness_str_ = *$3;
1017 ad_p->set_spot (THIS->here_input ());
1021 | SPANDYNAMIC '{' int int '}' {
1022 Span_dynamic_req * sp_p = new Span_dynamic_req;
1023 sp_p-> dynamic_dir_ = Direction($3);
1024 sp_p->spantype_ = Direction($4);
1025 sp_p->set_spot (THIS->here_input ());
1029 Abbreviation_req* a = new Abbreviation_req;
1030 a->set_spot (THIS->here_input ());
1035 Articulation_req * a = new Articulation_req;
1036 a->articulation_str_ = *$2;
1037 a->set_spot (THIS->here_input ());
1070 steno_musical_pitch:
1074 | NOTENAME_PITCH sup_quotes {
1076 $$->octave_i_ += $2;
1078 | NOTENAME_PITCH sub_quotes {
1080 $$->octave_i_ += - $2;
1088 | TONICNAME_PITCH sup_quotes {
1090 $$->octave_i_ += $2;
1092 | TONICNAME_PITCH sub_quotes {
1094 $$->octave_i_ += - $2;
1098 explicit_musical_pitch:
1099 MUSICAL_PITCH '{' int_list '}' {/* ugh */
1100 Array<int> &a = *$3;
1102 $$ = new Musical_pitch;
1103 $$->octave_i_ = a[0];
1104 $$->notename_i_ = a[1];
1105 $$->accidental_i_ = a[2];
1112 | explicit_musical_pitch
1116 DURATION '{' int_list '}' {
1118 Array<int> &a = *$3;
1121 $$-> durlog_i_ = a[0];
1122 $$-> dots_i_ = a[1];
1130 if (!THIS->lexer_p_->lyric_state_b ())
1131 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1132 $$ = new Extender_req;
1137 close_request_parens {
1139 dynamic_cast<Span_req*> ($$)->spantype_ = START;
1142 close_request_parens:
1147 Span_dynamic_req*s =new Span_dynamic_req;
1149 s->dynamic_dir_ = UP;
1152 Span_dynamic_req*s =new Span_dynamic_req;
1154 s->dynamic_dir_ = DOWN;
1160 open_request_parens {
1162 dynamic_cast<Span_req*> ($$)->spantype_ = STOP;
1166 open_request_parens:
1168 Span_dynamic_req *s = new Span_dynamic_req;
1169 s->dynamic_dir_ = SMALLER;
1180 Text_script_req *t = new Text_script_req;
1184 $$->set_spot (THIS->here_input ());
1187 Text_script_req* t = new Text_script_req;
1189 t->text_str_ = to_str ($1);
1190 t->style_str_ = "finger";
1191 $$->set_spot (THIS->here_input ());
1195 script_abbreviation:
1197 $$ = new String ("hat");
1200 $$ = new String ("plus");
1203 $$ = new String ("dash");
1206 $$ = new String ("bar");
1209 $$ = new String ("larger");
1212 $$ = new String ("dot");
1220 | '-' { $$ = CENTER; }
1225 $$ = new Link_array<Request>;
1227 | pre_requests open_request {
1232 absolute_musical_pitch:
1233 steno_musical_pitch {
1242 | duration_length '*' unsigned {
1243 $$->plet_.iso_i_ *= $3;
1245 | duration_length '/' unsigned {
1246 $$->plet_.type_i_ *= $3;
1250 entered_notemode_duration:
1252 $$ = new Duration (THIS->default_duration_);
1257 THIS->set_last_duration ($1);
1262 entered_notemode_duration {
1270 if (!Duration::duration_type_b ($1))
1271 THIS->parser_error (_f ("not a duration: %d", $1));
1273 $$->durlog_i_ = Duration_convert::i2_type ($1);
1276 | DURATION_IDENTIFIER {
1277 $$ = $1->access_content_Duration (true);
1279 | steno_duration '.' {
1290 if (!Duration::duration_type_b ($2))
1291 THIS->parser_error (_f ("not a duration: %d", $2));
1293 THIS->parser_error (_ ("can't abbreviate"));
1300 musical_pitch exclamations questions notemode_duration {
1301 if (!THIS->lexer_p_->note_state_b ())
1302 THIS->parser_error (_ ("have to be in Note mode for notes"));
1305 Note_req *n = new Note_req;
1311 n->forceacc_b_ = $2 % 2;
1312 n->cautionary_b_ = $3 % 2;
1314 Simultaneous_music*v = new Request_chord;
1315 v->set_spot (THIS->here_input ());
1316 n->set_spot (THIS->here_input ());
1322 | RESTNAME notemode_duration {
1323 $$ = THIS->get_rest_element (*$1, $2);
1324 delete $1; // delete notename
1326 | MEASURES notemode_duration {
1327 Multi_measure_rest_req* m = new Multi_measure_rest_req;
1331 Simultaneous_music*velt_p = new Request_chord;
1332 velt_p->set_spot (THIS->here_input ());
1333 velt_p->add_music (m);
1336 | STRING notemode_duration {
1337 if (!THIS->lexer_p_->lyric_state_b ())
1338 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1339 $$ = THIS->get_word_element (*$1, $2);
1343 if (!THIS->lexer_p_->chord_state_b ())
1344 THIS->parser_error (_ ("have to be in Chord mode for chords"));
1347 | '@' notemode_chord '@' {
1348 if (!THIS->lexer_p_->note_state_b ())
1349 THIS->parser_error (_ ("have to be in Note mode for @chords"));
1355 steno_tonic_pitch notemode_duration chord_additions chord_subtractions chord_inversion {
1356 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1360 steno_musical_pitch notemode_duration chord_additions chord_subtractions notemode_chord_inversion {
1361 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1367 $$ = new Array<Musical_pitch>;
1376 $$ = new Array<Musical_pitch>;
1378 | chord_notes chord_addsub {
1386 $$ = new Array<Musical_pitch>;
1395 forevery : X : optional_X sucks. Devise a solution.
1400 chord_note optional_dot
1401 | CHORDMODIFIER_PITCH optional_dot
1408 | '/' steno_tonic_pitch {
1413 notemode_chord_inversion:
1417 | '/' steno_musical_pitch {
1424 $$ = new Musical_pitch;
1425 $$->notename_i_ = ($1 - 1) % 7;
1426 $$->octave_i_ = $1 > 7 ? 1 : 0;
1427 $$->accidental_i_ = 0;
1430 $$ = new Musical_pitch;
1431 $$->notename_i_ = ($1 - 1) % 7;
1432 $$->octave_i_ = $1 > 7 ? 1 : 0;
1433 $$->accidental_i_ = 1;
1436 $$ = new Musical_pitch;
1437 $$->notename_i_ = ($1 - 1) % 7;
1438 $$->octave_i_ = $1 > 7 ? 1 : 0;
1439 $$->accidental_i_ = -1;
1447 $$ = new Array<Musical_pitch>;
1449 | pitch_list musical_pitch {
1481 $$ = *$1->access_content_int (false);
1490 | STRING_IDENTIFIER {
1491 $$ = $1->access_content_String (true);
1493 | string '+' string {
1504 | dots '.' { $$ ++; }
1511 | exclamations '!' { $$ ++; }
1516 | questions '?' { $$ ++; }
1526 My_lily_parser::set_yydebug (bool b)
1533 My_lily_parser::do_yyparse ()
1535 yyparse ((void*)this);