# 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"

10 toplevel_expression:  lilypond_header
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                      | partial_markup
29                      | full_markup_list
30                      | context_modification
31                      | score_block
32                      | context_def_spec_block
33                      | book_block
34                      | bookpart_block
35                      | output_def

36 embedded_scm: embedded_scm_bare
37             | scm_function_call

38 embedded_scm_arg: embedded_scm_bare_arg
39                 | scm_function_call
40                 | music_assign

41 scm_function_call: SCM_FUNCTION function_arglist

42 embedded_lilypond_number: '-' embedded_lilypond_number
43                         | bare_number_common
44                         | UNSIGNED NUMBER_IDENTIFIER

45 embedded_lilypond: /* empty */
46                  | identifier_init_nonumber
47                  | embedded_lilypond_number
48                  | post_event post_events
49                  | multiplied_duration
50                  | music_embedded music_embedded music_list
51                  | error
52                  | "\version-error" embedded_lilypond

53 lilypond_header_body: /* empty */
54                     | lilypond_header_body assignment
55                     | lilypond_header_body embedded_scm

56 lilypond_header: "\header" '{' lilypond_header_body '}'

57 assignment_id: STRING

58 assignment: assignment_id '=' identifier_init
59           | assignment_id property_path '=' identifier_init
60           | assignment_id '.' property_path '=' identifier_init

61 identifier_init: identifier_init_nonumber
62                | number_expression
63                | post_event_nofinger post_events

64 identifier_init_nonumber: score_block
65                         | book_block
66                         | bookpart_block
67                         | output_def
68                         | context_def_spec_block
69                         | music_assign
70                         | pitch_or_music
71                         | FRACTION
72                         | string
73                         | embedded_scm
74                         | partial_markup
75                         | full_markup_list
76                         | context_modification
77                         | partial_function "\etc"

78 partial_function: MUSIC_FUNCTION function_arglist_partial
79                 | EVENT_FUNCTION function_arglist_partial
80                 | SCM_FUNCTION function_arglist_partial
81                 | MUSIC_FUNCTION
"scheme?"
function_arglist_optional
partial_function
82                 | EVENT_FUNCTION
"scheme?"
function_arglist_optional
partial_function
83                 | SCM_FUNCTION
"scheme?"
function_arglist_optional
partial_function
84                 | MUSIC_FUNCTION
"optional?"
"scheme?"
function_arglist_nonbackup
partial_function
85                 | EVENT_FUNCTION
"optional?"
"scheme?"
function_arglist_nonbackup
partial_function
86                 | SCM_FUNCTION
"optional?"
"scheme?"
function_arglist_nonbackup
partial_function

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

88 context_mod_arg: embedded_scm

90 context_mod_arg:  composite_music

91 context_def_spec_body: /* empty */
92                      | context_def_spec_body context_mod
93                      | context_def_spec_body context_modification
94                      | context_def_spec_body context_mod_arg

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

96 book_body: /* empty */
97          | BOOK_IDENTIFIER
98          | book_body paper_block
99          | book_body bookpart_block
100          | book_body score_block
101          | book_body composite_music
102          | book_body full_markup
103          | book_body full_markup_list
104          | book_body SCM_TOKEN
105          | book_body embedded_scm_active

107 book_body: book_body  lilypond_header
108          | book_body error

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

110 bookpart_body: /* empty */
111              | BOOK_IDENTIFIER
112              | bookpart_body paper_block
113              | bookpart_body score_block
114              | bookpart_body composite_music
115              | bookpart_body full_markup
116              | bookpart_body full_markup_list
117              | bookpart_body SCM_TOKEN
118              | bookpart_body embedded_scm_active

120 bookpart_body: bookpart_body  lilypond_header
121              | bookpart_body error

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

123 score_body: score_items
124           | score_body error

125 score_item: embedded_scm
126           | music
127           | output_def

128 score_items: /* empty */
129            | score_items score_item

131 score_items: score_items  lilypond_header

132 paper_block: output_def

133 output_def: output_def_body '}'

134 output_def_head: "\paper"
135                | "\midi"
136                | "\layout"

137 output_def_head_with_mode_switch: output_def_head

138 music_or_context_def: music_assign
139                     | context_def_spec_block

140 output_def_body: output_def_head_with_mode_switch '{'
141                | output_def_body assignment
142                | output_def_body embedded_scm_active
143                | output_def_body SCM_TOKEN

145 output_def_body: output_def_body  music_or_context_def
146                | output_def_body error

