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"
18 #include "symtable.hh"
21 #include "my-lily-lexer.hh"
22 #include "paper-def.hh"
23 #include "midi-def.hh"
25 #include "file-path.hh"
28 #include "parseconstruct.hh"
29 #include "dimensions.hh"
30 #include "identifier.hh"
31 #include "command-request.hh"
32 #include "musical-request.hh"
33 #include "my-lily-parser.hh"
34 #include "text-def.hh"
35 #include "translator-group.hh"
37 #include "music-list.hh"
38 #include "duration-convert.hh"
39 #include "change-translator.hh"
40 #include "file-results.hh"
41 #include "mudela-version.hh"
43 #include "relative-music.hh"
44 #include "transposed-music.hh"
45 #include "compressed-music.hh"
46 #include "repeated-music.hh"
49 Mudela_version oldest_version ("1.0.14");
50 Mudela_version version ("1.0.14");
53 // needed for bison.simple's malloc() and free()
67 Assignment (Assignment const&s)
69 name_p_ = new String (*s.name_p_);
70 id_p_ = s.id_p_->clone ();
74 Paper_def* current_paper = 0;
80 #define YYERROR_VERBOSE 1
82 #define YYPARSE_PARAM my_lily_parser_l
83 #define YYLEX_PARAM my_lily_parser_l
84 #define THIS ((My_lily_parser *) my_lily_parser_l)
86 #define yyerror THIS->parser_error
87 #define ARRAY_SIZE(a,s) if (a.size () != s) THIS->parser_error (_f("expecting %d arguments", s))
93 Array<Interval>* intarr;
94 Array<Musical_pitch> *pitch_arr;
95 Array<String> * strvec;
99 Notename_table *chordmodifiertab;
101 General_script_def * script;
104 Music_list *music_list;
109 Music_output_def * outputdef;
110 Musical_pitch * pitch;
114 Notename_table *notenametab;
119 Simultaneous_music *chord;
122 Symtables* symtables;
134 yylex (YYSTYPE *s, void * v_l)
136 My_lily_parser *pars_l = (My_lily_parser*) v_l;
137 My_lily_lexer * lex_l = pars_l->lexer_p_;
139 lex_l->lexval_l = (void*) s;
140 return lex_l->yylex ();
148 /* tokens which are not keywords */
155 %token CHORDMODIFIERS
203 %token E_EXCLAMATION E_SMALLER E_BIGGER E_CHAR
207 %token <pitch> NOTENAME_PITCH
208 %token <pitch> TONICNAME_PITCH
209 %token <pitch> CHORDMODIFIER_PITCH
210 %token <id> DURATION_IDENTIFIER
211 %token <id> IDENTIFIER
212 %token <id> NOTENAME_TABLE_IDENTIFIER
213 %token <id> MUSIC_IDENTIFIER
214 %token <id> POST_REQUEST_IDENTIFIER
215 %token <id> SCRIPT_IDENTIFIER
216 %token <id> COMMAND_IDENTIFIER
217 %token <id> REAL_IDENTIFIER
218 %token <id> STRING_IDENTIFIER
219 %token <id> TRANS_IDENTIFIER
220 %token <id> INT_IDENTIFIER
221 %token <id> SCORE_IDENTIFIER
222 %token <id> MIDI_IDENTIFIER
223 %token <id> PAPER_IDENTIFIER
225 %token <string> DURATION RESTNAME
226 %token <string> STRING
230 %type <outputdef> output_def
231 %type <scope> mudela_header mudela_header_body
233 %type <i> open_request_parens close_request_parens
234 %type <i> sub_quotes sup_quotes
235 %type <music> simple_element request_chord command_element Simple_music Composite_music
236 %type <music> Alternative_music Repeated_music
237 %type <i> abbrev_type
238 %type <i> int unsigned
240 %type <i> optional_modality
241 %type <id> identifier_init simple_identifier_init block_identifier
242 %type <duration> steno_duration notemode_duration
243 %type <duration> entered_notemode_duration explicit_duration
244 %type <interval> dinterval
245 %type <intvec> intastint_list int_list
246 %type <symtables> symtables symtables_body
248 %type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
249 %type <pitch> steno_tonic_pitch
250 %type <notereq> steno_notepitch
251 %type <pitch_arr> pitch_list
252 %type <music> chord notemode_chord
253 %type <pitch_arr> chord_additions chord_subtractions
254 %type <pitch> chord_addsub chord_note chord_inversion notemode_chord_inversion
255 %type <midi> midi_block midi_body
256 %type <duration> duration_length
258 %type <scalar> scalar
259 %type <music> Music relative_music Sequential_music Simultaneous_music
260 %type <music> property_def translator_change
261 %type <music_list> Music_list
262 %type <paper> paper_block paper_def_body
263 %type <real> real_expression real dimension
264 %type <request> abbrev_command_req
265 %type <request> post_request structured_post_request
266 %type <request> command_req verbose_command_req
267 %type <request> script_req dynamic_req extender_req
268 %type <string> string
269 %type <score> score_block score_body
270 %type <intarr> shape_array
271 %type <script> script_definition script_body mudela_script gen_script_def
272 %type <textdef> text_def finger
273 %type <string> script_abbreviation
274 %type <symbol> symboldef
275 %type <symtable> symtable symtable_body
276 %type <trans> translator_spec translator_spec_body
277 %type <tempo> tempo_request
278 %type <notenametab> notenames_body notenames_block chordmodifiers_block
280 /* 5 extra for notemode_chord */
291 | mudela toplevel_expression {}
292 | mudela assignment { }
294 | mudela check_version { }
299 THIS->lexer_p_->set_notename_table ($1);
301 | chordmodifiers_block {
302 THIS->lexer_p_->set_chordmodifier_table ($1);
305 delete header_global_p;
306 header_global_p = $1;
309 score_global_array.push ($1);
312 Identifier * id = new
313 Paper_def_identifier ($1, PAPER_IDENTIFIER);
314 THIS->lexer_p_->set_identifier ("$defaultpaper", id)
317 Identifier * id = new
318 Midi_def_identifier ($1, MIDI_IDENTIFIER);
319 THIS->lexer_p_->set_identifier ("$defaultmidi", id)
327 read_lily_scm_file (*$2);
331 gh_eval_str ($2->ch_l ());
337 Mudela_version ver (*$2);
338 if (!((ver >= oldest_version) && (ver <= version))) {
339 if (THIS->ignore_version_b_) {
340 THIS->here_input ().error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
342 THIS->fatal_error_i_ = 1;
343 THIS->parser_error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), version.str ()));
350 chordmodifiers_block:
351 CHORDMODIFIERS '{' notenames_body '}' { $$ = $3; }
356 NOTENAMES '{' notenames_body '}' { $$ = $3; }
363 $$ = new Notename_table;
365 | NOTENAME_TABLE_IDENTIFIER {
366 $$ = $1-> access_content_Notename_table(true);
368 | notenames_body STRING '=' explicit_musical_pitch {
379 THIS->lexer_p_-> scope_l_arr_.push ($$);
381 | mudela_header_body assignment ';' {
387 HEADER '{' mudela_header_body '}' {
389 THIS->lexer_p_-> scope_l_arr_.pop ();
399 THIS->remember_spot ();
401 /* cont */ '=' identifier_init {
402 THIS->lexer_p_->set_identifier (*$1, $4);
403 $4->init_b_ = THIS->init_parse_b_;
404 $4->set_spot (THIS->pop_spot ());
409 simple_identifier_init: identifier_init
418 $$ = new Score_identifier ($1, SCORE_IDENTIFIER);
421 | chordmodifiers_block {
422 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
425 $$ = new Notename_table_identifier ($1, NOTENAME_TABLE_IDENTIFIER);
428 $$ = new Paper_def_identifier ($1, PAPER_IDENTIFIER);
431 $$ = new Midi_def_identifier ($1, MIDI_IDENTIFIER);
435 $$ = new Symtables_identifier ($1, IDENTIFIER);
438 $$ = new Translator_identifier ($1, TRANS_IDENTIFIER);
441 $$ = new Music_identifier ($1, MUSIC_IDENTIFIER);
445 $$ = new Request_identifier ($1, POST_REQUEST_IDENTIFIER);
447 | explicit_duration {
448 $$ = new Duration_identifier ($1, DURATION_IDENTIFIER);
451 $$ = new Real_identifier (new Real ($1), REAL_IDENTIFIER);
454 $$ = new String_identifier ($1, STRING_IDENTIFIER);
457 $$ = new int_identifier (new int ($1), INT_IDENTIFIER);
459 | script_definition {
460 $$ = new General_script_def_identifier ($1, SCRIPT_IDENTIFIER);
466 TRANSLATOR '{' translator_spec_body '}'
470 translator_spec_body:
472 $$ = $1->access_content_Translator (true);
473 $$-> set_spot (THIS->here_input ());
476 Translator* t = get_translator_l (*$2);
477 Translator_group * tg = dynamic_cast<Translator_group*> (t);
480 THIS->parser_error (_("Need a translator group for a context"));
483 t->set_spot (THIS->here_input ());
487 | translator_spec_body STRING '=' simple_identifier_init ';' {
489 String_identifier *s = dynamic_cast<String_identifier*> (id);
490 Real_identifier *r= dynamic_cast<Real_identifier*>(id);
491 int_identifier *i = dynamic_cast<int_identifier*> (id);
494 if (s) str = *s->access_content_String (false);
495 if (i) str = to_str (*i->access_content_int (false));
496 if (r) str = to_str (*r->access_content_Real (false));
498 THIS->parser_error (_("Wrong type for property value"));
501 $$->set_property (*$2, str);
503 | translator_spec_body NAME STRING ';' {
507 | translator_spec_body CONSISTS STRING ';' {
508 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, true);
511 | translator_spec_body ACCEPTS STRING ';' {
512 dynamic_cast<Translator_group*> ($$)-> set_acceptor (*$3, true);
515 | translator_spec_body REMOVE STRING ';' {
516 dynamic_cast<Translator_group*> ($$)-> set_element (*$3, false);
525 SCORE { THIS->remember_spot ();
527 /*cont*/ '{' score_body '}' {
529 $$->set_spot (THIS->pop_spot ());
530 if (!$$->def_p_arr_.size ())
531 $$->add_output (THIS->default_paper_p ());
540 $$ = $1->access_content_Score (true);
542 | score_body mudela_header {
547 $2->warning (_ ("More than one music block"));
550 | score_body output_def {
568 /* */ { $$ =new Array<int>; }
569 | intastint_list int '*' int {
570 $$->push ($2); $$->push ($4);
572 | intastint_list int {
573 $$->push ($2); $$->push (1);
582 PAPER '{' paper_def_body '}' {
584 THIS-> lexer_p_->scope_l_arr_.pop ();
600 Paper_def *p = THIS->default_paper_p ();
601 THIS-> lexer_p_-> scope_l_arr_.push (p->scope_p_);
604 | PAPER_IDENTIFIER optional_semicolon {
605 Paper_def *p = $1->access_content_Paper_def (true);
606 THIS->lexer_p_->scope_l_arr_.push (p->scope_p_);
609 | paper_def_body int '=' symtables { // ugh, what a syntax
610 Lookup * l = new Lookup (*$4);
611 $$->set_lookup ($2, l);
613 | paper_def_body assignment ';' {
616 | paper_def_body translator_spec {
617 $$->assign_translator ($2);
619 | paper_def_body SHAPE '=' shape_array ';' {
620 $$->shape_int_a_ = *$4;
623 | paper_def_body error {
630 real_expression { $$ = $1; }
655 $$= *$1->access_content_Real (false);
657 | '-' real_expression %prec UNARY_MINUS {
660 | real_expression '*' real_expression {
663 | real_expression '/' real_expression {
666 | real_expression '+' real_expression {
669 | real_expression '-' real_expression {
672 | '(' real_expression ')' {
680 $$ = new Array<Interval>;
682 | shape_array real real {
683 $$->push(Interval($2, $2 + $3));
692 '{' midi_body '}' { $$ = $3; }
695 midi_body: /* empty */ {
696 $$ = THIS->default_midi_p ();
699 $$ = $1-> access_content_Midi_def (true);
701 | midi_body translator_spec {
702 $$-> assign_translator ($2);
704 | midi_body tempo_request ';' {
705 $$->set_tempo ($2->dur_.length (), $2->metronome_i_);
714 TEMPO entered_notemode_duration '=' unsigned {
718 $$-> metronome_i_ = $4;
722 Music_list: /* empty */ {
739 Music_list* m = new Music_list;
740 $$ = new Sequential_music (m);
742 | ALTERNATIVE Simultaneous_music {
745 | ALTERNATIVE Sequential_music {
750 Repeated_music: REPEAT unsigned Music Alternative_music {
751 Music_sequence* m = dynamic_cast <Music_sequence*> ($4);
753 $$ = new Repeated_music ($3, $2 >? 1, m);
757 Sequential_music: '{' Music_list '}' {
758 $$ = new Sequential_music ($2);
762 Simultaneous_music: '<' Music_list '>' {
763 $$ = new Simultaneous_music ($2);
768 request_chord { $$ = $1; }
769 | MUSIC_IDENTIFIER { $$ = $1->access_content_Music (true); }
772 | Simple_music '*' unsigned '/' unsigned {
774 $$ = new Compressed_music ($3, $5, $1);
776 | Simple_music '*' unsigned {
777 $$ = new Compressed_music ($3, 1, $1);
785 $$->translator_type_str_ = *$2;
788 | TYPE STRING '=' STRING Music {
790 $$->translator_type_str_ = *$2;
791 $$->translator_id_str_ = *$4;
796 THIS->remember_spot ();
799 unsigned '/' unsigned Music
802 $$ = new Compressed_music ($3, $5, $6);
803 $$->set_spot (THIS->pop_spot ());
805 | Repeated_music { $$ = $1; }
806 | Simultaneous_music { $$ = $1; }
807 | Sequential_music { $$ = $1; }
808 | TRANSPOSE musical_pitch Music {
809 $$ = new Transposed_music ($3, *$2);
812 | TRANSPOSE steno_tonic_pitch Music {
813 $$ = new Transposed_music ($3, *$2);
817 { THIS->lexer_p_->push_note_state (); }
820 THIS->lexer_p_->pop_state ();
823 { THIS->lexer_p_->push_chord_state (); }
827 THIS->lexer_p_->pop_state ();
830 { THIS->lexer_p_->push_lyric_state (); }
834 THIS->lexer_p_->pop_state ();
836 | relative_music { $$ = $1; }
840 RELATIVE absolute_musical_pitch Music {
841 $$ = new Relative_octave_music ($3, *$2);
847 TRANSLATOR STRING '=' STRING {
848 Change_translator * t = new Change_translator;
849 t-> change_to_type_str_ = *$2;
850 t-> change_to_id_str_ = *$4;
853 $$->set_spot (THIS->here_input ());
860 PROPERTY STRING '.' STRING '=' scalar {
861 Translation_property *t = new Translation_property;
862 t-> translator_type_str_ = *$2;
866 $$->set_spot (THIS->here_input ());
874 STRING { $$ = new Scalar (*$1); delete $1; }
875 | int { $$ = new Scalar ($1); }
880 pre_requests simple_element post_requests {
881 THIS->add_requests ((Simultaneous_music*)$2);//ugh
889 $$ = new Request_chord;
890 $$-> set_spot (THIS->here_input ());
891 $1-> set_spot (THIS->here_input ());
892 ((Simultaneous_music*)$$) ->add_music ($1);//ugh
898 | verbose_command_req ';' { $$ = $1; }
903 $$ = new Barcheck_req;
905 | COMMAND_IDENTIFIER {
906 $$ = $1->access_content_Request (true);
909 $$ = new Command_tie_req;
912 Beam_req*b= new Beam_req;
913 b->spantype_ = START;
917 Beam_req*b= new Beam_req;
926 $$ = new Bar_req (*$2);
930 $$ = new Mark_req (*$2);
934 $$ = new Mark_req (to_str ($2));
936 | TIME_T unsigned '/' unsigned {
937 Time_signature_change_req *m = new Time_signature_change_req;
943 Break_req * b = new Break_req;
945 b-> set_spot (THIS->here_input ());
948 | SKIP duration_length {
949 Skip_req * skip_p = new Skip_req;
950 skip_p->duration_ = *$2;
958 $$ = new Cadenza_req ($2);
960 | PARTIAL duration_length {
961 $$ = new Partial_measure_req ($2->length ());
965 $$ = new Clef_change_req (*$2);
968 | KEY NOTENAME_PITCH optional_modality {
969 Key_change_req *key_p= new Key_change_req;
970 key_p->pitch_arr_.push(*$2);
971 key_p->ordinary_key_b_ = true;
972 key_p->modality_i_ = $3;
976 | KEYSIGNATURE pitch_list {
977 Key_change_req *key_p= new Key_change_req;
978 key_p->pitch_arr_ = *$2;
979 key_p->ordinary_key_b_ = false;
983 | GROUPING intastint_list {
984 $$ = get_grouping_req (*$2); delete $2;
990 /* something silly happened. Junk this stuff*/
991 if (!THIS->post_reqs.empty ())
993 warning ("Junking post-requests");
994 THIS->post_reqs.clear ();
997 | post_requests structured_post_request {
998 $2->set_spot (THIS->here_input ());
999 THIS->post_reqs.push ($2);
1001 | post_requests close_request_parens {
1002 Array<Request*>& r = *THIS->get_parens_request ($2);
1003 for (int i = 0; i < r.size (); i++ )
1004 r[i]->set_spot (THIS->here_input ());
1005 THIS->post_reqs.concat (r);
1010 structured_post_request:
1016 POST_REQUEST_IDENTIFIER {
1017 $$ = (Request*)$1->access_content_Request (true);
1023 Abbreviation_req* a = new Abbreviation_req;
1058 steno_musical_pitch:
1062 | NOTENAME_PITCH sup_quotes {
1064 $$->octave_i_ += $2;
1066 | NOTENAME_PITCH sub_quotes {
1068 $$->octave_i_ += - $2;
1076 | TONICNAME_PITCH sup_quotes {
1078 $$->octave_i_ += $2;
1080 | TONICNAME_PITCH sub_quotes {
1082 $$->octave_i_ += - $2;
1086 explicit_musical_pitch:
1087 MUSICAL_PITCH '{' int_list '}' {/* ugh */
1088 Array<int> &a = *$3;
1090 $$ = new Musical_pitch;
1091 $$->octave_i_ = a[0];
1092 $$->notename_i_ = a[1];
1093 $$->accidental_i_ = a[2];
1100 | explicit_musical_pitch
1110 | steno_notepitch '!' {
1111 $$->forceacc_b_ = ! $$->forceacc_b_;
1113 | steno_notepitch '?' {
1114 $$->forceacc_b_ = ! $$->forceacc_b_;
1115 $$->cautionary_b_ = ! $$->cautionary_b_;
1121 DURATION '{' int_list '}' {
1123 Array<int> &a = *$3;
1126 $$-> durlog_i_ = a[0];
1127 $$-> dots_i_ = a[1];
1135 if (!THIS->lexer_p_->lyric_state_b ())
1136 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1137 Extender_req * e_p = new Extender_req;
1138 e_p->spantype_ = START;
1140 THIS->extender_req = e_p;
1144 ABSDYNAMIC '{' unsigned '}' {
1145 Absolute_dynamic_req *ad_p = new Absolute_dynamic_req;
1146 ad_p ->loudness_ = (Dynamic_req::Loudness)$3;
1149 | SPANDYNAMIC '{' int int '}' {
1150 Span_dynamic_req * sp_p = new Span_dynamic_req;
1151 sp_p->spantype_ = (Direction)$4;
1152 sp_p-> dynamic_dir_ = (Direction)$3;
1159 close_request_parens:
1173 open_request_parens:
1185 SCRIPT '{' script_body '}' { $$ = $3; }
1189 STRING int int int int int {
1190 Script_def *s = new Script_def;
1191 s->set_from_input (*$1,$2, $3,$4,$5, $6);
1198 script_dir gen_script_def {
1199 Musical_script_req *m = new Musical_script_req;
1201 m->scriptdef_p_ = $2;
1202 m->set_spot (THIS->here_input ());
1204 m->dir_ = (Direction)$1;
1211 ((Text_def*) $$)->align_dir_ = LEFT; /* UGH */
1215 $$-> set_spot (THIS->here_input ());
1219 ((Text_def*)$$)->align_dir_ = RIGHT; /* UGH */
1225 Text_def *t = new Text_def;
1229 $$->set_spot (THIS->here_input ());
1235 Text_def* t = new Text_def;
1237 t->text_str_ = to_str ($1);
1238 t->style_str_ = "finger";
1239 $$->set_spot (THIS->here_input ());
1243 script_abbreviation:
1244 '^' { $$ = get_scriptdef ('^'); }
1245 | '+' { $$ = get_scriptdef ('+'); }
1246 | '-' { $$ = get_scriptdef ('-'); }
1247 | '|' { $$ = get_scriptdef ('|'); }
1248 | 'o' { $$ = get_scriptdef ('o'); }
1249 | '>' { $$ = get_scriptdef ('>'); }
1251 $$ = get_scriptdef ('.');
1256 SCRIPT_IDENTIFIER { $$ = $1->access_content_General_script_def (true); }
1257 | script_definition { $$ = $1; }
1258 | script_abbreviation {
1259 $$ = THIS->lexer_p_->lookup_identifier (*$1)->access_content_General_script_def (true);
1272 if (THIS->extender_req)
1274 Extender_req * e_p = new Extender_req;
1275 e_p->spantype_ = STOP;
1276 THIS->pre_reqs.push (e_p);
1277 THIS->extender_req = 0;
1281 | pre_requests open_request_parens {
1283 Array<Request*>& r = *THIS->get_parens_request ($2);
1284 for (int i = 0; i < r.size (); i++ )
1285 r[i]->set_spot (THIS->here_input ());
1286 THIS->pre_reqs.concat (r);
1291 absolute_musical_pitch:
1292 steno_musical_pitch {
1301 | duration_length '*' unsigned {
1302 $$->plet_.iso_i_ *= $3;
1304 | duration_length '/' unsigned {
1305 $$->plet_.type_i_ *= $3;
1311 | dots '.' { $$ ++; }
1314 entered_notemode_duration:
1316 $$ = new Duration (THIS->default_duration_);
1319 $$ = new Duration (THIS->default_duration_);
1323 THIS->set_last_duration ($1);
1328 entered_notemode_duration {
1336 if (!Duration::duration_type_b ($1))
1337 THIS->parser_error (_f ("not a duration: %d", $1));
1339 $$->durlog_i_ = Duration_convert::i2_type ($1);
1342 | DURATION_IDENTIFIER {
1343 $$ = $1->access_content_Duration (true);
1345 | steno_duration '.' {
1356 if (!Duration::duration_type_b ($2))
1357 THIS->parser_error (_f ("not a duration: %d", $2));
1359 THIS->parser_error (_ ("can't abbreviate"));
1367 steno_notepitch notemode_duration {
1368 if (!THIS->lexer_p_->note_state_b ())
1369 THIS->parser_error (_ ("have to be in Note mode for notes"));
1370 $1->duration_ = *$2;
1371 $$ = THIS->get_note_element ($1, $2);
1373 | RESTNAME notemode_duration {
1374 $$ = THIS->get_rest_element (*$1, $2);
1375 delete $1; // delete notename
1377 | MEASURES notemode_duration {
1378 Multi_measure_rest_req* m = new Multi_measure_rest_req;
1382 Simultaneous_music*velt_p = new Request_chord;
1383 velt_p->set_spot (THIS->here_input ());
1384 velt_p->add_music (m);
1387 | STRING notemode_duration {
1388 if (!THIS->lexer_p_->lyric_state_b ())
1389 THIS->parser_error (_ ("have to be in Lyric mode for lyrics"));
1390 $$ = THIS->get_word_element (*$1, $2);
1394 if (!THIS->lexer_p_->chord_state_b ())
1395 THIS->parser_error (_ ("have to be in Chord mode for chords"));
1398 | '@' notemode_chord {
1399 if (!THIS->lexer_p_->note_state_b ())
1400 THIS->parser_error (_ ("have to be in Note mode for @chords"));
1406 steno_tonic_pitch notemode_duration chord_additions chord_subtractions chord_inversion {
1407 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1411 steno_musical_pitch notemode_duration chord_additions chord_subtractions notemode_chord_inversion {
1412 $$ = THIS->get_chord (*$1, $3, $4, $5, *$2);
1417 $$ = new Array<Musical_pitch>;
1420 $$ = new Array<Musical_pitch>;
1422 | chord_additions chord_addsub {
1429 chord_note optional_dot
1430 | CHORDMODIFIER_PITCH optional_dot
1437 | '/' steno_tonic_pitch {
1442 notemode_chord_inversion:
1446 | '/' steno_musical_pitch {
1453 $$ = new Musical_pitch;
1454 $$->notename_i_ = ($1 - 1) % 7;
1455 $$->octave_i_ = $1 > 7 ? 1 : 0;
1456 $$->accidental_i_ = 0;
1459 $$ = new Musical_pitch;
1460 $$->notename_i_ = ($1 - 1) % 7;
1461 $$->octave_i_ = $1 > 7 ? 1 : 0;
1462 $$->accidental_i_ = 1;
1465 $$ = new Musical_pitch;
1466 $$->notename_i_ = ($1 - 1) % 7;
1467 $$->octave_i_ = $1 > 7 ? 1 : 0;
1468 $$->accidental_i_ = -1;
1474 $$ = new Array<Musical_pitch>;
1477 $$ = new Array<Musical_pitch>;
1479 | chord_subtractions chord_addsub {
1489 $$ = new Array<Musical_pitch>;
1491 | pitch_list musical_pitch {
1523 $$ = *$1->access_content_int (false);
1532 | STRING_IDENTIFIER {
1533 $$ = $1->access_content_String (true);
1535 | string '+' string {
1547 SYMBOLTABLES '{' symtables_body '}' { $$ = $3; }
1555 $$ = $1->access_content_Symtables (true);
1557 | symtables_body FONT STRING {
1559 $$->font_path_ = global_path.find (*$3);
1560 if (!$$->font_path_.length_i ())
1561 THIS->here_input ().error (_f("can't open file: `%s'", $3->ch_C()));
1565 | symtables_body STRING '=' symtable {
1572 TABLE '{' symtable_body '}' { $$ = $3; }
1576 { $$ = new Symtable; }
1577 | symtable_body STRING symboldef {
1578 $$->elem (*$2) = *$3;
1585 STRING unsigned box {
1587 $$ = new Atom (*$1, *$3);
1592 Box b (Interval (0,0), Interval (0,0));
1594 $$ = new Atom (*$1, b);
1600 dinterval dinterval {
1601 $$ = new Box (*$1, *$2);
1607 dinterval: real real {
1608 $$ = new Interval ($1, $2);
1615 My_lily_parser::set_yydebug (bool b)
1622 My_lily_parser::do_yyparse ()
1624 yyparse ((void*)this);