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                    | score_block
   14                    | composite_music
   15                    | full_markup
   16                    | full_markup_list
   17                    | SCM_TOKEN
   18                    | embedded_scm_active
   19                    | output_def

   20 embedded_scm_bare: SCM_TOKEN
   21                  | SCM_IDENTIFIER

   22 embedded_scm_active: SCM_IDENTIFIER
   23                    | scm_function_call

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

   33 embedded_scm: embedded_scm_bare
   34             | scm_function_call

   35 embedded_scm_arg: embedded_scm_bare_arg
   36                 | scm_function_call
   37                 | music_arg

   38 scm_function_call: SCM_FUNCTION function_arglist

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

   44 lilypond_header_body: /* empty */
   45                     | lilypond_header_body assignment
   46                     | lilypond_header_body embedded_scm

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

   48 assignment_id: STRING

   49 assignment: assignment_id '=' identifier_init
   50           | assignment_id property_path '=' identifier_init

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

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

   65 context_mod_arg: embedded_scm

   67 context_mod_arg:  composite_music

   68 context_mod_embedded: context_mod_arg

   69 context_def_spec_body: /* empty */
   70                      | CONTEXT_DEF_IDENTIFIER
   71                      | context_def_spec_body context_mod
   72                      | context_def_spec_body context_modification
   73                      | context_def_spec_body context_mod_embedded

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

   75 book_body: /* empty */
   76          | BOOK_IDENTIFIER
   77          | book_body paper_block
   78          | book_body bookpart_block
   79          | book_body score_block
   80          | book_body composite_music
   81          | book_body full_markup
   82          | book_body full_markup_list
   83          | book_body SCM_TOKEN
   84          | book_body embedded_scm_active

   86 book_body: book_body  lilypond_header
   87          | book_body error

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

   89 bookpart_body: /* empty */
   90              | BOOK_IDENTIFIER
   91              | bookpart_body paper_block
   92              | bookpart_body score_block
   93              | bookpart_body composite_music
   94              | bookpart_body full_markup
   95              | bookpart_body full_markup_list
   96              | bookpart_body SCM_TOKEN
   97              | bookpart_body embedded_scm_active

   99 bookpart_body: bookpart_body  lilypond_header
  100              | bookpart_body error

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

  102 score_body: music
  103           | embedded_scm_active

  105 score_body: score_body  lilypond_header
  106           | score_body output_def
  107           | score_body error

  108 paper_block: output_def

  109 output_def: output_def_body '}'

  110 output_def_head: "\paper"
  111                | "\midi"
  112                | "\layout"

  113 output_def_head_with_mode_switch: output_def_head

  114 music_or_context_def: music_arg
  115                     | context_def_spec_block

  116 output_def_body: output_def_head_with_mode_switch '{'
  117                | output_def_head_with_mode_switch 
                         '{' 
                         OUTPUT_DEF_IDENTIFIER 
  118                | output_def_body assignment
  119                | output_def_body embedded_scm

  121 output_def_body: output_def_body  music_or_context_def
  122                | output_def_body error

  123 tempo_event: "\tempo" steno_duration '=' tempo_range
  124            | "\tempo" scalar_closed steno_duration '=' tempo_range
  125            | "\tempo" scalar

  126 music_list: /* empty */
  127           | music_list music_embedded
  128           | music_list error

  129 braced_music_list: '{' music_list '}'

  130 music: music_arg
  131      | lyric_element_music

  132 music_embedded: music
  133               | music_embedded_backup
  134               | music_embedded_backup 
                        "(backed-up?)" 
                        lyric_element_music 

  135 music_embedded_backup: embedded_scm

  136 music_arg: simple_music
  137          | composite_music

  138 music_assign: simple_music
  139             | composite_music

  140 repeated_music: "\repeat" simple_string unsigned_number music
  141               | "\repeat" 
                        simple_string 
                        unsigned_number 
                        music 
                        "\alternative" 
                        braced_music_list 

  142 sequential_music: "\sequential" braced_music_list
  143                 | braced_music_list

  144 simultaneous_music: "\simultaneous" braced_music_list
  145                   | "<<" music_list ">>"

  146 simple_music: event_chord
  147             | music_property_def
  148             | context_change

  150 context_modification: "\with"  '{' context_mod_list '}'
  151                     | "\with" CONTEXT_MOD_IDENTIFIER
  152                     | CONTEXT_MOD_IDENTIFIER
  153                     | "\with" context_modification_arg

  154 context_modification_arg: embedded_scm_closed
  155                         | MUSIC_IDENTIFIER

  156 optional_context_mod: /* empty */
  157                     | context_modification

  158 context_mod_list: /* empty */
  159                 | context_mod_list context_mod
  160                 | context_mod_list CONTEXT_MOD_IDENTIFIER
  161                 | context_mod_list context_mod_embedded

  162 composite_music: complex_music
  163                | music_bare

  164 closed_music: music_bare
  165             | complex_music_prefix closed_music
  166             | music_function_call_closed

  167 music_bare: mode_changed_music
  168           | MUSIC_IDENTIFIER
  169           | grouped_music_list

  170 grouped_music_list: simultaneous_music
  171                   | sequential_music

  172 function_arglist_skip: function_arglist_common
  173                      | "optional?" "ly:pitch?" function_arglist_skip
  174                      | "optional?" "ly:duration?" function_arglist_skip
  175                      | "optional?" "scheme?" function_arglist_skip

  176 function_arglist_nonbackup_common: "optional?" 
                                           "ly:pitch?" 
                                           function_arglist 
                                           pitch_also_in_chords 
  177                                  | "optional?" 
                                           "ly:duration?" 
                                           function_arglist_closed 
                                           duration_length 
  178                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist 
                                           FRACTION 
  179                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_closed 
                                           post_event_nofinger 
  180                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_closed 
                                           '-' 
                                           UNSIGNED 
  181                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_closed 
                                           '-' 
                                           REAL 
  182                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_closed 
                                           '-' 
                                           NUMBER_IDENTIFIER 

  183 function_arglist_closed_nonbackup: function_arglist_nonbackup_common
  184                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist 
                                           embedded_scm_arg_closed 
  185                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_closed 
                                           bare_number_closed 
  186                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist 
                                           SCM_IDENTIFIER 
  187                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist 
                                           STRING 
  188                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist 
                                           full_markup 

  189 symbol_list_arg: SYMBOL_LIST
  190                | SYMBOL_LIST '.' symbol_list_rev

  191 symbol_list_rev: symbol_list_part
  192                | symbol_list_rev '.' symbol_list_part

  193 symbol_list_part: symbol_list_element

  194 symbol_list_element: STRING
  195                    | embedded_scm_bare

  196 function_arglist_nonbackup: function_arglist_nonbackup_common
  197                           | "optional?" 
                                    "scheme?" 
                                    function_arglist 
                                    embedded_scm_arg 
  198                           | "optional?" 
                                    "scheme?" 
                                    function_arglist_closed 
                                    bare_number 
  199                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    SCM_ARG 
  200                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    lyric_element_music 
  201                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    symbol_list_arg 

  202 function_arglist_nonbackup_reparse: "optional?" 
                                            "scheme?" 
                                            function_arglist 
                                            SCM_IDENTIFIER 
  203                                   | "optional?" 
                                            "scheme?" 
                                            function_arglist 
                                            STRING 
  204                                   | "optional?" 
                                            "scheme?" 
                                            function_arglist 
                                            full_markup 

  205 function_arglist_keep: function_arglist_common
  206                      | function_arglist_backup

  207 function_arglist_closed_keep: function_arglist_closed_common
  208                             | function_arglist_backup

  209 function_arglist_backup: "optional?" 
                                 "scheme?" 
                                 function_arglist_keep 
                                 embedded_scm_arg_closed 
  210                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_closed_keep 
                                 post_event_nofinger 
  211                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_keep 
                                 full_markup 
  212                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_closed_keep 
                                 UNSIGNED 
  213                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_closed_keep 
                                 REAL 
  214                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_closed_keep 
                                 NUMBER_IDENTIFIER 
  215                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_keep 
                                 FRACTION 
  216                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_closed_keep 
                                 '-' 
                                 UNSIGNED 
  217                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_closed_keep 
                                 '-' 
                                 REAL 
  218                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_closed_keep 
                                 '-' 
                                 NUMBER_IDENTIFIER 
  219                        | "optional?" 
                                 "ly:pitch?" 
                                 function_arglist_keep 
                                 pitch_also_in_chords 
  220                        | "optional?" 
                                 "ly:duration?" 
                                 function_arglist_closed_keep 
                                 duration_length 
  221                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_keep 
                                 SCM_IDENTIFIER 
  222                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_keep 
                                 STRING 
  223                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 "(backed-up?)" 
  224                        | function_arglist_backup 
                                 "(reparsed?)" 
                                 bare_number 
  225                        | function_arglist_backup 
                                 "(reparsed?)" 
                                 symbol_list_arg 

  226 function_arglist: function_arglist_common
  227                 | function_arglist_nonbackup

  228 function_arglist_common: function_arglist_bare
  229                        | "scheme?" 
                                 function_arglist_optional 
                                 embedded_scm_arg 
  230                        | "scheme?" 
                                 function_arglist_closed_optional 
                                 bare_number 
  231                        | "scheme?" function_arglist_optional FRACTION
  232                        | "scheme?" 
                                 function_arglist_closed_optional 
                                 post_event_nofinger 
  233                        | "scheme?" 
                                 function_arglist_closed_optional 
                                 '-' 
                                 NUMBER_IDENTIFIER 
  234                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 SCM_ARG 
  235                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 lyric_element_music 
  236                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 bare_number 
  237                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 symbol_list_arg 

  238 function_arglist_common_reparse: "scheme?" 
                                         function_arglist_optional 
                                         SCM_IDENTIFIER 
  239                                | "scheme?" 
                                         function_arglist_optional 
                                         STRING 
  240                                | "scheme?" 
                                         function_arglist_optional 
                                         full_markup 
  241                                | "scheme?" 
                                         function_arglist_closed_optional 
                                         '-' 
                                         UNSIGNED 
  242                                | "scheme?" 
                                         function_arglist_closed_optional 
                                         '-' 
                                         REAL 

  243 function_arglist_closed: function_arglist_closed_common
  244                        | function_arglist_closed_nonbackup

  245 function_arglist_closed_common: function_arglist_bare
  246                               | "scheme?" 
                                        function_arglist_optional 
                                        embedded_scm_arg_closed 
  247                               | "scheme?" 
                                        function_arglist_closed_optional 
                                        bare_number 
  248                               | "scheme?" 
                                        function_arglist_closed_optional 
                                        '-' 
                                        NUMBER_IDENTIFIER 
  249                               | "scheme?" 
                                        function_arglist_closed_optional 
                                        post_event_nofinger 
  250                               | "scheme?" 
                                        function_arglist_optional 
                                        FRACTION 
  251                               | function_arglist_common_reparse 
                                        "(reparsed?)" 
                                        SCM_ARG 
  252                               | function_arglist_common_reparse 
                                        "(reparsed?)" 
                                        bare_number 
  253                               | function_arglist_common_reparse 
                                        "(reparsed?)" 
                                        symbol_list_arg 

  254 function_arglist_optional: function_arglist_keep
  255                          | function_arglist_backup "(backed-up?)"
  256                          | "optional?" 
                                   "ly:pitch?" 
                                   function_arglist_optional 
  257                          | "optional?" 
                                   "ly:duration?" 
                                   function_arglist_optional 

  258 function_arglist_closed_optional: function_arglist_closed_keep
  259                                 | function_arglist_backup 
                                          "(backed-up?)" 
  260                                 | "optional?" 
                                          "ly:pitch?" 
                                          function_arglist_closed_optional 
  261                                 | "optional?" 
                                          "ly:duration?" 
                                          function_arglist_closed_optional 

  262 embedded_scm_closed: embedded_scm_bare
  263                    | scm_function_call_closed

  264 embedded_scm_arg_closed: embedded_scm_bare_arg
  265                        | scm_function_call_closed
  266                        | closed_music

  267 scm_function_call_closed: SCM_FUNCTION function_arglist_closed

  268 function_arglist_bare: EXPECT_NO_MORE_ARGS
  269                      | "ly:pitch?" 
                               function_arglist_optional 
                               pitch_also_in_chords 
  270                      | "ly:duration?" 
                               function_arglist_closed_optional 
                               duration_length 
  271                      | "optional?" 
                               "ly:pitch?" 
                               function_arglist_skip 
                               "\default" 
  272                      | "optional?" 
                               "ly:duration?" 
                               function_arglist_skip 
                               "\default" 
  273                      | "optional?" 
                               "scheme?" 
                               function_arglist_skip 
                               "\default" 

  274 music_function_call: MUSIC_FUNCTION function_arglist

  275 optional_id: /* empty */
  276            | '=' simple_string

  277 complex_music: music_function_call
  278              | repeated_music
  279              | re_rhythmed_music
  280              | complex_music_prefix music

  281 complex_music_prefix: "\context" 
                              symbol 
                              optional_id 
                              optional_context_mod 
  282                     | "\new" symbol optional_id optional_context_mod

  283 mode_changed_music: mode_changing_head grouped_music_list
  284                   | mode_changing_head_with_context 
                            optional_context_mod 
                            grouped_music_list 

  285 mode_changing_head: "\notemode"
  286                   | "\drummode"
  287                   | "\figuremode"
  288                   | "\chordmode"
  289                   | "\lyricmode"

  290 mode_changing_head_with_context: "\drums"
  291                                | "\figures"
  292                                | "\chords"
  293                                | "\lyrics"

  295 new_lyrics: "\addlyrics"  composite_music

  297 new_lyrics: new_lyrics "\addlyrics" 0 composite_music

  298 re_rhythmed_music: composite_music new_lyrics

  300 re_rhythmed_music: "\lyricsto" simple_string 1 music

  301 context_change: "\change" STRING '=' STRING

  302 property_path: symbol_list_rev
  303              | symbol_list_rev property_path

  304 property_operation: symbol '=' scalar
  305                   | "\unset" symbol
  306                   | "\override" property_path '=' scalar
  307                   | "\revert" revert_arg

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

  309 revert_arg_backup: revert_arg_part

  310 revert_arg_part: symbol_list_part
  311                | revert_arg_backup 
                         "(backed-up?)" 
                         SCM_ARG 
                         '.' 
                         symbol_list_part 
  312                | revert_arg_backup 
                         "(backed-up?)" 
                         SCM_ARG 
                         symbol_list_part 

  313 context_def_mod: "\consists"
  314                | "\remove"
  315                | "\accepts"
  316                | "\defaultchild"
  317                | "\denies"
  318                | "\alias"
  319                | "\type"
  320                | "\description"
  321                | "\name"

  322 context_mod: property_operation
  323            | context_def_mod STRING
  324            | context_def_mod embedded_scm

  325 grob_prop_spec: symbol_list_rev

  326 grob_prop_path: grob_prop_spec
  327               | grob_prop_spec property_path

  328 context_prop_spec: symbol_list_rev

  329 simple_music_property_def: "\override" grob_prop_path '=' scalar
  330                          | "\revert" simple_revert_context revert_arg
  331                          | "\set" context_prop_spec '=' scalar
  332                          | "\unset" context_prop_spec

  333 simple_revert_context: symbol_list_part

  334 music_property_def: simple_music_property_def

  335 string: STRING
  336       | full_markup

  337 simple_string: STRING
  338              | embedded_scm_bare

  339 symbol: STRING
  340       | embedded_scm_bare

  341 scalar: embedded_scm_arg
  342       | SCM_IDENTIFIER
  343       | bare_number
  344       | '-' bare_number
  345       | FRACTION
  346       | STRING
  347       | full_markup

  348 scalar_closed: embedded_scm_arg_closed
  349              | SCM_IDENTIFIER
  350              | bare_number
  351              | '-' bare_number
  352              | FRACTION
  353              | STRING
  354              | full_markup

  355 event_chord: simple_element post_events
  356            | simple_chord_elements post_events
  357            | CHORD_REPETITION optional_notemode_duration post_events
  358            | MULTI_MEASURE_REST optional_notemode_duration post_events
  359            | command_element
  360            | note_chord_element

  361 note_chord_element: chord_body optional_notemode_duration post_events

  362 chord_body: "<" chord_body_elements ">"

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

  365 chord_body_element: 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 music_function_call_closed: MUSIC_FUNCTION function_arglist_closed

  371 event_function_event: EVENT_FUNCTION function_arglist_closed

  372 command_element: command_event

  373 command_event: tempo_event

  374 post_events: /* empty */
  375            | post_events post_event

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

  384 post_event: post_event_nofinger
  385           | '-' fingering

  386 string_number_event: E_UNSIGNED

  387 direction_less_event: string_number_event
  388                     | EVENT_IDENTIFIER
  389                     | tremolo_type
  390                     | event_function_event

  391 direction_reqd_event: gen_text_def
  392                     | script_abbreviation

  393 octave_check: /* empty */
  394             | '=' quotes

  395 quotes: /* empty */
  396       | sub_quotes
  397       | sup_quotes

  398 sup_quotes: '''
  399           | sup_quotes '''

  400 sub_quotes: ','
  401           | sub_quotes ','

  402 steno_pitch: NOTENAME_PITCH quotes

  403 steno_tonic_pitch: TONICNAME_PITCH quotes

  404 pitch: steno_pitch
  405      | PITCH_IDENTIFIER

  406 pitch_also_in_chords: pitch
  407                     | steno_tonic_pitch

  408 gen_text_def: full_markup
  409             | STRING
  410             | embedded_scm_closed

  411 fingering: UNSIGNED

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

  419 script_dir: '_'
  420           | '^'
  421           | '-'

  422 duration_length: multiplied_duration

  423 maybe_notemode_duration: /* empty */
  424                        | multiplied_duration

  425 optional_notemode_duration: maybe_notemode_duration

  426 steno_duration: UNSIGNED dots
  427               | DURATION_IDENTIFIER dots

  428 multiplied_duration: steno_duration
  429                    | multiplied_duration '*' UNSIGNED
  430                    | multiplied_duration '*' FRACTION

  431 dots: /* empty */
  432     | dots '.'

  433 tremolo_type: ':'
  434             | ':' UNSIGNED

  435 bass_number: UNSIGNED
  436            | STRING
  437            | full_markup
  438            | embedded_scm_bare

  439 figured_bass_alteration: '-'
  440                        | '+'
  441                        | '!'

  442 bass_figure: "_"
  443            | bass_number
  444            | bass_figure ']'
  445            | bass_figure figured_bass_alteration
  446            | bass_figure figured_bass_modification

  447 figured_bass_modification: "\+"
  448                          | "\!"
  449                          | '/'
  450                          | "\"

  451 br_bass_figure: bass_figure
  452               | '[' bass_figure

  453 figure_list: /* empty */
  454            | figure_list br_bass_figure

  455 figure_spec: FIGURE_OPEN figure_list FIGURE_CLOSE

  456 optional_rest: /* empty */
  457              | "\rest"

  458 simple_element: pitch 
                        exclamations 
                        questions 
                        octave_check 
                        maybe_notemode_duration 
                        optional_rest 
  459               | DRUM_PITCH optional_notemode_duration
  460               | RESTNAME optional_notemode_duration

  461 simple_chord_elements: new_chord
  462                      | figure_spec optional_notemode_duration

  463 lyric_element: full_markup
  464              | STRING
  465              | LYRIC_ELEMENT

  466 lyric_element_music: lyric_element 
                             optional_notemode_duration 
                             post_events 

  467 new_chord: steno_tonic_pitch optional_notemode_duration
  468          | steno_tonic_pitch 
                   optional_notemode_duration 
                   chord_separator 
                   chord_items 

  469 chord_items: /* empty */
  470            | chord_items chord_item

  471 chord_separator: ":"
  472                | "^"
  473                | "/" steno_tonic_pitch
  474                | "/+" steno_tonic_pitch

  475 chord_item: chord_separator
  476           | step_numbers
  477           | CHORD_MODIFIER

  478 step_numbers: step_number
  479             | step_numbers '.' step_number

  480 step_number: UNSIGNED
  481            | UNSIGNED '+'
  482            | UNSIGNED "-"

  483 tempo_range: UNSIGNED
  484            | UNSIGNED '-' UNSIGNED

  485 number_expression: number_expression '+' number_term
  486                  | number_expression '-' number_term
  487                  | number_term

  488 number_term: number_factor
  489            | number_factor '*' number_factor
  490            | number_factor '/' number_factor

  491 number_factor: '-' number_factor
  492              | bare_number

  493 bare_number: bare_number_closed
  494            | UNSIGNED NUMBER_IDENTIFIER
  495            | REAL NUMBER_IDENTIFIER

  496 bare_number_closed: UNSIGNED
  497                   | REAL
  498                   | NUMBER_IDENTIFIER

  499 unsigned_number: UNSIGNED
  500                | NUMBER_IDENTIFIER

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

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

  506 full_markup_list: "\markuplist" 2 markup_list

  508 full_markup: "\markup" 3 markup_top

  509 markup_top: simple_markup_list
  510           | markup_head_1_list simple_markup
  511           | simple_markup

  513 markup_scm: embedded_scm_bare 4 "(backed-up?)"

  514 simple_markup_list: markup_composed_list
  515                   | markup_uncomposed_list

  516 markup_uncomposed_list: markup_braced_list
  517                       | markup_command_list
  518                       | markup_scm MARKUPLIST_IDENTIFIER

  519 markup_list: simple_markup_list
  520            | markup_score

  522 markup_score: "\score" 5 '{' score_body '}'

  523 markup_composed_list: markup_head_1_list markup_uncomposed_list

  524 markup_braced_list: '{' markup_braced_list_body '}'

  525 markup_braced_list_body: /* empty */
  526                        | markup_braced_list_body markup
  527                        | markup_braced_list_body simple_markup_list

  528 markup_command_list: MARKUP_LIST_FUNCTION markup_command_list_arguments

  529 markup_command_basic_arguments: "markup-list?" 
                                        markup_command_list_arguments 
                                        markup_list 
  530                               | "scheme?" 
                                        markup_command_list_arguments 
                                        embedded_scm_closed 
  531                               | EXPECT_NO_MORE_ARGS

  532 markup_command_list_arguments: markup_command_basic_arguments
  533                              | "markup?" 
                                       markup_command_list_arguments 
                                       markup 

  534 markup_head_1_item: MARKUP_FUNCTION 
                            "markup?" 
                            markup_command_list_arguments 

  535 markup_head_1_list: markup_head_1_item
  536                   | markup_head_1_list markup_head_1_item

  537 simple_markup: STRING
  538              | MARKUP_FUNCTION markup_command_basic_arguments
  539              | markup_scm MARKUP_IDENTIFIER
  540              | markup_score

  541 markup: markup_head_1_list simple_markup
  542       | simple_markup