147 tempo_event: "\tempo" steno_duration '=' tempo_range
148            | "\tempo" scalar steno_duration '=' tempo_range
149            | "\tempo" scalar

150 music_list: /* empty */
151           | music_list music_embedded
152           | music_list error

153 braced_music_list: '{' music_list '}'

154 music: music_assign
155      | lyric_element_music
156      | pitch_as_music

157 pitch_as_music: pitch_or_music

158 music_embedded: music
159               | music_embedded_backup
160               | music_embedded_backup
"(backed-up?)"
lyric_element_music
161               | multiplied_duration post_events

162 music_embedded_backup: embedded_scm

163 music_assign: simple_music
164             | composite_music

165 repeated_music: "\repeat" simple_string unsigned_number music
166               | "\repeat"
simple_string
unsigned_number
music
"\alternative"
braced_music_list

167 sequential_music: "\sequential" braced_music_list
168                 | braced_music_list

169 simultaneous_music: "\simultaneous" braced_music_list
170                   | "<<" music_list ">>"

171 simple_music: event_chord
172             | music_property_def
173             | context_change

175 context_modification: "\with"  '{' context_mod_list '}'
176                     | "\with" CONTEXT_MOD_IDENTIFIER
177                     | CONTEXT_MOD_IDENTIFIER
178                     | "\with" context_modification_arg

179 context_modification_arg: embedded_scm
180                         | MUSIC_IDENTIFIER

181 optional_context_mod: /* empty */
182                     | context_modification

183 context_mod_list: /* empty */
184                 | context_mod_list context_mod
185                 | context_mod_list CONTEXT_MOD_IDENTIFIER
186                 | context_mod_list context_mod_arg

187 context_prefix: "\context" symbol optional_id optional_context_mod
188               | "\new" symbol optional_id optional_context_mod

189 new_lyrics: "\addlyrics" lyric_mode_music
190           | new_lyrics "\addlyrics" lyric_mode_music

191 basic_music: music_function_call
192            | repeated_music
193            | music_bare
194            | "\lyricsto" simple_string lyric_mode_music
195            | "\lyricsto" symbol '=' simple_string lyric_mode_music

196 contextable_music: basic_music
197                  | pitch_as_music
198                  | event_chord

199 contexted_basic_music: context_prefix contextable_music new_lyrics
200                      | context_prefix contextable_music
201                      | context_prefix contexted_basic_music

202 composite_music: basic_music
203                | contexted_basic_music
204                | basic_music new_lyrics

205 music_bare: mode_changed_music
206           | MUSIC_IDENTIFIER
207           | grouped_music_list

208 grouped_music_list: simultaneous_music
209                   | sequential_music

210 symbol_list_arg: SYMBOL_LIST
211                | SYMBOL_LIST '.' symbol_list_rev

212 symbol_list_rev: symbol_list_part
213                | symbol_list_rev '.' symbol_list_part

214 symbol_list_part: symbol_list_element

215 symbol_list_element: STRING
216                    | embedded_scm_bare

217 function_arglist_nonbackup: function_arglist_common
218                           | "optional?"
"scheme?"
function_arglist_nonbackup
post_event_nofinger
219                           | "optional?"
"scheme?"
function_arglist_nonbackup
'-'
UNSIGNED
220                           | "optional?"
"scheme?"
function_arglist_nonbackup
'-'
REAL
221                           | "optional?"
"scheme?"
function_arglist_nonbackup
'-'
NUMBER_IDENTIFIER
222                           | "optional?"
"scheme?"
function_arglist_nonbackup
embedded_scm_arg
223                           | "optional?"
"scheme?"
function_arglist_nonbackup
bare_number_common
224                           | function_arglist_nonbackup_reparse
"(reparsed?)"
pitch_or_music
225                           | function_arglist_nonbackup_reparse
"(reparsed?)"
duration_length
226                           | function_arglist_nonbackup_reparse
"(reparsed?)"
bare_number_common
227                           | function_arglist_nonbackup_reparse
"(reparsed?)"
SCM_ARG
228                           | function_arglist_nonbackup_reparse
"(reparsed?)"
lyric_element_music
229                           | function_arglist_nonbackup_reparse
"(reparsed?)"
symbol_list_arg

