1 %
{ // -*-Fundamental-*-
10 #include "parseconstruct.hh"
30 %token VOICE STAFF SCORE TITLE RHYTHMSTAFF BAR NOTENAME OUTPUT
33 %token
<id
> IDENTIFIER
34 %token
<string> PITCH DURATION RESTNAME
36 %token
<string> STRING
38 %type
<voice
> voice_block voice_body voice_elts voice_elts_dollar
40 %type
<command
> score_command
41 %type
<score
> score_block score_body
42 %type
<staff
> staff_block rhythmstaff_block rhythmstaff_body
53 score_block: SCORE
'{' score_body
'}' { $$
= $3; }
56 score_body: { $$
= new Score
; }
57 | score_body staff_block
{ $$
->add
($2); }
58 | score_body score_command
{ $$
->add
($2); }
59 | score_body OUTPUT STRING
{ $$
->outfile
= *$3;
69 RHYTHMSTAFF
'{' rhythmstaff_body
'}' { $$
= $3; }
73 /* empty */ { $$
= get_new_rhythmstaff
(); }
74 | rhythmstaff_body voice_block
{ $$
->add_voice
($2); }
78 VOICE
'{' voice_body
'}' { $$
= $3; }
83 REAL voice_elts_dollar
{ $$
= $2; $$
->start
= $1; }
84 | voice_elts_dollar
{ $$
= $1; }
88 '$' voice_elts
'$' { $$
= $2; }
95 | voice_elts voice_elt
{
101 PITCH DURATION
{ $$
= get_note_element
(*$1, *$2);
104 | RESTNAME DURATION
{ $$
= get_rest_element
(*$1, *$2);
111 $$
= get_bar_command
($2);
120 *mlog
<< "Parsing ... ";
121 yydebug = !monitor.silence
("Parser");