Terminals, with rules where they appear



    187 188 197 198 202 203 204 209 210 211 212 213 214 215 216 217
    202 203 204 209 210 211 212 213 214 215 216 217 218 221 222 223
    218 219 220 221 222 223 256 257 260 261 271 272 273
    229 230 231 232 233 238 239 240 241 242 246 247 248 249 250 273
    436 464 537
    439 484 486 491
    484 494 496 499
    530
"#{" (343) 3
"(backed-up?)" (338) 134 223 255 259 308 311 312 513
"(reparsed?)" (339) 199 200 201 224 225 234 235 236 237 251 252 253
"-" (317) 482
"--" (330) 378
"/" (318) 473
"/+" (314) 474
":" (316) 471
"<" (319) 362
"<<" (321) 145
">" (320) 362 416
">>" (322) 145
"\!" (324) 448
"\" (323) 450
"\+" (325) 447
"\accepts" (273) 315
"\addlyrics" (262) 295 297
"\alias" (274) 318
"\alternative" (260) 141
"\book" (275) 74
"\bookpart" (276) 88
"\change" (277) 301
"\chordmode" (278) 288
"\chords" (279) 292
"\consists" (280) 313
"\context" (281) 64 281
"\default" (263) 271 272 273
"\defaultchild" (282) 316
"\denies" (283) 317
"\description" (284) 320
"\drummode" (285) 286
"\drums" (286) 290
"\figuremode" (287) 287
"\figures" (288) 291
"\header" (289) 47
"\layout" (291) 112
"\lyricmode" (292) 289
"\lyrics" (293) 293
"\lyricsto" (294) 300
"\markup" (295) 508
"\markuplist" (296) 506
"\midi" (297) 111
"\name" (298) 321
"\new" (313) 282
"\notemode" (299) 285
"\override" (300) 306 329
"\paper" (301) 110
"\remove" (302) 314
"\repeat" (259) 140 141
"\rest" (303) 457
"\revert" (304) 307 330
"\score" (305) 101 522
"\sequential" (306) 142
"\set" (307) 331
"\simultaneous" (308) 144
"\tempo" (309) 123 124 125
"\type" (310) 319
"\unset" (311) 305 332
"\version-error" (290) 8 43
"\with" (312) 150 151 153
"^" (315) 472
"_" (329) 442
"__" (326) 379
"end of input" (0) 0
"ly:duration?" (336) 174 177 220 257 261 270 272
"ly:pitch?" (335) 173 176 219 256 260 269 271
"markup-list?" (340) 529
"markup?" (334) 533 534
"optional?" (341) 173 174 175 176 177 178 179 180 181 182 184 185 186
"scheme?" (337) 175 178 179 180 181 182 184 185 186 187 188 197 198
'!' (33) 415 441 502
''' (39) 398 399
'*' (42) 429 430 489
'+' (43) 413 440 481 485
',' (44) 400 401
'-' (45) 180 181 182 216 217 218 233 241 242 248 344 351 385 414 421
'.' (46) 190 192 311 417 432 479
'/' (47) 449 490
':' (58) 433 434
'=' (61) 49 50 123 124 276 301 304 306 329 331 394
'?' (63) 504
'[' (91) 452
']' (93) 444
'^' (94) 382 412 420
'_' (95) 383 418 419
'{' (123) 47 64 74 88 101 116 117 129 150 522 524
'}' (125) 47 64 74 88 101 109 129 150 522 524
BOOK_IDENTIFIER (344) 76 90
CHORD_MODIFIER (346) 477
CHORD_REPETITION (347) 357
CHORDMODIFIER_PITCH (345)
CHORDMODIFIERS (331)
COMPOSITE (261)
CONTEXT_DEF_IDENTIFIER (348) 70
CONTEXT_MOD_IDENTIFIER (349) 151 152 160
DRUM_PITCH (350) 366 459
DURATION_IDENTIFIER (265) 427
E_UNSIGNED (333) 386
error (256) 7 42 87 100 107 122 128
EVENT_FUNCTION (352) 371
EVENT_IDENTIFIER (351) 388
EXPECT_NO_MORE_ARGS (342) 268 531
FIGURE_CLOSE (327) 455
FIGURE_OPEN (328) 455
FRACTION (353) 59 178 215 231 250 345 352 430
FUNCTION_ARGLIST (264)
LYRIC_ELEMENT (354) 465
MARKUP_FUNCTION (355) 534 538
MARKUP_IDENTIFIER (357) 539
MARKUP_LIST_FUNCTION (356) 528
MARKUPLIST_IDENTIFIER (358) 518
MULTI_MEASURE_REST (332) 358
MUSIC_FUNCTION (359) 274 370
MUSIC_IDENTIFIER (360) 155 168 369
NOTENAME_PITCH (269) 402
NUMBER_IDENTIFIER (271) 182 214 218 233 248 494 495 498 500
OUTPUT_DEF_IDENTIFIER (361) 117
PITCH_IDENTIFIER (270) 405
PREC_BOT (258)
PREC_TOP (272)
REAL (266) 181 213 217 242 495 497
RESTNAME (362) 460
SCM_ARG (363) 24 199 234 251 311 312
SCM_FUNCTION (364) 38 267
SCM_IDENTIFIER (365) 21 22 186 202 221 238 342 349
SCM_TOKEN (366) 17 20 25 83 96
STRING (367) 48 187 194 203 222 239 301 323 335 337 339 346 353 409
SYMBOL_LIST (368) 189 190
TONICNAME_PITCH (268) 403
UNARY_MINUS (369)
UNSIGNED (267) 180 212 216 241 411 426 429 434 435 480 481 482 483

Nonterminals, with rules where they appear


assignment (148)
    on left: 49 50, on right: 6 45 118
assignment_id (147)
    on left: 48, on right: 49 50
bare_number_closed (304)
    on left: 496 497 498, on right: 185 493
bass_number (281)
    on left: 435 436 437 438, on right: 443
book_block (155)
    on left: 74, on right: 11 30 52
bookpart_block (158)
    on left: 88, on right: 12 31 53 78
br_bass_figure (285)
    on left: 451 452, on right: 454
braced_music_list (173)
    on left: 129, on right: 141 142 143 144
chord_body (248)
    on left: 362, on right: 361
chord_body_element (250)
    on left: 365 366 367, on right: 364
chord_body_elements (249)
    on left: 363 364, on right: 362 364
chord_item (296)
    on left: 475 476 477, on right: 470
chord_items (294)
    on left: 469 470, on right: 468 470
chord_separator (295)
    on left: 471 472 473 474, on right: 468 475
closed_music (189)
    on left: 164 165 166, on right: 165 266
command_element (254)
    on left: 372, on right: 359
command_event (255)
    on left: 373, on right: 372
complex_music (217)
    on left: 277 278 279 280, on right: 162
complex_music_prefix (218)
    on left: 281 282, on right: 165 280
context_change (227)
    on left: 301, on right: 148
context_def_spec_block (150)
    on left: 64, on right: 29 55 115
context_mod (234)
    on left: 322 323 324, on right: 71 159
context_mod_arg (151)
    on left: 65 67, on right: 68
context_mod_embedded (153)
    on left: 68, on right: 73 161
context_modification_arg (185)
    on left: 154 155, on right: 153
context_prop_spec (237)
    on left: 328, on right: 331 332
direction_less_event (260)
    on left: 387 388 389 390, on right: 376 381
direction_reqd_event (261)
    on left: 391 392, on right: 380
dots (279)
    on left: 431 432, on right: 426 427 432
duration_length (274)
    on left: 422, on right: 177 220 270
embedded_lilypond (144)
    on left: 39 40 41 42 43, on right: 3 43
embedded_scm (141)
    on left: 33 34, on right: 46 61 65 119 135 324
embedded_scm_active (139)
    on left: 22 23, on right: 18 84 97 103
embedded_scm_arg (142)
    on left: 35 36 37, on right: 197 229 341
embedded_scm_closed (211)
    on left: 262 263, on right: 154 410 530
event_chord (246)
    on left: 355 356 357 358 359 360, on right: 146
event_function_event (253)
    on left: 371, on right: 390
exclamations (306)
    on left: 501 502, on right: 365 458 502
figure_list (286)
    on left: 453 454, on right: 454 455
figure_spec (287)
    on left: 455, on right: 462
figured_bass_alteration (282)
    on left: 439 440 441, on right: 445
figured_bass_modification (284)
    on left: 447 448 449 450, on right: 446
fingering (271)
    on left: 411, on right: 382 383 385
full_markup_list (308)
    on left: 506, on right: 16 26 62 82 95
gen_text_def (270)
    on left: 408 409 410, on right: 391
grob_prop_path (236)
    on left: 326 327, on right: 329
grob_prop_spec (235)
    on left: 325, on right: 326 327
grouped_music_list (191)
    on left: 170 171, on right: 169 283 284
lilypond (135)
    on left: 4 5 6 7 8, on right: 1 5 6 7 8
lilypond_header (146)
    on left: 47, on right: 10 86 99 105
lilypond_header_body (145)
    on left: 44 45 46, on right: 45 46 47
lyric_element (291)
    on left: 463 464 465, on right: 466
lyric_element_music (292)
    on left: 466, on right: 131 134 200 235
markup (329)
    on left: 541 542, on right: 526 533
markup_braced_list (321)
    on left: 524, on right: 516
markup_braced_list_body (322)
    on left: 525 526 527, on right: 524 526 527
markup_command_list (323)
    on left: 528, on right: 517
markup_composed_list (320)
    on left: 523, on right: 514
markup_head_1_item (326)
    on left: 534, on right: 535 536
markup_head_1_list (327)
    on left: 535 536, on right: 510 523 536 541
markup_list (317)
    on left: 519 520, on right: 506 529
markup_scm (313)
    on left: 513, on right: 518 539
markup_score (318)
    on left: 522, on right: 520 540
markup_top (312)
    on left: 509 510 511, on right: 508
markup_uncomposed_list (316)
    on left: 516 517 518, on right: 515 523
maybe_notemode_duration (275)
    on left: 423 424, on right: 425 458
mode_changed_music (219)
    on left: 283 284, on right: 167
mode_changing_head (220)
    on left: 285 286 287 288 289, on right: 283
multiplied_duration (278)
    on left: 428 429 430, on right: 422 424 429 430
music (174)
    on left: 130 131, on right: 102 132 140 141 280 300
music_arg (177)
    on left: 136 137, on right: 37 114 130
music_assign (178)
    on left: 138 139, on right: 56
music_bare (190)
    on left: 167 168 169, on right: 163 164
music_embedded (175)
    on left: 132 133 134, on right: 41 127
music_embedded_backup (176)
    on left: 135, on right: 133 134
music_function_call (215)
    on left: 274, on right: 277 368
music_function_call_closed (252)
    on left: 370, on right: 166 377
music_function_chord_body (251)
    on left: 368 369, on right: 367
music_list (172)
    on left: 126 127 128, on right: 41 127 128 129 145
music_or_context_def (168)
    on left: 114 115, on right: 121
music_property_def (240)
    on left: 334, on right: 147
new_chord (293)
    on left: 467 468, on right: 461
new_lyrics (222)
    on left: 295 297, on right: 297 298
note_chord_element (247)
    on left: 361, on right: 360
number_expression (300)
    on left: 485 486 487, on right: 58 485 486
number_factor (302)
    on left: 491 492, on right: 488 489 490 491
number_term (301)
    on left: 488 489 490, on right: 485 486 487
octave_check (262)
    on left: 393 394, on right: 365 458
optional_context_mod (186)
    on left: 156 157, on right: 281 282 284
optional_id (216)
    on left: 275 276, on right: 281 282
optional_rest (288)
    on left: 456 457, on right: 458
output_def (165)
    on left: 109, on right: 19 32 54 106 108
output_def_head (166)
    on left: 110 111 112, on right: 113
output_def_head_with_mode_switch (167)
    on left: 113, on right: 116 117
paper_block (164)
    on left: 108, on right: 77 91
pitch (268)
    on left: 404 405, on right: 365 406 458
pitch_also_in_chords (269)
    on left: 406 407, on right: 176 219 269
post_event (258)
    on left: 384 385, on right: 375
property_operation (229)
    on left: 304 305 306 307, on right: 322
property_path (228)
    on left: 302 303, on right: 50 303 306 327
questions (307)
    on left: 503 504, on right: 365 458 504
quotes (263)
    on left: 395 396 397, on right: 394 402 403
re_rhythmed_music (225)
    on left: 298 300, on right: 279
repeated_music (179)
    on left: 140 141, on right: 278
revert_arg (230)
    on left: 308, on right: 307 330
revert_arg_backup (231)
    on left: 309, on right: 308 311 312
revert_arg_part (232)
    on left: 310 311 312, on right: 309
scalar_closed (245)
    on left: 348 349 350 351 352 353 354, on right: 124
scm_function_call (143)
    on left: 38, on right: 23 34 36
scm_function_call_closed (213)
    on left: 267, on right: 263 265
score_block (161)
    on left: 101, on right: 13 28 51 79 92
script_dir (273)
    on left: 419 420 421, on right: 377 380 381
sequential_music (180)
    on left: 142 143, on right: 171
simple_chord_elements (290)
    on left: 461 462, on right: 356
simple_element (289)
    on left: 458 459 460, on right: 355
simple_markup (328)
    on left: 537 538 539 540, on right: 510 511 541 542
simple_markup_list (315)
    on left: 514 515, on right: 509 519 527
simple_music (182)
    on left: 146 147 148, on right: 136 138
simple_music_property_def (238)
    on left: 329 330 331 332, on right: 334
simple_revert_context (239)
    on left: 333, on right: 330
simple_string (242)
    on left: 337 338, on right: 140 141 276 300
simultaneous_music (181)
    on left: 144 145, on right: 170
start_symbol (133)
    on left: 1 3, on right: 0
steno_duration (277)
    on left: 426 427, on right: 123 124 428
steno_pitch (266)
    on left: 402, on right: 404
steno_tonic_pitch (267)
    on left: 403, on right: 407 467 468 473 474
step_number (298)
    on left: 480 481 482, on right: 478 479
step_numbers (297)
    on left: 478 479, on right: 476 479
string (241)
    on left: 335 336, on right: 60
string_number_event (259)
    on left: 386, on right: 387
sub_quotes (265)
    on left: 400 401, on right: 396 401
sup_quotes (264)
    on left: 398 399, on right: 397 399
symbol (243)
    on left: 339 340, on right: 281 282 304 305
symbol_list_arg (195)
    on left: 189 190, on right: 201 225 237 253 308
symbol_list_element (198)
    on left: 194 195, on right: 193
symbol_list_part (197)
    on left: 193, on right: 191 192 310 311 312 333
symbol_list_rev (196)
    on left: 191 192, on right: 190 192 302 303 325 328
tempo_event (171)
    on left: 123 124 125, on right: 373
tempo_range (299)
    on left: 483 484, on right: 123 124
tremolo_type (280)
    on left: 433 434, on right: 389
unsigned_number (305)
    on left: 499 500, on right: 140 141