230 function_arglist_nonbackup_reparse: "optional?"
"scheme?"
function_arglist_nonbackup
SCM_IDENTIFIER
231                                   | "optional?"
"scheme?"
function_arglist_nonbackup
pitch
232                                   | "optional?"
"scheme?"
function_arglist_nonbackup
steno_tonic_pitch
233                                   | "optional?"
"scheme?"
function_arglist_nonbackup
STRING
234                                   | "optional?"
"scheme?"
function_arglist_nonbackup
full_markup
235                                   | "optional?"
"scheme?"
function_arglist_nonbackup
UNSIGNED
236                                   | "optional?"
"scheme?"
function_arglist_nonbackup
DURATION_IDENTIFIER

237 function_arglist_backup: function_arglist_common
238                        | "optional?"
"scheme?"
function_arglist_backup
embedded_scm_arg
239                        | "optional?"
"scheme?"
function_arglist_backup
post_event_nofinger
240                        | "optional?"
"scheme?"
function_arglist_backup
pitch
241                        | "optional?"
"scheme?"
function_arglist_backup
steno_tonic_pitch
242                        | "optional?"
"scheme?"
function_arglist_backup
full_markup
243                        | "optional?"
"scheme?"
function_arglist_backup
UNSIGNED
244                        | "optional?"
"scheme?"
function_arglist_backup
REAL
245                        | "optional?"
"scheme?"
function_arglist_backup
NUMBER_IDENTIFIER
246                        | "optional?"
"scheme?"
function_arglist_backup
'-'
UNSIGNED
247                        | "optional?"
"scheme?"
function_arglist_backup
'-'
REAL
248                        | "optional?"
"scheme?"
function_arglist_backup
'-'
NUMBER_IDENTIFIER
249                        | "optional?"
"scheme?"
function_arglist_backup
DURATION_IDENTIFIER
250                        | "optional?"
"scheme?"
function_arglist_backup
SCM_IDENTIFIER
251                        | "optional?"
"scheme?"
function_arglist_backup
STRING
252                        | function_arglist_backup
"(reparsed?)"
pitch_or_music
253                        | function_arglist_backup
"(reparsed?)"
bare_number_common
254                        | function_arglist_backup
"(reparsed?)"
duration_length
255                        | function_arglist_backup
"(reparsed?)"
symbol_list_arg

256 function_arglist: function_arglist_nonbackup
257                 | "optional?"
"scheme?"
function_arglist_skip_nonbackup
"\default"

258 function_arglist_skip_nonbackup: function_arglist_nonbackup
259                                | "optional?"
"scheme?"
function_arglist_skip_nonbackup

260 function_arglist_partial: "scheme?" function_arglist_optional
261                         | "scheme?" function_arglist_partial_optional
262                         | "optional?"
"scheme?"
function_arglist_nonbackup
263                         | "optional?"
"scheme?"
function_arglist_partial

264 function_arglist_partial_optional: "scheme?" function_arglist_optional
265                                  | "scheme?"
function_arglist_partial_optional
266                                  | "optional?"
"scheme?"
function_arglist_backup
267                                  | "optional?"
"scheme?"
function_arglist_partial_optional

268 function_arglist_common: EXPECT_NO_MORE_ARGS
269                        | "scheme?"
function_arglist_optional
embedded_scm_arg
270                        | "scheme?"
function_arglist_optional
bare_number_common
271                        | "scheme?"
function_arglist_optional
post_event_nofinger
272                        | "scheme?"
function_arglist_optional
'-'
NUMBER_IDENTIFIER
273                        | function_arglist_common_reparse
"(reparsed?)"
SCM_ARG
274                        | function_arglist_common_reparse
"(reparsed?)"
lyric_element_music
275                        | function_arglist_common_reparse
"(reparsed?)"
pitch_or_music
276                        | function_arglist_common_reparse
"(reparsed?)"
bare_number_common
277                        | function_arglist_common_reparse
"(reparsed?)"
duration_length
278                        | function_arglist_common_reparse
"(reparsed?)"
symbol_list_arg

279 function_arglist_common_reparse: "scheme?"
function_arglist_optional
SCM_IDENTIFIER
280                                | "scheme?"
function_arglist_optional
pitch
281                                | "scheme?"
function_arglist_optional
steno_tonic_pitch
282                                | "scheme?"
function_arglist_optional
STRING
283                                | "scheme?"
function_arglist_optional
full_markup
284                                | "scheme?"
function_arglist_optional
UNSIGNED
285                                | "scheme?"
function_arglist_optional
DURATION_IDENTIFIER
286                                | "scheme?"
function_arglist_optional
'-'
UNSIGNED
287                                | "scheme?"
function_arglist_optional
'-'
REAL

