# A. LilyPond grammar

This appendix contains a description of the LilyPond grammar, as output from the parser.

```Grammar

1 start_symbol: lilypond

3 start_symbol: "#{"  embedded_lilypond

4 lilypond: /* empty */
5         | lilypond toplevel_expression
6         | lilypond assignment
7         | lilypond error
8         | lilypond "\version-error"

11                    | book_block
12                    | bookpart_block
13                    | BOOK_IDENTIFIER
14                    | score_block
15                    | composite_music
16                    | full_markup
17                    | full_markup_list
18                    | SCM_TOKEN
19                    | embedded_scm_active
20                    | output_def

21 embedded_scm_bare: SCM_TOKEN
22                  | SCM_IDENTIFIER

23 embedded_scm_active: SCM_IDENTIFIER
24                    | scm_function_call

25 embedded_scm_bare_arg: SCM_ARG
26                      | SCM_TOKEN
27                      | FRACTION
28                      | full_markup_list
29                      | context_modification
30                      | score_block
31                      | context_def_spec_block
32                      | book_block
33                      | bookpart_block
34                      | output_def

35 embedded_scm: embedded_scm_bare
36             | scm_function_call

37 embedded_scm_arg: embedded_scm_bare_arg
38                 | scm_function_call
39                 | music_assign

40 scm_function_call: SCM_FUNCTION function_arglist

41 embedded_lilypond: /* empty */
42                  | identifier_init
43                  | music_embedded music_embedded music_list
44                  | error
45                  | "\version-error" embedded_lilypond

50 assignment_id: STRING

51 assignment: assignment_id '=' identifier_init
52           | assignment_id property_path '=' identifier_init
53           | assignment_id '.' property_path '=' identifier_init

54 identifier_init: score_block
55                | book_block
56                | bookpart_block
57                | output_def
58                | context_def_spec_block
59                | music_assign
60                | post_event_nofinger post_events
61                | number_expression
62                | FRACTION
63                | string
64                | embedded_scm
65                | full_markup_list
66                | context_modification

67 context_def_spec_block: "\context" '{' context_def_spec_body '}'

68 context_mod_arg: embedded_scm

70 context_mod_arg:  composite_music

71 context_mod_embedded: context_mod_arg

72 context_def_spec_body: /* empty */
73                      | CONTEXT_DEF_IDENTIFIER
74                      | context_def_spec_body context_mod
75                      | context_def_spec_body context_modification
76                      | context_def_spec_body context_mod_embedded

77 book_block: "\book" '{' book_body '}'

78 book_body: /* empty */
79          | BOOK_IDENTIFIER
80          | book_body paper_block
81          | book_body bookpart_block
82          | book_body score_block
83          | book_body composite_music
84          | book_body full_markup
85          | book_body full_markup_list
86          | book_body SCM_TOKEN
87          | book_body embedded_scm_active

90          | book_body error

91 bookpart_block: "\bookpart" '{' bookpart_body '}'

92 bookpart_body: /* empty */
93              | BOOK_IDENTIFIER
94              | bookpart_body paper_block
95              | bookpart_body score_block
96              | bookpart_body composite_music
97              | bookpart_body full_markup
98              | bookpart_body full_markup_list
99              | bookpart_body SCM_TOKEN
100              | bookpart_body embedded_scm_active

103              | bookpart_body error

104 score_block: "\score" '{' score_body '}'

110           | embedded_scm_active

113           | score_body output_def
114           | score_body error

115 paper_block: output_def

116 output_def: output_def_body '}'

118                | "\midi"
119                | "\layout"

121 music_or_context_def: music_arg
122                     | context_def_spec_block

'{'
OUTPUT_DEF_IDENTIFIER
125                | output_def_body assignment
126                | output_def_body embedded_scm

128 output_def_body: output_def_body  music_or_context_def
129                | output_def_body error

130 tempo_event: "\tempo" steno_duration '=' tempo_range
131            | "\tempo" scalar steno_duration '=' tempo_range
132            | "\tempo" scalar

133 music_list: /* empty */
134           | music_list music_embedded
135           | music_list error

136 braced_music_list: '{' music_list '}'

137 music: music_arg
138      | lyric_element_music

139 music_embedded: music
140               | music_embedded_backup
141               | music_embedded_backup
"(backed-up?)"
lyric_element_music

142 music_embedded_backup: embedded_scm

143 music_arg: simple_music
144          | composite_music

145 music_assign: simple_music
146             | composite_music

147 repeated_music: "\repeat" simple_string unsigned_number music
148               | REPEAT_IDENTIFIER music
149               | "\repeat"
simple_string
unsigned_number
music
"\alternative"
braced_music_list
150               | REPEAT_IDENTIFIER
music
"\alternative"
braced_music_list

151 sequential_music: "\sequential" braced_music_list
152                 | braced_music_list

153 simultaneous_music: "\simultaneous" braced_music_list
154                   | "<<" music_list ">>"

155 simple_music: event_chord
156             | music_property_def
157             | context_change

159 context_modification: "\with"  '{' context_mod_list '}'
160                     | "\with" CONTEXT_MOD_IDENTIFIER
161                     | CONTEXT_MOD_IDENTIFIER
162                     | "\with" context_modification_arg

163 context_modification_arg: embedded_scm_closed
164                         | MUSIC_IDENTIFIER

165 optional_context_mod: /* empty */
166                     | context_modification

167 context_mod_list: /* empty */
168                 | context_mod_list context_mod
169                 | context_mod_list CONTEXT_MOD_IDENTIFIER
170                 | context_mod_list context_mod_embedded

171 composite_music: complex_music
172                | music_bare

173 closed_music: music_bare
174             | complex_music_prefix closed_music
175             | music_function_call_closed

176 music_bare: mode_changed_music
177           | MUSIC_IDENTIFIER
178           | grouped_music_list

179 grouped_music_list: simultaneous_music
180                   | sequential_music

181 function_arglist_nonbackup_common: "optional?"
"scheme?"
function_arglist_nonbackup
post_event_nofinger
182                                  | "optional?"
"scheme?"
function_arglist_nonbackup
'-'
UNSIGNED
183                                  | "optional?"
"scheme?"
function_arglist_nonbackup
'-'
REAL
184                                  | "optional?"
"scheme?"
function_arglist_nonbackup
'-'
NUMBER_IDENTIFIER

185 function_arglist_closed_nonbackup: function_arglist_nonbackup_common
186                                  | function_arglist_closed_common
187                                  | "optional?"
"scheme?"
function_arglist_nonbackup
embedded_scm_arg_closed
188                                  | "optional?"
"scheme?"
function_arglist_nonbackup
bare_number_closed
189                                  | "optional?"
"scheme?"
function_arglist_nonbackup
SCM_IDENTIFIER
190                                  | "optional?"
"scheme?"
function_arglist_nonbackup
STRING
191                                  | "optional?"
"scheme?"
function_arglist_nonbackup
full_markup

192 symbol_list_arg: SYMBOL_LIST
193                | SYMBOL_LIST '.' symbol_list_rev

194 symbol_list_rev: symbol_list_part
195                | symbol_list_rev '.' symbol_list_part

196 symbol_list_part: symbol_list_element

197 symbol_list_element: STRING
198                    | embedded_scm_bare

199 function_arglist_nonbackup: function_arglist_nonbackup_common
200                           | function_arglist_common
201                           | "optional?"
"scheme?"
function_arglist_nonbackup
embedded_scm_arg
202                           | "optional?"
"scheme?"
function_arglist_nonbackup
bare_number_common
203                           | function_arglist_nonbackup_reparse
"(reparsed?)"
duration_length
204                           | function_arglist_nonbackup_reparse
"(reparsed?)"
bare_number_common
205                           | function_arglist_nonbackup_reparse
"(reparsed?)"
SCM_ARG
206                           | function_arglist_nonbackup_reparse
"(reparsed?)"
lyric_element_music
207                           | function_arglist_nonbackup_reparse
"(reparsed?)"
symbol_list_arg

208 function_arglist_nonbackup_reparse: "optional?"
"scheme?"
function_arglist_nonbackup
SCM_IDENTIFIER
209                                   | "optional?"
"scheme?"
function_arglist_nonbackup
STRING
210                                   | "optional?"
"scheme?"
function_arglist_nonbackup
full_markup
211                                   | "optional?"
"scheme?"
function_arglist_nonbackup
UNSIGNED
212                                   | "optional?"
"scheme?"
function_arglist_nonbackup
DURATION_IDENTIFIER

213 function_arglist_backup: function_arglist_common
214                        | "optional?"
"scheme?"
function_arglist_backup
embedded_scm_arg_closed
215                        | "optional?"
"scheme?"
function_arglist_backup
"\repeat"
simple_string
unsigned_number
216                        | "optional?"
"scheme?"
function_arglist_backup
chord_body
217                        | "optional?"
"scheme?"
function_arglist_backup
post_event_nofinger
218                        | "optional?"
"scheme?"
function_arglist_backup
full_markup
219                        | "optional?"
"scheme?"
function_arglist_backup
UNSIGNED
220                        | "optional?"
"scheme?"
function_arglist_backup
REAL
221                        | "optional?"
"scheme?"
function_arglist_backup
NUMBER_IDENTIFIER
222                        | "optional?"
"scheme?"
function_arglist_backup
'-'
UNSIGNED
223                        | "optional?"
"scheme?"
function_arglist_backup
'-'
REAL
224                        | "optional?"
"scheme?"
function_arglist_backup
'-'
NUMBER_IDENTIFIER
225                        | "optional?"
"scheme?"
function_arglist_backup
PITCH_IDENTIFIER
226                        | "optional?"
"scheme?"
function_arglist_backup
NOTENAME_PITCH
227                        | "optional?"
"scheme?"
function_arglist_backup
TONICNAME_PITCH
228                        | "optional?"
"scheme?"
function_arglist_backup
DURATION_IDENTIFIER
229                        | "optional?"
"scheme?"
function_arglist_backup
SCM_IDENTIFIER
230                        | "optional?"
"scheme?"
function_arglist_backup
STRING
231                        | function_arglist_backup
"(reparsed?)"
music_assign
232                        | function_arglist_backup
"(reparsed?)"
pitch_arg
233                        | function_arglist_backup
"(reparsed?)"
bare_number_common
234                        | function_arglist_backup
"(reparsed?)"
duration_length
235                        | function_arglist_backup
"(reparsed?)"
symbol_list_arg

236 function_arglist: function_arglist_nonbackup
237                 | "optional?"
"scheme?"
function_arglist_skip_nonbackup
"\default"

238 function_arglist_skip_nonbackup: function_arglist_nonbackup
239                                | "optional?"
"scheme?"
function_arglist_skip_nonbackup

240 function_arglist_common: EXPECT_NO_MORE_ARGS
241                        | "scheme?"
function_arglist_optional
embedded_scm_arg
242                        | "scheme?"
function_arglist_optional
bare_number_common
243                        | "scheme?"
function_arglist_optional
post_event_nofinger
244                        | "scheme?"
function_arglist_optional
'-'
NUMBER_IDENTIFIER
245                        | function_arglist_common_reparse
"(reparsed?)"
SCM_ARG
246                        | function_arglist_common_reparse
"(reparsed?)"
lyric_element_music
247                        | function_arglist_common_reparse
"(reparsed?)"
bare_number_common
248                        | function_arglist_common_reparse
"(reparsed?)"
duration_length
249                        | function_arglist_common_reparse
"(reparsed?)"
symbol_list_arg

250 function_arglist_common_reparse: "scheme?"
function_arglist_optional
SCM_IDENTIFIER
251                                | "scheme?"
function_arglist_optional
STRING
252                                | "scheme?"
function_arglist_optional
full_markup
253                                | "scheme?"
function_arglist_optional
UNSIGNED
254                                | "scheme?"
function_arglist_optional
DURATION_IDENTIFIER
255                                | "scheme?"
function_arglist_optional
'-'
UNSIGNED
256                                | "scheme?"
function_arglist_optional
'-'
REAL

257 function_arglist_closed: function_arglist_closed_nonbackup
258                        | "optional?"
"scheme?"
function_arglist_skip_nonbackup
"\default"

259 function_arglist_closed_common: EXPECT_NO_MORE_ARGS
260                               | "scheme?"
function_arglist_optional
embedded_scm_arg_closed
261                               | "scheme?"
function_arglist_optional
bare_number_common_closed
262                               | "scheme?"
function_arglist_optional
'-'
NUMBER_IDENTIFIER
263                               | "scheme?"
function_arglist_optional
post_event_nofinger
264                               | function_arglist_common_reparse
"(reparsed?)"
SCM_ARG
265                               | function_arglist_common_reparse
"(reparsed?)"
bare_number_common_closed
266                               | function_arglist_common_reparse
"(reparsed?)"
symbol_list_arg

267 function_arglist_optional: function_arglist_backup
268                          | "optional?"
"scheme?"
function_arglist_skip_backup
"\default"
269                          | function_arglist_skip_backup "(backed-up?)"

270 function_arglist_skip_backup: function_arglist_backup
271                             | "optional?"
"scheme?"
function_arglist_skip_backup

272 embedded_scm_closed: embedded_scm_bare
273                    | scm_function_call_closed

274 embedded_scm_arg_closed: embedded_scm_bare_arg
275                        | scm_function_call_closed
276                        | closed_music

277 scm_function_call_closed: SCM_FUNCTION function_arglist_closed

278 music_function_call: MUSIC_FUNCTION function_arglist

279 optional_id: /* empty */
280            | '=' simple_string

281 complex_music: music_function_call
282              | repeated_music
283              | re_rhythmed_music
284              | complex_music_prefix music

285 complex_music_prefix: "\context"
symbol
optional_id
optional_context_mod
286                     | "\new" symbol optional_id optional_context_mod

optional_context_mod
grouped_music_list

290                   | "\drummode"
291                   | "\figuremode"
292                   | "\chordmode"
293                   | "\lyricmode"

295                                | "\figures"
296                                | "\chords"
297                                | "\lyrics"

301 new_lyrics: new_lyrics "\addlyrics" 1 composite_music

302 re_rhythmed_music: composite_music new_lyrics

304 re_rhythmed_music: "\lyricsto" simple_string 2 music

305 context_change: "\change" symbol '=' simple_string

306 property_path: symbol_list_rev
307              | symbol_list_rev property_path

308 property_operation: symbol '=' scalar
309                   | "\unset" symbol
310                   | "\override" property_path '=' scalar
311                   | "\revert" revert_arg

312 revert_arg: revert_arg_backup "(backed-up?)" symbol_list_arg

313 revert_arg_backup: revert_arg_part

314 revert_arg_part: symbol_list_part
315                | revert_arg_backup
"(backed-up?)"
SCM_ARG
'.'
symbol_list_part
316                | revert_arg_backup
"(backed-up?)"
SCM_ARG
symbol_list_part

317 context_def_mod: "\consists"
318                | "\remove"
319                | "\accepts"
320                | "\defaultchild"
321                | "\denies"
322                | "\alias"
323                | "\type"
324                | "\description"
325                | "\name"

326 context_mod: property_operation
327            | context_def_mod STRING
328            | context_def_mod embedded_scm

329 grob_prop_spec: symbol_list_rev

330 grob_prop_path: grob_prop_spec
331               | grob_prop_spec property_path

332 context_prop_spec: symbol_list_rev

333 simple_music_property_def: "\override" grob_prop_path '=' scalar
334                          | "\revert" simple_revert_context revert_arg
335                          | "\set" context_prop_spec '=' scalar
336                          | "\unset" context_prop_spec

337 simple_revert_context: symbol_list_part

338 music_property_def: simple_music_property_def

339 string: STRING
340       | full_markup

341 simple_string: STRING
342              | embedded_scm_bare

343 symbol: STRING
344       | embedded_scm_bare

345 scalar: embedded_scm_arg
346       | SCM_IDENTIFIER
347       | bare_number
348       | '-' bare_number
349       | STRING
350       | full_markup

351 event_chord: simple_element post_events
352            | simple_chord_elements post_events
353            | CHORD_REPETITION optional_notemode_duration post_events
354            | MULTI_MEASURE_REST optional_notemode_duration post_events
355            | command_element
356            | note_chord_element

357 note_chord_element: chord_body optional_notemode_duration post_events

358 chord_body: "<" chord_body_elements ">"
359           | CHORD_BODY_IDENTIFIER

360 chord_body_elements: /* empty */
361                    | chord_body_elements chord_body_element

362 chord_body_element: pitch
exclamations
questions
octave_check
post_events
363                   | DRUM_PITCH post_events
364                   | music_function_chord_body

365 music_function_chord_body: music_function_call
366                          | MUSIC_IDENTIFIER
367                          | embedded_scm

368 music_function_call_closed: MUSIC_FUNCTION function_arglist_closed

369 event_function_event: EVENT_FUNCTION function_arglist_closed

370 command_element: command_event

371 command_event: tempo_event

372 post_events: /* empty */
373            | post_events post_event

374 post_event_nofinger: direction_less_event
375                    | script_dir music_function_call_closed
376                    | "--"
377                    | "__"
378                    | script_dir direction_reqd_event
379                    | script_dir direction_less_event
380                    | '^' fingering
381                    | '_' fingering

382 post_event: post_event_nofinger
383           | '-' fingering

384 string_number_event: E_UNSIGNED

385 direction_less_event: string_number_event
386                     | EVENT_IDENTIFIER
387                     | tremolo_type
388                     | event_function_event

389 direction_reqd_event: gen_text_def
390                     | script_abbreviation

391 octave_check: /* empty */
392             | '=' quotes

393 quotes: /* empty */
394       | sub_quotes
395       | sup_quotes

396 sup_quotes: '''
397           | sup_quotes '''

398 sub_quotes: ','
399           | sub_quotes ','

400 steno_pitch: NOTENAME_PITCH quotes

401 steno_tonic_pitch: TONICNAME_PITCH quotes

402 pitch: steno_pitch
403      | PITCH_IDENTIFIER quotes

404 pitch_arg: PITCH_ARG quotes

405 gen_text_def: full_markup
406             | STRING
407             | embedded_scm_closed

408 fingering: UNSIGNED

409 script_abbreviation: '^'
410                    | '+'
411                    | '-'
412                    | '!'
413                    | ">"
414                    | '.'
415                    | '_'

416 script_dir: '_'
417           | '^'
418           | '-'

419 duration_length: multiplied_duration

420 maybe_notemode_duration: /* empty */
421                        | multiplied_duration

422 optional_notemode_duration: maybe_notemode_duration

423 steno_duration: UNSIGNED dots
424               | DURATION_IDENTIFIER dots

425 multiplied_duration: steno_duration
426                    | multiplied_duration '*' UNSIGNED
427                    | multiplied_duration '*' FRACTION

428 dots: /* empty */
429     | dots '.'

430 tremolo_type: ':'
431             | ':' UNSIGNED

432 bass_number: UNSIGNED
433            | STRING
434            | full_markup
435            | embedded_scm_bare

436 figured_bass_alteration: '-'
437                        | '+'
438                        | '!'

439 bass_figure: "_"
440            | bass_number
441            | bass_figure ']'
442            | bass_figure figured_bass_alteration
443            | bass_figure figured_bass_modification

444 figured_bass_modification: "\+"
445                          | "\!"
446                          | '/'
447                          | "\"

448 br_bass_figure: bass_figure
449               | '[' bass_figure

450 figure_list: /* empty */
451            | figure_list br_bass_figure

452 figure_spec: FIGURE_OPEN figure_list FIGURE_CLOSE

453 optional_rest: /* empty */
454              | "\rest"

455 simple_element: pitch
exclamations
questions
octave_check
maybe_notemode_duration
optional_rest
456               | DRUM_PITCH optional_notemode_duration
457               | RESTNAME optional_notemode_duration

458 simple_chord_elements: new_chord
459                      | figure_spec optional_notemode_duration

460 lyric_element: full_markup
461              | STRING
462              | LYRIC_ELEMENT

463 lyric_element_music: lyric_element
optional_notemode_duration
post_events

464 new_chord: steno_tonic_pitch maybe_notemode_duration
465          | steno_tonic_pitch
optional_notemode_duration
chord_separator
chord_items

466 chord_items: /* empty */
467            | chord_items chord_item

468 chord_separator: ":"
469                | "^"
470                | "/" steno_tonic_pitch
471                | "/+" steno_tonic_pitch

472 chord_item: chord_separator
473           | step_numbers
474           | CHORD_MODIFIER

475 step_numbers: step_number
476             | step_numbers '.' step_number

477 step_number: UNSIGNED
478            | UNSIGNED '+'
479            | UNSIGNED "-"

480 tempo_range: unsigned_number
481            | unsigned_number '-' unsigned_number

482 number_expression: number_expression '+' number_term
483                  | number_expression '-' number_term
484                  | number_term

485 number_term: number_factor
486            | number_factor '*' number_factor
487            | number_factor '/' number_factor

488 number_factor: '-' number_factor
489              | bare_number

490 bare_number_common: bare_number_common_closed
491                   | REAL NUMBER_IDENTIFIER

492 bare_number_common_closed: REAL
493                          | NUMBER_IDENTIFIER

494 bare_number: bare_number_common
495            | UNSIGNED
496            | UNSIGNED NUMBER_IDENTIFIER

497 bare_number_closed: UNSIGNED
498                   | bare_number_common_closed

499 unsigned_number: UNSIGNED
500                | NUMBER_IDENTIFIER
501                | embedded_scm

502 exclamations: /* empty */
503             | exclamations '!'

504 questions: /* empty */
505          | questions '?'

507 full_markup_list: "\markuplist" 3 markup_list

509 full_markup: "\markup" 4 markup_top

510 markup_top: markup_list
512           | simple_markup

514 markup_scm: embedded_scm_bare 5 "(backed-up?)"

515 markup_list: markup_composed_list
516            | markup_uncomposed_list

517 markup_uncomposed_list: markup_braced_list
518                       | markup_command_list
519                       | markup_scm MARKUPLIST_IDENTIFIER

521 markup_braced_list: '{' markup_braced_list_body '}'

522 markup_braced_list_body: /* empty */
523                        | markup_braced_list_body markup
524                        | markup_braced_list_body markup_list

525 markup_command_list: MARKUP_LIST_FUNCTION markup_command_list_arguments

526 markup_command_basic_arguments: "markup-list?"
markup_command_list_arguments
markup_list
527                               | "scheme?"
markup_command_list_arguments
embedded_scm_closed
528                               | EXPECT_NO_MORE_ARGS

529 markup_command_list_arguments: markup_command_basic_arguments
530                              | "markup?"
markup_command_list_arguments
markup

"markup?"
markup_command_list_arguments

534 simple_markup: STRING

536 simple_markup: "\score" 6 '{' score_body '}'
537              | MARKUP_FUNCTION markup_command_basic_arguments
538              | markup_scm MARKUP_IDENTIFIER

540       | simple_markup

Terminals, with rules where they appear

210 211 212 214 215 216 217 218 219 220 221 222 223 224 225 226
210 211 212 214 215 216 217 218 219 220 221 222 223 224 225 226
227 228 229 230 237 239 241 242 243 244 250 251 252 253 254 255
227 228 229 230 237 239 258 268 271
247 248 249 264 265 266
256 258 260 261 262 263 268 271 527
479 495 496 497 499
481 483 488
534
"#{" (339) 3
"(backed-up?)" (334) 141 269 312 315 316 514
"(reparsed?)" (335) 203 204 205 206 207 231 232 233 234 235 245 246
"-" (319) 479
"--" (266) 376
"/" (320) 470
"/+" (316) 471
":" (318) 468
"<" (321) 358
"<<" (323) 154
">" (322) 358 413
">>" (324) 154
"\!" (326) 445
"\" (325) 447
"\+" (327) 444
"\accepts" (274) 319
"\alias" (275) 322
"\alternative" (261) 149 150
"\book" (276) 77
"\bookpart" (277) 91
"\change" (278) 305
"\chordmode" (279) 292
"\chords" (280) 296
"\consists" (281) 317
"\context" (282) 67 285
"\default" (283) 237 258 268
"\defaultchild" (284) 320
"\denies" (285) 321
"\description" (286) 324
"\drummode" (287) 290
"\drums" (288) 294
"\figuremode" (289) 291
"\figures" (290) 295
"\layout" (293) 119
"\lyricmode" (294) 293
"\lyrics" (295) 297
"\lyricsto" (296) 304
"\markup" (297) 509
"\markuplist" (298) 507
"\midi" (299) 118
"\name" (300) 325
"\new" (315) 286
"\notemode" (301) 289
"\override" (302) 310 333
"\paper" (303) 117
"\remove" (304) 318
"\repeat" (260) 147 149 215
"\rest" (305) 454
"\revert" (306) 311 334
"\score" (307) 104 536
"\sequential" (308) 151
"\set" (309) 335
"\simultaneous" (310) 153
"\tempo" (311) 130 131 132
"\type" (312) 323
"\unset" (313) 309 336
"\version-error" (292) 8 45
"\with" (314) 159 160 162
"^" (317) 469
"_" (330) 439
"__" (265) 377
"end of input" (0) 0
"markup-list?" (336) 526
"markup?" (332) 530 531
"optional?" (337) 181 182 183 184 187 188 189 190 191 201 202 208 209
"scheme?" (333) 181 182 183 184 187 188 189 190 191 201 202 208 209
'!' (33) 412 438 503
''' (39) 396 397
'*' (42) 426 427 486
'+' (43) 410 437 478 482
',' (44) 398 399
'-' (45) 182 183 184 222 223 224 244 255 256 262 348 383 411 418 436
'.' (46) 53 193 195 315 414 429 476
'/' (47) 446 487
':' (58) 430 431
'=' (61) 51 52 53 130 131 280 305 308 310 333 335 392
'?' (63) 505
'[' (91) 449
']' (93) 441
'^' (94) 380 409 417
'_' (95) 381 415 416
'{' (123) 49 67 77 91 104 123 124 136 159 521 536
'}' (125) 49 67 77 91 104 116 136 159 521 536
BOOK_IDENTIFIER (340) 13 79 93
CHORD_BODY_IDENTIFIER (341) 359
CHORD_MODIFIER (342) 474
CHORD_REPETITION (343) 353
COMPOSITE (262)
CONTEXT_DEF_IDENTIFIER (344) 73
CONTEXT_MOD_IDENTIFIER (345) 160 161 169
DRUM_PITCH (346) 363 456
DURATION_IDENTIFIER (264) 212 228 254 424
E_UNSIGNED (269) 384
error (256) 7 44 90 103 114 129 135
EVENT_FUNCTION (267) 369
EVENT_IDENTIFIER (268) 386
EXPECT_NO_MORE_ARGS (338) 240 259 528
FIGURE_CLOSE (328) 452
FIGURE_OPEN (329) 452
FRACTION (349) 27 62 427
LYRIC_ELEMENT (350) 462
MARKUP_FUNCTION (351) 531 537
MARKUP_IDENTIFIER (353) 538
MARKUP_LIST_FUNCTION (352) 525
MARKUPLIST_IDENTIFIER (354) 519
MULTI_MEASURE_REST (331) 354
MUSIC_FUNCTION (355) 278 368
MUSIC_IDENTIFIER (356) 164 177 366
NOTENAME_PITCH (357) 226 400
NUMBER_IDENTIFIER (272) 184 221 224 244 262 491 493 496 500
OUTPUT_DEF_IDENTIFIER (358) 124
PITCH_ARG (348) 404
PITCH_IDENTIFIER (347) 225 403
PREC_BOT (258)
PREC_TOP (273)
REAL (270) 183 220 223 256 491 492
REPEAT_IDENTIFIER (259) 148 150
RESTNAME (359) 457
SCM_ARG (360) 25 205 245 264 315 316
SCM_FUNCTION (361) 40 277
SCM_IDENTIFIER (362) 22 23 189 208 229 250 346
SCM_TOKEN (363) 18 21 26 86 99
STRING (364) 50 190 197 209 230 251 327 339 341 343 349 406 433 461
SYMBOL_LIST (365) 192 193
TONICNAME_PITCH (366) 227 401
UNARY_MINUS (367)
UNSIGNED (271) 182 211 219 222 253 255 408 423 426 431 432 477 478

Nonterminals, with rules where they appear

assignment (146)
on left: 51 52 53, on right: 6 47 125
assignment_id (145)
on left: 50, on right: 51 52 53
bare_number (301)
on left: 494 495 496, on right: 347 348 489
bare_number_closed (302)
on left: 497 498, on right: 188
bass_number (277)
on left: 432 433 434 435, on right: 440
book_block (153)
on left: 77, on right: 11 32 55
bookpart_block (156)
on left: 91, on right: 12 33 56 81
br_bass_figure (281)
on left: 448 449, on right: 451
braced_music_list (173)
on left: 136, on right: 149 150 151 152 153
chord_body (244)
on left: 358 359, on right: 216 357
chord_body_element (246)
on left: 362 363 364, on right: 361
chord_body_elements (245)
on left: 360 361, on right: 358 361
chord_item (292)
on left: 472 473 474, on right: 467
chord_items (290)
on left: 466 467, on right: 465 467
chord_separator (291)
on left: 468 469 470 471, on right: 465 472
closed_music (189)
on left: 173 174 175, on right: 174 276
command_element (250)
on left: 370, on right: 355
command_event (251)
on left: 371, on right: 370
complex_music (214)
on left: 281 282 283 284, on right: 171
complex_music_prefix (215)
on left: 285 286, on right: 174 284
context_change (224)
on left: 305, on right: 157
context_def_spec_block (148)
on left: 67, on right: 31 58 122
context_mod (231)
on left: 326 327 328, on right: 74 168
context_mod_arg (149)
on left: 68 70, on right: 71
context_mod_embedded (151)
on left: 71, on right: 76 170
context_modification_arg (185)
on left: 163 164, on right: 162
context_prop_spec (234)
on left: 332, on right: 335 336
direction_less_event (256)
on left: 385 386 387 388, on right: 374 379
direction_reqd_event (257)
on left: 389 390, on right: 378
dots (275)
on left: 428 429, on right: 423 424 429
duration_length (270)
on left: 419, on right: 203 234 248
embedded_lilypond (142)
on left: 41 42 43 44 45, on right: 3 45
embedded_scm (139)
on left: 35 36, on right: 48 64 68 126 142 328 367 501
embedded_scm_active (137)
on left: 23 24, on right: 19 87 100 110
embedded_scm_arg (140)
on left: 37 38 39, on right: 201 241 345
embedded_scm_arg_closed (210)
on left: 274 275 276, on right: 187 214 260
embedded_scm_closed (209)
on left: 272 273, on right: 163 407 527
event_chord (242)
on left: 351 352 353 354 355 356, on right: 155
event_function_event (249)
on left: 369, on right: 388
exclamations (304)
on left: 502 503, on right: 362 455 503
figure_list (282)
on left: 450 451, on right: 451 452
figure_spec (283)
on left: 452, on right: 459
figured_bass_alteration (278)
on left: 436 437 438, on right: 442
figured_bass_modification (280)
on left: 444 445 446 447, on right: 443
fingering (267)
on left: 408, on right: 380 381 383
full_markup_list (306)
on left: 507, on right: 17 28 65 85 98
function_arglist (201)
on left: 236 237, on right: 40 278
function_arglist_closed (205)
on left: 257 258, on right: 277 368 369
gen_text_def (266)
on left: 405 406 407, on right: 389
grob_prop_path (233)
on left: 330 331, on right: 333
grob_prop_spec (232)
on left: 329, on right: 330 331
grouped_music_list (191)
on left: 179 180, on right: 178 287 288
lilypond (133)
on left: 4 5 6 7 8, on right: 1 5 6 7 8
on left: 49, on right: 10 89 102 107 112
on left: 46 47 48, on right: 47 48 49
lyric_element (287)
on left: 460 461 462, on right: 463
lyric_element_music (288)
on left: 463, on right: 138 141 206 246
markup (325)
on left: 539 540, on right: 523 530
markup_braced_list (316)
on left: 521, on right: 517
markup_braced_list_body (317)
on left: 522 523 524, on right: 521 523 524
markup_command_list (318)
on left: 525, on right: 518
markup_composed_list (315)
on left: 520, on right: 515
on left: 531, on right: 532 533
on left: 532 533, on right: 511 520 533 539
markup_list (313)
on left: 515 516, on right: 507 510 524 526
markup_scm (311)
on left: 514, on right: 519 538
markup_top (310)
on left: 510 511 512, on right: 509
markup_uncomposed_list (314)
on left: 517 518 519, on right: 516 520
maybe_notemode_duration (271)
on left: 420 421, on right: 422 455 464
mode_changed_music (216)
on left: 287 288, on right: 176
on left: 289 290 291 292 293, on right: 287
multiplied_duration (274)
on left: 425 426 427, on right: 419 421 426 427
music (174)
on left: 137 138, on right: 109 139 147 148 149 150 284 304
music_arg (177)
on left: 143 144, on right: 121 137
music_assign (178)
on left: 145 146, on right: 39 59 231
music_bare (190)
on left: 176 177 178, on right: 172 173
music_embedded (175)
on left: 139 140 141, on right: 43 134
music_embedded_backup (176)
on left: 142, on right: 140 141
music_function_call (212)
on left: 278, on right: 281 365
music_function_call_closed (248)
on left: 368, on right: 175 375
music_function_chord_body (247)
on left: 365 366 367, on right: 364
music_list (172)
on left: 133 134 135, on right: 43 134 135 136 154
music_or_context_def (168)
on left: 121 122, on right: 128
music_property_def (237)
on left: 338, on right: 156
new_chord (289)
on left: 464 465, on right: 458
new_lyrics (219)
on left: 299 301, on right: 301 302
note_chord_element (243)
on left: 357, on right: 356
number_expression (296)
on left: 482 483 484, on right: 61 482 483
number_factor (298)
on left: 488 489, on right: 485 486 487 488
number_term (297)
on left: 485 486 487, on right: 482 483 484
octave_check (258)
on left: 391 392, on right: 362 455
optional_context_mod (186)
on left: 165 166, on right: 285 286 288
optional_id (213)
on left: 279 280, on right: 285 286
optional_rest (284)
on left: 453 454, on right: 455
output_def (165)
on left: 116, on right: 20 34 57 108 113 115
on left: 117 118 119, on right: 120
on left: 120, on right: 123 124
paper_block (164)
on left: 115, on right: 80 94
pitch (264)
on left: 402 403, on right: 362 455
pitch_arg (265)
on left: 404, on right: 232
post_event (254)
on left: 382 383, on right: 373
property_operation (226)
on left: 308 309 310 311, on right: 326
property_path (225)
on left: 306 307, on right: 52 53 307 310 331
questions (305)
on left: 504 505, on right: 362 455 505
quotes (259)
on left: 393 394 395, on right: 392 400 401 403 404
re_rhythmed_music (222)
on left: 302 304, on right: 283
repeated_music (179)
on left: 147 148 149 150, on right: 282
revert_arg (227)
on left: 312, on right: 311 334
revert_arg_backup (228)
on left: 313, on right: 312 315 316
revert_arg_part (229)
on left: 314 315 316, on right: 313
scm_function_call (141)
on left: 40, on right: 24 36 38
scm_function_call_closed (211)
on left: 277, on right: 273 275
score_block (159)
on left: 104, on right: 14 30 54 82 95
on left: 105 107 108, on right: 107 108 109
script_dir (269)
on left: 416 417 418, on right: 375 378 379
sequential_music (180)
on left: 151 152, on right: 180
simple_chord_elements (286)
on left: 458 459, on right: 352
simple_element (285)
on left: 455 456 457, on right: 351
simple_markup (323)
on left: 534 536 537 538, on right: 511 512 539 540
simple_music (182)
on left: 155 156 157, on right: 143 145
simple_music_property_def (235)
on left: 333 334 335 336, on right: 338
simple_revert_context (236)
on left: 337, on right: 334
simple_string (239)
on left: 341 342, on right: 147 149 215 280 304 305
simultaneous_music (181)
on left: 153 154, on right: 179
start_symbol (131)
on left: 1 3, on right: 0
steno_duration (273)
on left: 423 424, on right: 130 131 425
steno_pitch (262)
on left: 400, on right: 402
steno_tonic_pitch (263)
on left: 401, on right: 464 465 470 471
step_number (294)
on left: 477 478 479, on right: 475 476
step_numbers (293)
on left: 475 476, on right: 473 476
string (238)
on left: 339 340, on right: 63
string_number_event (255)
on left: 384, on right: 385
sub_quotes (261)
on left: 398 399, on right: 394 399
sup_quotes (260)
on left: 396 397, on right: 395 397
symbol (240)
on left: 343 344, on right: 285 286 305 308 309
symbol_list_arg (194)
on left: 192 193, on right: 207 235 249 266 312
symbol_list_element (197)
on left: 197 198, on right: 196
symbol_list_part (196)
on left: 196, on right: 194 195 314 315 316 337
symbol_list_rev (195)
on left: 194 195, on right: 193 195 306 307 329 332
tempo_event (171)
on left: 130 131 132, on right: 371
tempo_range (295)
on left: 480 481, on right: 130 131
tremolo_type (276)
on left: 430 431, on right: 387
unsigned_number (303)
on left: 499 500 501, on right: 147 149 215 480 481
```