288 function_arglist_optional: function_arglist_backup
289                          | "optional?"
"scheme?"
function_arglist_skip_backup
"\default"
290                          | function_arglist_skip_backup "(backed-up?)"

291 function_arglist_skip_backup: function_arglist_backup
292                             | "optional?"
"scheme?"
function_arglist_skip_backup

293 music_function_call: MUSIC_FUNCTION function_arglist

294 optional_id: /* empty */
295            | '=' simple_string

297 lyric_mode_music:  grouped_music_list
298                 | MUSIC_IDENTIFIER

299 mode_changed_music: mode_changing_head grouped_music_list
300                   | mode_changing_head_with_context
optional_context_mod
grouped_music_list

301 mode_changing_head: "\notemode"
302                   | "\drummode"
303                   | "\figuremode"
304                   | "\chordmode"
305                   | "\lyricmode"

306 mode_changing_head_with_context: "\drums"
307                                | "\figures"
308                                | "\chords"
309                                | "\lyrics"

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

311 property_path: symbol_list_rev
312              | symbol_list_rev property_path

313 property_operation: symbol '=' scalar
314                   | "\unset" symbol
315                   | "\override" property_path '=' scalar
316                   | "\revert" revert_arg

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

318 revert_arg_backup: revert_arg_part

319 revert_arg_part: symbol_list_part
320                | revert_arg_backup
"(backed-up?)"
SCM_ARG
'.'
symbol_list_part
321                | revert_arg_backup
"(backed-up?)"
SCM_ARG
symbol_list_part

322 context_def_mod: "\consists"
323                | "\remove"
324                | "\accepts"
325                | "\defaultchild"
326                | "\denies"
327                | "\alias"
328                | "\type"
329                | "\description"
330                | "\name"

331 context_mod: property_operation
332            | context_def_mod STRING
333            | context_def_mod embedded_scm

334 grob_prop_spec: symbol_list_rev

335 grob_prop_path: grob_prop_spec
336               | grob_prop_spec property_path

337 context_prop_spec: symbol_list_rev

338 simple_revert_context: symbol_list_part

339 music_property_def: "\override" grob_prop_path '=' scalar
340                   | "\revert" simple_revert_context revert_arg
341                   | "\set" context_prop_spec '=' scalar
342                   | "\unset" context_prop_spec

343 string: STRING
344       | full_markup

345 simple_string: STRING
346              | embedded_scm_bare

347 symbol: STRING
348       | embedded_scm_bare

349 scalar: embedded_scm_arg
350       | pitch_or_music
351       | SCM_IDENTIFIER
352       | bare_number
353       | '-' bare_number
354       | string

355 event_chord: simple_element post_events
356            | CHORD_REPETITION optional_notemode_duration post_events
357            | MULTI_MEASURE_REST optional_notemode_duration post_events
358            | tempo_event
359            | note_chord_element

360 note_chord_element: chord_body optional_notemode_duration post_events

361 chord_body: "<" chord_body_elements ">"
362           | FIGURE_OPEN figure_list FIGURE_CLOSE

363 chord_body_elements: /* empty */
364                    | chord_body_elements chord_body_element

365 chord_body_element: pitch_or_tonic_pitch
exclamations
questions
octave_check
post_events
366                   | DRUM_PITCH post_events
367                   | music_function_chord_body

368 music_function_chord_body: music_function_call
369                          | MUSIC_IDENTIFIER
370                          | embedded_scm

371 event_function_event: EVENT_FUNCTION function_arglist

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

374 post_event_nofinger: direction_less_event
375                    | script_dir music_function_call
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_or_tonic_pitch: pitch
405                     | steno_tonic_pitch

406 gen_text_def: full_markup
407             | STRING
408             | embedded_scm

409 fingering: UNSIGNED

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

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

420 duration_length: multiplied_duration

421 maybe_notemode_duration: /* empty */
422                        | multiplied_duration

423 optional_notemode_duration: maybe_notemode_duration

424 steno_duration: UNSIGNED dots
425               | DURATION_IDENTIFIER dots

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

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

431 tremolo_type: ':'
432             | ':' UNSIGNED

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

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

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

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

449 br_bass_figure: bass_figure
450               | '[' bass_figure

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

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

455 pitch_or_music: pitch
exclamations
questions
octave_check
maybe_notemode_duration
optional_rest
post_events
456               | new_chord post_events

457 simple_element: DRUM_PITCH optional_notemode_duration
458               | RESTNAME optional_notemode_duration

459 lyric_element: full_markup
460              | STRING
461              | LYRIC_ELEMENT

462 lyric_element_music: lyric_element
optional_notemode_duration
post_events

463 new_chord: steno_tonic_pitch maybe_notemode_duration
464          | steno_tonic_pitch
optional_notemode_duration
chord_separator
chord_items

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

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

471 chord_item: chord_separator
472           | step_numbers
473           | CHORD_MODIFIER

474 step_numbers: step_number
475             | step_numbers '.' step_number

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

479 tempo_range: unsigned_number
480            | unsigned_number '-' unsigned_number

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

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

487 number_factor: '-' number_factor
488              | bare_number

489 bare_number_common: REAL
490                   | NUMBER_IDENTIFIER
491                   | REAL NUMBER_IDENTIFIER

492 bare_number: bare_number_common
493            | UNSIGNED
494            | UNSIGNED NUMBER_IDENTIFIER

495 unsigned_number: UNSIGNED
496                | NUMBER_IDENTIFIER
497                | embedded_scm

498 exclamations: /* empty */
499             | exclamations '!'

500 questions: /* empty */
501          | questions '?'

503 full_markup_list: "\markuplist" 0 markup_list

504 markup_mode: "\markup"

505 full_markup: markup_mode markup_top

506 partial_markup: markup_mode markup_head_1_list "\etc"

507 markup_top: markup_list
508           | markup_head_1_list simple_markup
509           | simple_markup

511 markup_scm: embedded_scm_bare 1 "(backed-up?)"

512 markup_list: markup_composed_list
513            | markup_uncomposed_list

514 markup_uncomposed_list: markup_braced_list
515                       | markup_command_list
516                       | markup_scm MARKUPLIST_IDENTIFIER

518 markup_uncomposed_list: "\score-lines" 2 '{' score_body '}'

519 markup_composed_list: markup_head_1_list markup_uncomposed_list

520 markup_braced_list: '{' markup_braced_list_body '}'

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

524 markup_command_list: MARKUP_LIST_FUNCTION markup_command_list_arguments

525 markup_command_basic_arguments: "markup-list?"
markup_command_list_arguments
markup_list
526                               | "scheme?"
markup_command_list_arguments
embedded_scm
527                               | EXPECT_NO_MORE_ARGS

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

530 markup_head_1_item: MARKUP_FUNCTION
"markup?"
markup_command_list_arguments

531 markup_head_1_list: markup_head_1_item
532                   | markup_head_1_list markup_head_1_item

533 simple_markup: STRING

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

538 markup: markup_head_1_list simple_markup
539       | simple_markup

Terminals, with rules where they appear

233 234 235 236 238 239 240 241 242 243 244 245 246 247 248 249
234 235 236 238 239 240 241 242 243 244 245 246 247 248 249 250
250 251 257 259 260 261 262 263 264 265 266 267 269 270 271 272
251 257 259 262 263 266 267 289 292
275 276 277 278
279 280 281 282 283 284 285 286 287 289 292 526
478 493 494 495
480 482 487
"#{" (340) 3
"(backed-up?)" (335) 160 290 317 320 321 511
"(reparsed?)" (336) 224 225 226 227 228 229 252 253 254 255 273 274
"-" (320) 478
"--" (265) 376
"/" (321) 469
"/+" (317) 470
":" (319) 467
"<" (322) 361
"<<" (324) 170
">" (323) 361 414
">>" (325) 170
"\!" (327) 446
"\" (326) 448
"\+" (328) 445
"\accepts" (273) 324
"\addlyrics" (262) 189 190
"\alias" (274) 327
"\alternative" (260) 166
"\book" (275) 95
"\bookpart" (276) 109
"\change" (277) 310
"\chordmode" (278) 304
"\chords" (279) 308
"\consists" (280) 322
"\context" (281) 87 187
"\default" (282) 257 289
"\defaultchild" (283) 325
"\denies" (284) 326
"\description" (285) 329
"\drummode" (286) 302
"\drums" (287) 306
"\etc" (288) 77 506
"\figuremode" (289) 303
"\figures" (290) 307
"\header" (291) 56
"\layout" (293) 136
"\lyricmode" (294) 305
"\lyrics" (295) 309
"\lyricsto" (296) 194 195
"\markup" (297) 504
"\markuplist" (298) 503
"\midi" (299) 135
"\name" (300) 330
"\new" (316) 188
"\notemode" (301) 301
"\override" (302) 315 339
"\paper" (303) 134
"\remove" (304) 323
"\repeat" (259) 165 166
"\rest" (305) 454
"\revert" (306) 316 340
"\score" (307) 122 535
"\score-lines" (308) 518
"\sequential" (309) 167
"\set" (310) 341
"\simultaneous" (311) 169
"\tempo" (312) 147 148 149
"\type" (313) 328
"\unset" (314) 314 342
"\version-error" (292) 8 52
"\with" (315) 175 176 178
"^" (318) 468
"_" (331) 440
"__" (264) 377
"end of input" (0) 0
"markup-list?" (337) 525
"markup?" (333) 529 530
"optional?" (338) 84 85 86 218 219 220 221 222 223 230 231 232 233
"scheme?" (334) 81 82 83 84 85 86 218 219 220 221 222 223 230 231 232
'!' (33) 413 439 499
''' (39) 396 397
'*' (42) 427 428 485
'+' (43) 411 438 477 481
',' (44) 398 399
'-' (45) 42 219 220 221 246 247 248 272 286 287 353 383 412 419 437
'.' (46) 60 211 213 320 415 430 475
'/' (47) 447 486
':' (58) 431 432
'=' (61) 58 59 60 147 148 195 295 310 313 315 339 341 392
'?' (63) 501
'[' (91) 450
']' (93) 442
'^' (94) 380 410 418
'_' (95) 381 416 417
'{' (123) 56 87 95 109 122 140 153 175 518 520 535
'}' (125) 56 87 95 109 122 133 153 175 518 520 535
BOOK_IDENTIFIER (341) 13 97 111
CHORD_MODIFIER (342) 473
CHORD_REPETITION (343) 356
COMPOSITE (261)
CONTEXT_MOD_IDENTIFIER (344) 176 177 185
DRUM_PITCH (345) 366 457
DURATION_IDENTIFIER (263) 236 249 285 425
E_UNSIGNED (268) 384
error (256) 7 51 108 121 124 146 152
EVENT_FUNCTION (266) 79 82 85 371
EVENT_IDENTIFIER (267) 386
EXPECT_NO_MORE_ARGS (339) 268 527
FIGURE_CLOSE (329) 362
FIGURE_OPEN (330) 362
FRACTION (347) 27 71 428
LYRIC_ELEMENT (348) 461
MARKUP_FUNCTION (349) 530 536
MARKUP_IDENTIFIER (351) 537
MARKUP_LIST_FUNCTION (350) 524
MARKUPLIST_IDENTIFIER (352) 516
MULTI_MEASURE_REST (332) 357
MUSIC_FUNCTION (353) 78 81 84 293
MUSIC_IDENTIFIER (354) 180 206 298 369
NOTENAME_PITCH (355) 400
NUMBER_IDENTIFIER (271) 44 221 245 248 272 490 491 494 496
PITCH_IDENTIFIER (346) 403
PREC_BOT (258)
PREC_TOP (272)
REAL (269) 220 244 247 287 489 491
RESTNAME (356) 458
SCM_ARG (357) 25 227 273 320 321
SCM_FUNCTION (358) 41 80 83 86
SCM_IDENTIFIER (359) 22 23 230 250 279 351
SCM_TOKEN (360) 18 21 26 104 117 143
STRING (361) 57 215 233 251 282 332 343 345 347 407 434 460 533
SYMBOL_LIST (362) 210 211
TONICNAME_PITCH (363) 401
UNARY_MINUS (364)
UNSIGNED (270) 44 219 235 243 246 284 286 409 424 427 432 433 476 477

Nonterminals, with rules where they appear

assignment (144)
on left: 58 59 60, on right: 6 54 141
assignment_id (143)
on left: 57, on right: 58 59 60
bare_number (288)
on left: 492 493 494, on right: 352 353 488
basic_music (189)
on left: 191 192 193 194 195, on right: 196 202 204
bass_number (266)
on left: 433 434 435 436, on right: 441
book_block (152)
on left: 95, on right: 11 33 65
bookpart_block (155)
on left: 109, on right: 12 34 66 99
br_bass_figure (270)
on left: 449 450, on right: 452
braced_music_list (172)
on left: 153, on right: 166 167 168 169
chord_body (236)
on left: 361 362, on right: 360
chord_body_element (238)
on left: 365 366 367, on right: 364
chord_body_elements (237)
on left: 363 364, on right: 361 364
chord_item (280)
on left: 471 472 473, on right: 466
chord_items (278)
on left: 465 466, on right: 464 466
chord_separator (279)
on left: 467 468 469 470, on right: 464 471
composite_music (192)
on left: 202 203 204, on right: 15 90 101 114 164
context_change (217)
on left: 310, on right: 173
context_def_spec_block (148)
on left: 87, on right: 32 68 139
context_def_spec_body (151)
on left: 91 92 93 94, on right: 87 92 93 94
context_mod (224)
on left: 331 332 333, on right: 92 184
context_mod_arg (149)
on left: 88 90, on right: 94 186
context_modification_arg (184)
on left: 179 180, on right: 178
context_prefix (187)
on left: 187 188, on right: 199 200 201
context_prop_spec (227)
on left: 337, on right: 341 342
contextable_music (190)
on left: 196 197 198, on right: 199 200
contexted_basic_music (191)
on left: 199 200 201, on right: 201 203
direction_less_event (245)
on left: 385 386 387 388, on right: 374 379
direction_reqd_event (246)
on left: 389 390, on right: 378
dots (264)
on left: 429 430, on right: 424 425 430
duration_length (259)
on left: 420, on right: 225 254 277
embedded_lilypond (140)
on left: 45 46 47 48 49 50 51 52, on right: 3 52
embedded_lilypond_number (139)
on left: 42 43 44, on right: 42 47
embedded_scm_active (134)
on left: 23 24, on right: 19 105 118 142
embedded_scm_arg (137)
on left: 38 39 40, on right: 222 238 269 349
embedded_scm_bare (133)
on left: 21 22, on right: 36 216 346 348 436 511
event_chord (234)
on left: 355 356 357 358 359, on right: 171 198
event_function_event (240)
on left: 371, on right: 388
exclamations (290)
on left: 498 499, on right: 365 455 499
figure_list (271)
on left: 451 452, on right: 362 452
figured_bass_alteration (267)
on left: 437 438 439, on right: 443
figured_bass_modification (269)
on left: 445 446 447 448, on right: 444
fingering (256)
on left: 409, on right: 380 381 383
full_markup_list (292)
on left: 503, on right: 17 29 75 103 116
function_arglist (202)
on left: 256 257, on right: 41 293 371
function_arglist_skip_nonbackup (203)
on left: 258 259, on right: 257 259
gen_text_def (255)
on left: 406 407 408, on right: 389
grob_prop_path (226)
on left: 335 336, on right: 339
grob_prop_spec (225)
on left: 334, on right: 335 336
grouped_music_list (194)
on left: 208 209, on right: 207 297 299 300
identifier_init (145)
on left: 61 62 63, on right: 58 59 60
lilypond (130)
on left: 4 5 6 7 8, on right: 1 5 6 7 8
lilypond_header (142)
on left: 56, on right: 10 107 120 131
lilypond_header_body (141)
on left: 53 54 55, on right: 54 55 56
lyric_element (275)
on left: 459 460 461, on right: 462
lyric_element_music (276)
on left: 462, on right: 155 160 228 274
lyric_mode_music (212)
on left: 297 298, on right: 189 190 194 195
markup (313)
on left: 538 539, on right: 522 529
markup_braced_list (304)
on left: 520, on right: 514
markup_braced_list_body (305)
on left: 521 522 523, on right: 520 522 523
markup_command_list (306)
on left: 524, on right: 515
markup_composed_list (303)
on left: 519, on right: 512
markup_head_1_item (309)
on left: 530, on right: 531 532
markup_head_1_list (310)
on left: 531 532, on right: 506 508 519 532 538
markup_list (300)
on left: 512 513, on right: 503 507 523 525
markup_mode (294)
on left: 504, on right: 505 506
markup_scm (298)
on left: 511, on right: 516 537
markup_top (297)
on left: 507 508 509, on right: 505
markup_uncomposed_list (301)
on left: 514 515 516 518, on right: 513 519
maybe_notemode_duration (260)
on left: 421 422, on right: 423 455 463
mode_changed_music (214)
on left: 299 300, on right: 205
mode_changing_head (215)
on left: 301 302 303 304 305, on right: 299
music (173)
on left: 154 155 156, on right: 126 158 165 166
music_assign (177)
on left: 163 164, on right: 40 69 138 154
music_bare (193)
on left: 205 206 207, on right: 193
music_embedded (175)
on left: 158 159 160 161, on right: 50 151
music_embedded_backup (176)
on left: 162, on right: 159 160
music_function_call (210)
on left: 293, on right: 191 368 375
music_function_chord_body (239)
on left: 368 369 370, on right: 367
music_list (171)
on left: 150 151 152, on right: 50 151 152 153 170
music_or_context_def (167)
on left: 138 139, on right: 145
music_property_def (229)
on left: 339 340 341 342, on right: 172
new_chord (277)
on left: 463 464, on right: 456
new_lyrics (188)
on left: 189 190, on right: 190 199 204
note_chord_element (235)
on left: 360, on right: 359
number_expression (284)
on left: 481 482 483, on right: 62 481 482
number_factor (286)
on left: 487 488, on right: 484 485 486 487
number_term (285)
on left: 484 485 486, on right: 481 482 483
octave_check (247)
on left: 391 392, on right: 365 455
optional_context_mod (185)
on left: 181 182, on right: 187 188 300
optional_id (211)
on left: 294 295, on right: 187 188
optional_rest (272)
on left: 453 454, on right: 455
output_def (164)
on left: 133, on right: 20 35 67 127 132
output_def_head (165)
on left: 134 135 136, on right: 137
output_def_head_with_mode_switch (166)
on left: 137, on right: 140
paper_block (163)
on left: 132, on right: 98 112
partial_markup (296)
on left: 506, on right: 28 74
pitch (253)
on left: 402 403, on right: 231 240 280 404 455
pitch_as_music (174)
on left: 157, on right: 156 197
pitch_or_music (273)
on left: 455 456, on right: 70 157 224 252 275 350
pitch_or_tonic_pitch (254)
on left: 404 405, on right: 365
post_event (243)
on left: 382 383, on right: 48 373
property_operation (219)
on left: 313 314 315 316, on right: 331
property_path (218)
on left: 311 312, on right: 59 60 312 315 336
questions (291)
on left: 500 501, on right: 365 455 501
quotes (248)
on left: 393 394 395, on right: 392 400 401 403
repeated_music (178)
on left: 165 166, on right: 192
revert_arg (220)
on left: 317, on right: 316 340
revert_arg_backup (221)
on left: 318, on right: 317 320 321
revert_arg_part (222)
on left: 319 320 321, on right: 318
scm_function_call (138)
on left: 41, on right: 24 37 39
score_block (158)
on left: 122, on right: 14 31 64 100 113
score_body (159)
on left: 123 124, on right: 122 124 518 535
score_item (160)
on left: 125 126 127, on right: 129
score_items (161)
on left: 128 129 131, on right: 123 129 131
script_dir (258)
on left: 417 418 419, on right: 375 378 379
sequential_music (179)
on left: 167 168, on right: 209
simple_element (274)
on left: 457 458, on right: 355
simple_markup (311)
on left: 533 535 536 537, on right: 508 509 538 539
simple_music (181)
on left: 171 172 173, on right: 163
simple_revert_context (228)
on left: 338, on right: 340
simple_string (231)
on left: 345 346, on right: 165 166 194 195 295 310
simultaneous_music (180)
on left: 169 170, on right: 208
start_symbol (128)
on left: 1 3, on right: 0
steno_duration (262)
on left: 424 425, on right: 147 148 426
steno_pitch (251)
on left: 400, on right: 402
step_number (282)
on left: 476 477 478, on right: 474 475
step_numbers (281)
on left: 474 475, on right: 472 475
string (230)
on left: 343 344, on right: 72 354
string_number_event (244)
on left: 384, on right: 385
sub_quotes (250)
on left: 398 399, on right: 394 399
sup_quotes (249)
on left: 396 397, on right: 395 397
symbol (232)
on left: 347 348, on right: 187 188 195 310 313 314
symbol_list_arg (195)
on left: 210 211, on right: 229 255 278 317
symbol_list_element (198)
on left: 215 216, on right: 214
symbol_list_part (197)
on left: 214, on right: 212 213 319 320 321 338
symbol_list_rev (196)
on left: 212 213, on right: 211 213 311 312 334 337
tempo_event (170)
on left: 147 148 149, on right: 358
tempo_range (283)
on left: 479 480, on right: 147 148
tremolo_type (265)
on left: 431 432, on right: 387
unsigned_number (289)
on left: 495 496 497, on right: 165 166 479 480
```
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9958428740501404, "perplexity": 13630.001494807673}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-32/segments/1438042982013.25/warc/CC-MAIN-20150728002302-00206-ip-10-236-191-2.ec2.internal.warc.gz"}