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"

    9 toplevel_expression: header_block
   10                    | book_block
   11                    | bookpart_block
   12                    | BOOK_IDENTIFIER
   13                    | score_block
   14                    | composite_music
   15                    | full_markup
   16                    | full_markup_list
   17                    | SCM_TOKEN
   18                    | embedded_scm_active
   19                    | output_def

   20 lookup: LOOKUP_IDENTIFIER
   21       | LOOKUP_IDENTIFIER '.' symbol_list_rev

   22 embedded_scm_bare: SCM_TOKEN
   23                  | SCM_IDENTIFIER

   24 embedded_scm_active: SCM_IDENTIFIER
   25                    | scm_function_call
   26                    | lookup

   27 embedded_scm_bare_arg: SCM_ARG
   28                      | SCM_TOKEN
   29                      | FRACTION
   30                      | partial_markup
   31                      | full_markup_list
   32                      | context_modification
   33                      | header_block
   34                      | score_block
   35                      | context_def_spec_block
   36                      | book_block
   37                      | bookpart_block
   38                      | output_def
   39                      | lookup

   40 embedded_scm: embedded_scm_bare
   41             | scm_function_call
   42             | lookup

   43 embedded_scm_arg: embedded_scm_bare_arg
   44                 | scm_function_call
   45                 | music_assign

   46 scm_function_call: SCM_FUNCTION function_arglist

   47 embedded_lilypond_number: '-' embedded_lilypond_number
   48                         | bare_number_common
   49                         | UNSIGNED NUMBER_IDENTIFIER

   50 embedded_lilypond: /* empty */
   51                  | identifier_init_nonumber
   52                  | embedded_lilypond_number
   53                  | post_event post_events
   54                  | multiplied_duration
   55                  | music_embedded music_embedded music_list
   56                  | error
   57                  | "\version-error" embedded_lilypond

   58 lilypond_header_body: /* empty */
   59                     | lilypond_header_body assignment
   60                     | lilypond_header_body SCM_TOKEN
   61                     | lilypond_header_body embedded_scm_active

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

   64 header_block:  lilypond_header

   65 assignment_id: STRING

   66 assignment: assignment_id '=' identifier_init
   67           | assignment_id '.' property_path '=' identifier_init
   68           | assignment_id ',' property_path '=' identifier_init

   69 identifier_init: identifier_init_nonumber
   70                | number_expression
   71                | symbol_list_part_bare '.' property_path
   72                | symbol_list_part_bare ',' property_path
   73                | post_event_nofinger post_events

   74 identifier_init_nonumber: header_block
   75                         | score_block
   76                         | book_block
   77                         | bookpart_block
   78                         | output_def
   79                         | context_def_spec_block
   80                         | music_assign
   81                         | pitch_or_music
   82                         | FRACTION
   83                         | string
   84                         | embedded_scm
   85                         | partial_markup
   86                         | full_markup_list
   87                         | context_modification
   88                         | partial_function "\etc"

   89 partial_function: MUSIC_FUNCTION function_arglist_partial
   90                 | EVENT_FUNCTION function_arglist_partial
   91                 | SCM_FUNCTION function_arglist_partial
   92                 | "\override" grob_prop_path '='
   93                 | "\set" context_prop_spec '='
   94                 | MUSIC_FUNCTION 
                          "scheme?" 
                          function_arglist_optional 
                          partial_function 
   95                 | EVENT_FUNCTION 
                          "scheme?" 
                          function_arglist_optional 
                          partial_function 
   96                 | SCM_FUNCTION 
                          "scheme?" 
                          function_arglist_optional 
                          partial_function 
   97                 | "\override" grob_prop_path '=' partial_function
   98                 | "\set" context_prop_spec '=' partial_function
   99                 | MUSIC_FUNCTION 
                          "optional?" 
                          "scheme?" 
                          function_arglist_nonbackup 
                          partial_function 
  100                 | EVENT_FUNCTION 
                          "optional?" 
                          "scheme?" 
                          function_arglist_nonbackup 
                          partial_function 
  101                 | SCM_FUNCTION 
                          "optional?" 
                          "scheme?" 
                          function_arglist_nonbackup 
                          partial_function 

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

  103 context_mod_arg: embedded_scm

  105 context_mod_arg:  composite_music

  106 context_def_spec_body: /* empty */
  107                      | context_def_spec_body context_mod
  108                      | context_def_spec_body context_modification
  109                      | context_def_spec_body context_mod_arg

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

  111 book_body: /* empty */
  112          | BOOK_IDENTIFIER
  113          | book_body paper_block
  114          | book_body bookpart_block
  115          | book_body score_block
  116          | book_body composite_music
  117          | book_body full_markup
  118          | book_body full_markup_list
  119          | book_body SCM_TOKEN
  120          | book_body embedded_scm_active

  122 book_body: book_body  lilypond_header
  123          | book_body error

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

  125 bookpart_body: /* empty */
  126              | BOOK_IDENTIFIER
  127              | bookpart_body paper_block
  128              | bookpart_body score_block
  129              | bookpart_body composite_music
  130              | bookpart_body full_markup
  131              | bookpart_body full_markup_list
  132              | bookpart_body SCM_TOKEN
  133              | bookpart_body embedded_scm_active

  135 bookpart_body: bookpart_body  lilypond_header
  136              | bookpart_body error

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

  138 score_body: score_items
  139           | score_body error

  140 score_item: embedded_scm
  141           | music
  142           | output_def

  143 score_items: /* empty */
  144            | score_items score_item

  146 score_items: score_items  lilypond_header

  147 paper_block: output_def

  148 output_def: output_def_body '}'

  149 output_def_head: "\paper"
  150                | "\midi"
  151                | "\layout"

  152 output_def_head_with_mode_switch: output_def_head

  153 music_or_context_def: music_assign
  154                     | context_def_spec_block

  155 output_def_body: output_def_head_with_mode_switch '{'
  156                | output_def_body assignment
  157                | output_def_body embedded_scm_active
  158                | output_def_body SCM_TOKEN

  160 output_def_body: output_def_body  music_or_context_def
  161                | output_def_body error

  162 tempo_event: "\tempo" steno_duration '=' tempo_range
  163            | "\tempo" text steno_duration '=' tempo_range
  164            | "\tempo" text

  165 music_list: /* empty */
  166           | music_list music_embedded
  167           | music_list error

  168 braced_music_list: '{' music_list '}'

  169 music: music_assign
  170      | lyric_element_music
  171      | pitch_as_music

  172 pitch_as_music: pitch_or_music

  173 music_embedded: music
  174               | music_embedded_backup
  175               | music_embedded_backup 
                        "(backed-up?)" 
                        lyric_element_music 
  176               | multiplied_duration post_events

  177 music_embedded_backup: embedded_scm

  178 music_assign: simple_music
  179             | composite_music

  180 repeated_music: "\repeat" simple_string unsigned_number music
  181               | "\repeat" 
                        simple_string 
                        unsigned_number 
                        music 
                        "\alternative" 
                        braced_music_list 

  182 sequential_music: "\sequential" braced_music_list
  183                 | braced_music_list

  184 simultaneous_music: "\simultaneous" braced_music_list
  185                   | "<<" music_list ">>"

  186 simple_music: event_chord
  187             | music_property_def
  188             | context_change

  190 context_modification: "\with"  '{' context_mod_list '}'
  191                     | "\with" context_modification_arg

  192 context_modification_arg: embedded_scm
  193                         | MUSIC_IDENTIFIER

  194 optional_context_mods: context_modification_mods_list

  195 context_modification_mods_list: /* empty */
  196                               | context_modification_mods_list 
                                        context_modification 

  197 context_mod_list: /* empty */
  198                 | context_mod_list context_mod
  199                 | context_mod_list context_mod_arg

  200 context_prefix: "\context" symbol optional_id optional_context_mods
  201               | "\new" symbol optional_id optional_context_mods

  202 new_lyrics: "\addlyrics" optional_context_mods lyric_mode_music
  203           | new_lyrics 
                    "\addlyrics" 
                    optional_context_mods 
                    lyric_mode_music 

  204 basic_music: music_function_call
  205            | repeated_music
  206            | music_bare
  207            | "\lyricsto" simple_string lyric_mode_music
  208            | "\lyricsto" symbol '=' simple_string lyric_mode_music

  209 contextable_music: basic_music
  210                  | pitch_as_music
  211                  | event_chord

  212 contexted_basic_music: context_prefix contextable_music new_lyrics
  213                      | context_prefix contextable_music
  214                      | context_prefix contexted_basic_music

  215 composite_music: basic_music
  216                | contexted_basic_music
  217                | basic_music new_lyrics

  218 music_bare: mode_changed_music
  219           | MUSIC_IDENTIFIER
  220           | grouped_music_list

  221 grouped_music_list: simultaneous_music
  222                   | sequential_music

  223 symbol_list_arg: SYMBOL_LIST
  224                | SYMBOL_LIST '.' symbol_list_rev
  225                | SYMBOL_LIST ',' symbol_list_rev

  226 symbol_list_rev: symbol_list_part
  227                | symbol_list_rev '.' symbol_list_part
  228                | symbol_list_rev ',' symbol_list_part

  229 symbol_list_part: symbol_list_element

  230 symbol_list_element: STRING
  231                    | embedded_scm_bare
  232                    | UNSIGNED

  233 symbol_list_part_bare: STRING
  234                      | UNSIGNED

  235 function_arglist_nonbackup: function_arglist_common
  236                           | "optional?" 
                                    "scheme?" 
                                    function_arglist_nonbackup 
                                    post_event_nofinger 
  237                           | "optional?" 
                                    "scheme?" 
                                    function_arglist_nonbackup 
                                    '-' 
                                    UNSIGNED 
  238                           | "optional?" 
                                    "scheme?" 
                                    function_arglist_nonbackup 
                                    '-' 
                                    REAL 
  239                           | "optional?" 
                                    "scheme?" 
                                    function_arglist_nonbackup 
                                    '-' 
                                    NUMBER_IDENTIFIER 
  240                           | "optional?" 
                                    "scheme?" 
                                    function_arglist_nonbackup 
                                    embedded_scm_arg 
  241                           | "optional?" 
                                    "scheme?" 
                                    function_arglist_nonbackup 
                                    bare_number_common 
  242                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    pitch_or_music 
  243                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    multiplied_duration 
  244                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    reparsed_rhythm 
  245                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    bare_number_common 
  246                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    SCM_ARG 
  247                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    lyric_element_music 
  248                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    symbol_list_arg 

  249 reparsed_rhythm: DURATION_ARG dots multipliers post_events

  250 function_arglist_nonbackup_reparse: "optional?" 
                                            "scheme?" 
                                            function_arglist_nonbackup 
                                            SCM_IDENTIFIER 
  251                                   | "optional?" 
                                            "scheme?" 
                                            function_arglist_nonbackup 
                                            pitch 
  252                                   | "optional?" 
                                            "scheme?" 
                                            function_arglist_nonbackup 
                                            steno_tonic_pitch 
  253                                   | "optional?" 
                                            "scheme?" 
                                            function_arglist_nonbackup 
                                            STRING 
  254                                   | "optional?" 
                                            "scheme?" 
                                            function_arglist_nonbackup 
                                            full_markup 
  255                                   | "optional?" 
                                            "scheme?" 
                                            function_arglist_nonbackup 
                                            UNSIGNED 
  256                                   | "optional?" 
                                            "scheme?" 
                                            function_arglist_nonbackup 
                                            DURATION_IDENTIFIER 

  257 function_arglist_backup: function_arglist_common
  258                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 embedded_scm_arg 
  259                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 post_event_nofinger 
  260                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 pitch 
  261                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 steno_tonic_pitch 
  262                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 full_markup 
  263                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 UNSIGNED 
  264                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 REAL 
  265                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 NUMBER_IDENTIFIER 
  266                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 '-' 
                                 UNSIGNED 
  267                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 '-' 
                                 REAL 
  268                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 '-' 
                                 NUMBER_IDENTIFIER 
  269                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 DURATION_IDENTIFIER 
  270                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 SCM_IDENTIFIER 
  271                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_backup 
                                 STRING 
  272                        | function_arglist_backup 
                                 "(reparsed?)" 
                                 pitch_or_music 
  273                        | function_arglist_backup 
                                 "(reparsed?)" 
                                 bare_number_common 
  274                        | function_arglist_backup 
                                 "(reparsed?)" 
                                 multiplied_duration 
  275                        | function_arglist_backup 
                                 "(reparsed?)" 
                                 reparsed_rhythm 
  276                        | function_arglist_backup 
                                 "(reparsed?)" 
                                 symbol_list_arg 

  277 function_arglist: function_arglist_nonbackup
  278                 | "optional?" 
                          "scheme?" 
                          function_arglist_skip_nonbackup 
                          "\default" 

  279 function_arglist_skip_nonbackup: function_arglist_nonbackup
  280                                | "optional?" 
                                         "scheme?" 
                                         function_arglist_skip_nonbackup 

  281 function_arglist_partial: "scheme?" function_arglist_optional
  282                         | "scheme?" function_arglist_partial_optional
  283                         | "optional?" 
                                  "scheme?" 
                                  function_arglist_nonbackup 
  284                         | "optional?" 
                                  "scheme?" 
                                  function_arglist_partial 

  285 function_arglist_partial_optional: "scheme?" function_arglist_optional
  286                                  | "scheme?" 
                                           function_arglist_partial_optional 
  287                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_backup 
  288                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_partial_optional 

  289 function_arglist_common: EXPECT_NO_MORE_ARGS
  290                        | "scheme?" 
                                 function_arglist_optional 
                                 embedded_scm_arg 
  291                        | "scheme?" 
                                 function_arglist_optional 
                                 bare_number_common 
  292                        | "scheme?" 
                                 function_arglist_optional 
                                 post_event_nofinger 
  293                        | "scheme?" 
                                 function_arglist_optional 
                                 '-' 
                                 NUMBER_IDENTIFIER 
  294                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 SCM_ARG 
  295                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 lyric_element_music 
  296                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 pitch_or_music 
  297                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 bare_number_common 
  298                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 multiplied_duration 
  299                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 reparsed_rhythm 
  300                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 symbol_list_arg 

  301 function_arglist_common_reparse: "scheme?" 
                                         function_arglist_optional 
                                         SCM_IDENTIFIER 
  302                                | "scheme?" 
                                         function_arglist_optional 
                                         pitch 
  303                                | "scheme?" 
                                         function_arglist_optional 
                                         steno_tonic_pitch 
  304                                | "scheme?" 
                                         function_arglist_optional 
                                         STRING 
  305                                | "scheme?" 
                                         function_arglist_optional 
                                         full_markup 
  306                                | "scheme?" 
                                         function_arglist_optional 
                                         UNSIGNED 
  307                                | "scheme?" 
                                         function_arglist_optional 
                                         DURATION_IDENTIFIER 
  308                                | "scheme?" 
                                         function_arglist_optional 
                                         '-' 
                                         UNSIGNED 
  309                                | "scheme?" 
                                         function_arglist_optional 
                                         '-' 
                                         REAL 

  310 function_arglist_optional: function_arglist_backup
  311                          | "optional?" 
                                   "scheme?" 
                                   function_arglist_skip_backup 
                                   "\default" 
  312                          | function_arglist_skip_backup "(backed-up?)"

  313 function_arglist_skip_backup: function_arglist_backup
  314                             | "optional?" 
                                      "scheme?" 
                                      function_arglist_skip_backup 

  315 music_function_call: MUSIC_FUNCTION function_arglist

  316 optional_id: /* empty */
  317            | '=' simple_string

  319 lyric_mode_music:  grouped_music_list
  320                 | MUSIC_IDENTIFIER

  321 mode_changed_music: mode_changing_head grouped_music_list
  322                   | mode_changing_head_with_context 
                            optional_context_mods 
                            grouped_music_list 

  323 mode_changing_head: "\notemode"
  324                   | "\drummode"
  325                   | "\figuremode"
  326                   | "\chordmode"
  327                   | "\lyricmode"

  328 mode_changing_head_with_context: "\drums"
  329                                | "\figures"
  330                                | "\chords"
  331                                | "\lyrics"

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

  333 property_path: symbol_list_rev

  334 property_operation: symbol '=' scalar
  335                   | "\unset" symbol
  336                   | "\override" revert_arg '=' scalar
  337                   | "\revert" revert_arg

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

  339 revert_arg_backup: revert_arg_part

  340 revert_arg_part: symbol_list_part
  341                | revert_arg_backup 
                         "(backed-up?)" 
                         SCM_ARG 
                         '.' 
                         symbol_list_part 
  342                | revert_arg_backup 
                         "(backed-up?)" 
                         SCM_ARG 
                         ',' 
                         symbol_list_part 
  343                | revert_arg_backup 
                         "(backed-up?)" 
                         SCM_ARG 
                         symbol_list_part 

  344 context_def_mod: "\consists"
  345                | "\remove"
  346                | "\accepts"
  347                | "\defaultchild"
  348                | "\denies"
  349                | "\alias"
  350                | "\type"
  351                | "\description"
  352                | "\name"

  353 context_mod: property_operation
  354            | context_def_mod STRING
  355            | context_def_mod embedded_scm

  356 grob_prop_spec: symbol_list_rev

  357 grob_prop_path: grob_prop_spec
  358               | grob_prop_spec property_path

  359 context_prop_spec: symbol_list_rev

  360 simple_revert_context: symbol_list_part

  361 music_property_def: "\override" grob_prop_path '=' scalar
  362                   | "\revert" simple_revert_context revert_arg
  363                   | "\set" context_prop_spec '=' scalar
  364                   | "\unset" context_prop_spec

  365 string: STRING
  366       | full_markup

  367 text: STRING
  368     | full_markup
  369     | embedded_scm_bare

  370 simple_string: STRING
  371              | embedded_scm_bare

  372 symbol: STRING
  373       | embedded_scm_bare

  374 scalar: embedded_scm_arg
  375       | pitch_or_music
  376       | SCM_IDENTIFIER
  377       | bare_number
  378       | '-' bare_number
  379       | string
  380       | symbol_list_part_bare '.' property_path
  381       | symbol_list_part_bare ',' property_path

  382 event_chord: simple_element post_events
  383            | CHORD_REPETITION optional_notemode_duration post_events
  384            | MULTI_MEASURE_REST optional_notemode_duration post_events
  385            | tempo_event
  386            | note_chord_element

  387 note_chord_element: chord_body optional_notemode_duration post_events

  388 chord_body: "<" chord_body_elements ">"
  389           | FIGURE_OPEN figure_list FIGURE_CLOSE

  390 chord_body_elements: /* empty */
  391                    | chord_body_elements chord_body_element

  392 chord_body_element: pitch_or_tonic_pitch 
                            exclamations 
                            questions 
                            octave_check 
                            post_events 
  393                   | DRUM_PITCH post_events
  394                   | music_function_chord_body

  395 music_function_chord_body: music_function_call
  396                          | MUSIC_IDENTIFIER
  397                          | embedded_scm

  398 event_function_event: EVENT_FUNCTION function_arglist

  399 post_events: /* empty */
  400            | post_events post_event

  401 post_event_nofinger: direction_less_event
  402                    | script_dir music_function_call
  403                    | "--"
  404                    | "__"
  405                    | script_dir direction_reqd_event
  406                    | script_dir direction_less_event
  407                    | '^' fingering
  408                    | '_' fingering

  409 post_event: post_event_nofinger
  410           | '-' fingering

  411 string_number_event: E_UNSIGNED

  412 direction_less_event: string_number_event
  413                     | EVENT_IDENTIFIER
  414                     | tremolo_type
  415                     | event_function_event

  416 direction_reqd_event: gen_text_def
  417                     | script_abbreviation

  418 octave_check: /* empty */
  419             | '=' quotes

  420 quotes: /* empty */
  421       | sub_quotes
  422       | sup_quotes

  423 sup_quotes: '''
  424           | sup_quotes '''

  425 sub_quotes: ','
  426           | sub_quotes ','

  427 steno_pitch: NOTENAME_PITCH quotes

  428 steno_tonic_pitch: TONICNAME_PITCH quotes

  429 pitch: steno_pitch
  430      | PITCH_IDENTIFIER quotes

  431 pitch_or_tonic_pitch: pitch
  432                     | steno_tonic_pitch

  433 gen_text_def: full_markup
  434             | STRING
  435             | embedded_scm

  436 fingering: UNSIGNED

  437 script_abbreviation: '^'
  438                    | '+'
  439                    | '-'
  440                    | '!'
  441                    | ">"
  442                    | '.'
  443                    | '_'

  444 script_dir: '_'
  445           | '^'
  446           | '-'

  447 maybe_notemode_duration: /* empty */
  448                        | multiplied_duration

  449 optional_notemode_duration: maybe_notemode_duration

  450 steno_duration: UNSIGNED dots
  451               | DURATION_IDENTIFIER dots

  452 multiplied_duration: steno_duration multipliers

  453 dots: /* empty */
  454     | dots '.'

  455 multipliers: /* empty */
  456            | multipliers '*' UNSIGNED
  457            | multipliers '*' FRACTION

  458 tremolo_type: ':'
  459             | ':' UNSIGNED

  460 bass_number: UNSIGNED
  461            | STRING
  462            | full_markup
  463            | embedded_scm_bare

  464 figured_bass_alteration: '-'
  465                        | '+'
  466                        | '!'

  467 bass_figure: "_"
  468            | bass_number
  469            | bass_figure ']'
  470            | bass_figure figured_bass_alteration
  471            | bass_figure figured_bass_modification

  472 figured_bass_modification: "\+"
  473                          | "\!"
  474                          | '/'
  475                          | "\"

  476 br_bass_figure: bass_figure
  477               | '[' bass_figure

  478 figure_list: /* empty */
  479            | figure_list br_bass_figure

  480 optional_rest: /* empty */
  481              | "\rest"

  482 pitch_or_music: pitch 
                        exclamations 
                        questions 
                        octave_check 
                        maybe_notemode_duration 
                        optional_rest 
                        post_events 
  483               | new_chord post_events

  484 simple_element: DRUM_PITCH optional_notemode_duration
  485               | RESTNAME optional_notemode_duration

  486 lyric_element: full_markup
  487              | STRING
  488              | LYRIC_ELEMENT

  489 lyric_element_music: lyric_element 
                             optional_notemode_duration 
                             post_events 

  490 new_chord: steno_tonic_pitch maybe_notemode_duration
  491          | steno_tonic_pitch 
                   optional_notemode_duration 
                   chord_separator 
                   chord_items 

  492 chord_items: /* empty */
  493            | chord_items chord_item

  494 chord_separator: ":"
  495                | "^"
  496                | "/" steno_tonic_pitch
  497                | "/+" steno_tonic_pitch

  498 chord_item: chord_separator
  499           | step_numbers
  500           | CHORD_MODIFIER

  501 step_numbers: step_number
  502             | step_numbers '.' step_number

  503 step_number: UNSIGNED
  504            | UNSIGNED '+'
  505            | UNSIGNED "-"

  506 tempo_range: unsigned_number
  507            | unsigned_number '-' unsigned_number

  508 number_expression: number_expression '+' number_term
  509                  | number_expression '-' number_term
  510                  | number_term

  511 number_term: number_factor
  512            | number_factor '*' number_factor
  513            | number_factor '/' number_factor

  514 number_factor: '-' number_factor
  515              | bare_number

  516 bare_number_common: REAL
  517                   | NUMBER_IDENTIFIER
  518                   | REAL NUMBER_IDENTIFIER

  519 bare_number: bare_number_common
  520            | UNSIGNED
  521            | UNSIGNED NUMBER_IDENTIFIER

  522 unsigned_number: UNSIGNED
  523                | NUMBER_IDENTIFIER
  524                | embedded_scm

  525 exclamations: /* empty */
  526             | exclamations '!'

  527 questions: /* empty */
  528          | questions '?'

  530 full_markup_list: "\markuplist" 0 markup_list

  531 markup_mode: "\markup"

  532 full_markup: markup_mode markup_top

  533 partial_markup: markup_mode markup_partial_function "\etc"

  534 markup_top: markup_list
  535           | markup_head_1_list simple_markup
  536           | simple_markup

  538 markup_scm: embedded_scm 1 "(backed-up?)"

  539 markup_list: markup_composed_list
  540            | markup_uncomposed_list

  541 markup_uncomposed_list: markup_braced_list
  542                       | markup_command_list
  543                       | markup_scm MARKUPLIST_IDENTIFIER

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

  546 markup_composed_list: markup_head_1_list markup_uncomposed_list

  547 markup_braced_list: '{' markup_braced_list_body '}'

  548 markup_braced_list_body: /* empty */
  549                        | markup_braced_list_body markup
  550                        | markup_braced_list_body markup_list

  551 markup_command_list: MARKUP_LIST_FUNCTION markup_command_list_arguments

  552 markup_command_basic_arguments: "markup-list?" 
                                        markup_command_list_arguments 
                                        markup_list 
  553                               | "scheme?" 
                                        markup_command_list_arguments 
                                        embedded_scm 
  554                               | EXPECT_NO_MORE_ARGS

  555 markup_command_list_arguments: markup_command_basic_arguments
  556                              | "markup?" 
                                       markup_command_list_arguments 
                                       markup 

  557 markup_partial_function: MARKUP_FUNCTION markup_arglist_partial
  558                        | markup_head_1_list 
                                 MARKUP_FUNCTION 
                                 markup_arglist_partial 

  559 markup_arglist_partial: "markup?" markup_arglist_partial
  560                       | "scheme?" markup_arglist_partial
  561                       | "markup?" markup_command_list_arguments
  562                       | "scheme?" markup_command_list_arguments

  563 markup_head_1_item: MARKUP_FUNCTION 
                            "markup?" 
                            markup_command_list_arguments 

  564 markup_head_1_list: markup_head_1_item
  565                   | markup_head_1_list markup_head_1_item

  566 simple_markup: STRING

  568 simple_markup: "\score" 3 '{' score_body '}'
  569              | MARKUP_FUNCTION markup_command_basic_arguments
  570              | markup_scm MARKUP_IDENTIFIER

  571 markup: markup_head_1_list simple_markup
  572       | simple_markup


Terminals, with rules where they appear



    252 253 254 255 256 258 259 260 261 262 263 264 265 266 267 268
    254 255 256 258 259 260 261 262 263 264 265 266 267 268 269 270
    269 270 271 278 280 281 282 283 284 285 286 287 288 290 291 292
    271 278 280 283 284 287 288 311 314
    293 301 302 303 304 305 306 307 308 309 311 314 553 560 562
    294 295 296 297 298 299 300
    503 504 505 520 521 522
    507 509 514
    566
"#{" (340) 3
"(backed-up?)" (335) 175 312 338 341 342 343 538
"(reparsed?)" (336) 242 243 244 245 246 247 248 272 273 274 275 276
"-" (320) 505
"--" (265) 403
"/" (321) 496
"/+" (317) 497
":" (319) 494
"<" (322) 388
"<<" (324) 185
">" (323) 388 441
">>" (325) 185
"\!" (327) 473
"\" (326) 475
"\+" (328) 472
"\accepts" (273) 346
"\addlyrics" (262) 202 203
"\alias" (274) 349
"\alternative" (260) 181
"\book" (275) 110
"\bookpart" (276) 124
"\change" (277) 332
"\chordmode" (278) 326
"\chords" (279) 330
"\consists" (280) 344
"\context" (281) 102 200
"\default" (282) 278 311
"\defaultchild" (283) 347
"\denies" (284) 348
"\description" (285) 351
"\drummode" (286) 324
"\drums" (287) 328
"\etc" (288) 88 533
"\figuremode" (289) 325
"\figures" (290) 329
"\header" (291) 62
"\layout" (293) 151
"\lyricmode" (294) 327
"\lyrics" (295) 331
"\lyricsto" (296) 207 208
"\markup" (297) 531
"\markuplist" (298) 530
"\midi" (299) 150
"\name" (300) 352
"\new" (316) 201
"\notemode" (301) 323
"\override" (302) 92 97 336 361
"\paper" (303) 149
"\remove" (304) 345
"\repeat" (259) 180 181
"\rest" (305) 481
"\revert" (306) 337 362
"\score" (307) 137 568
"\score-lines" (308) 545
"\sequential" (309) 182
"\set" (310) 93 98 363
"\simultaneous" (311) 184
"\tempo" (312) 162 163 164
"\type" (313) 350
"\unset" (314) 335 364
"\version-error" (292) 8 57
"\with" (315) 190 191
"^" (318) 495
"_" (331) 467
"__" (264) 404
"end of input" (0) 0
"markup-list?" (337) 552
"markup?" (333) 556 559 561 563
"optional?" (338) 99 100 101 236 237 238 239 240 241 250 251 252 253
"scheme?" (334) 94 95 96 99 100 101 236 237 238 239 240 241 250 251
'!' (33) 440 466 526
''' (39) 423 424
'*' (42) 456 457 512
'+' (43) 438 465 504 508
',' (44) 68 72 225 228 342 381 425 426
'-' (45) 47 237 238 239 266 267 268 293 308 309 378 410 439 446 464
'.' (46) 21 67 71 224 227 341 380 442 454 502
'/' (47) 474 513
':' (58) 458 459
'=' (61) 66 67 68 92 93 97 98 162 163 208 317 332 334 336 361 363 419
'?' (63) 528
'[' (91) 477
']' (93) 469
'^' (94) 407 437 445
'_' (95) 408 443 444
'{' (123) 62 102 110 124 137 155 168 190 545 547 568
'}' (125) 62 102 110 124 137 148 168 190 545 547 568
BOOK_IDENTIFIER (341) 12 112 126
CHORD_MODIFIER (342) 500
CHORD_REPETITION (343) 383
COMPOSITE (261)
DRUM_PITCH (344) 393 484
DURATION_ARG (345) 249
DURATION_IDENTIFIER (263) 256 269 307 451
E_UNSIGNED (268) 411
error (256) 7 56 123 136 139 161 167
EVENT_FUNCTION (266) 90 95 100 398
EVENT_IDENTIFIER (267) 413
EXPECT_NO_MORE_ARGS (339) 289 554
FIGURE_CLOSE (329) 389
FIGURE_OPEN (330) 389
FRACTION (346) 29 82 457
LOOKUP_IDENTIFIER (347) 20 21
LYRIC_ELEMENT (348) 488
MARKUP_FUNCTION (349) 557 558 563 569
MARKUP_IDENTIFIER (351) 570
MARKUP_LIST_FUNCTION (350) 551
MARKUPLIST_IDENTIFIER (352) 543
MULTI_MEASURE_REST (332) 384
MUSIC_FUNCTION (353) 89 94 99 315
MUSIC_IDENTIFIER (354) 193 219 320 396
NOTENAME_PITCH (355) 427
NUMBER_IDENTIFIER (271) 49 239 265 268 293 517 518 521 523
PITCH_IDENTIFIER (356) 430
PREC_BOT (258)
PREC_TOP (272)
REAL (269) 238 264 267 309 516 518
RESTNAME (357) 485
SCM_ARG (358) 27 246 294 341 342 343
SCM_FUNCTION (359) 46 91 96 101
SCM_IDENTIFIER (360) 23 24 250 270 301 376
SCM_TOKEN (361) 17 22 28 60 119 132 158
STRING (362) 65 230 233 253 271 304 354 365 367 370 372 434 461 487
SYMBOL_LIST (363) 223 224 225
TONICNAME_PITCH (364) 428
UNARY_MINUS (365)
UNSIGNED (270) 49 232 234 237 255 263 266 306 308 436 450 456 459 460

Nonterminals, with rules where they appear


   , on right: 99 
                 100 
                 101 
                 236 
                 237 
                 238 
                 239 
                 240 
                 241 
                 250 
                 251 
                 252 
                 253 
                 254 
                 255 
                 256 
                 277 
                 279 
                 283 
assignment (147)
    on left: 66 67 68, on right: 6 59 156
assignment_id (146)
    on left: 65, on right: 66 67 68
bare_number (295)
    on left: 519 520 521, on right: 377 378 515
basic_music (193)
    on left: 204 205 206 207 208, on right: 209 215 217
bass_number (273)
    on left: 460 461 462 463, on right: 468
book_block (155)
    on left: 110, on right: 10 36 76
bookpart_block (158)
    on left: 124, on right: 11 37 77 114
br_bass_figure (277)
    on left: 476 477, on right: 479
braced_music_list (175)
    on left: 168, on right: 181 182 183 184
chord_body (243)
    on left: 388 389, on right: 387
chord_body_element (245)
    on left: 392 393 394, on right: 391
chord_body_elements (244)
    on left: 390 391, on right: 388 391
chord_item (287)
    on left: 498 499 500, on right: 493
chord_items (285)
    on left: 492 493, on right: 491 493
chord_separator (286)
    on left: 494 495 496 497, on right: 491 498
composite_music (196)
    on left: 215 216 217, on right: 14 105 116 129 179
context_change (223)
    on left: 332, on right: 188
context_def_spec_block (151)
    on left: 102, on right: 35 79 154
context_mod (230)
    on left: 353 354 355, on right: 107 198
context_mod_arg (152)
    on left: 103 105, on right: 109 199
context_mod_list (190)
    on left: 197 198 199, on right: 190 198 199
context_modification (185)
    on left: 190 191, on right: 32 87 108 196
context_modification_arg (187)
    on left: 192 193, on right: 191
context_modification_mods_list (189)
    on left: 195 196, on right: 194 196
context_prefix (191)
    on left: 200 201, on right: 212 213 214
context_prop_spec (233)
    on left: 359, on right: 93 98 363 364
contextable_music (194)
    on left: 209 210 211, on right: 212 213
contexted_basic_music (195)
    on left: 212 213 214, on right: 214 216
direction_less_event (252)
    on left: 412 413 414 415, on right: 401 406
direction_reqd_event (253)
    on left: 416 417, on right: 405
dots (270)
    on left: 453 454, on right: 249 450 451 454
embedded_lilypond (141)
    on left: 50 51 52 53 54 55 56 57, on right: 3 57
embedded_lilypond_number (140)
    on left: 47 48 49, on right: 47 52
embedded_scm_active (135)
    on left: 24 25 26, on right: 18 61 120 133 157
embedded_scm_arg (138)
    on left: 43 44 45, on right: 240 258 290 374
embedded_scm_bare (134)
    on left: 22 23, on right: 40 231 369 371 373 463
event_chord (241)
    on left: 382 383 384 385 386, on right: 186 211
event_function_event (247)
    on left: 398, on right: 415
exclamations (297)
    on left: 525 526, on right: 392 482 526
figure_list (278)
    on left: 478 479, on right: 389 479
figured_bass_alteration (274)
    on left: 464 465 466, on right: 470
figured_bass_modification (276)
    on left: 472 473 474 475, on right: 471
fingering (263)
    on left: 436, on right: 407 408 410
full_markup_list (299)
    on left: 530, on right: 16 31 86 118 131
function_arglist (208)
    on left: 277 278, on right: 46 315 398
function_arglist_skip_nonbackup (209)
    on left: 279 280, on right: 278 280
gen_text_def (262)
    on left: 433 434 435, on right: 416
grob_prop_path (232)
    on left: 357 358, on right: 92 97 361
grob_prop_spec (231)
    on left: 356, on right: 357 358
grouped_music_list (198)
    on left: 221 222, on right: 220 319 321 322
header_block (144)
    on left: 64, on right: 9 33 74
identifier_init (148)
    on left: 69 70 71 72 73, on right: 66 67 68
lilypond (131)
    on left: 4 5 6 7 8, on right: 1 5 6 7 8
lilypond_header (143)
    on left: 62, on right: 64 122 135 146
lilypond_header_body (142)
    on left: 58 59 60 61, on right: 59 60 61 62
lookup (133)
    on left: 20 21, on right: 26 39 42
lyric_element (282)
    on left: 486 487 488, on right: 489
lyric_element_music (283)
    on left: 489, on right: 170 175 247 295
lyric_mode_music (218)
    on left: 319 320, on right: 202 203 207 208
markup (322)
    on left: 571 572, on right: 549 556
markup_braced_list (311)
    on left: 547, on right: 541
markup_braced_list_body (312)
    on left: 548 549 550, on right: 547 549 550
markup_command_list (313)
    on left: 551, on right: 542
markup_composed_list (310)
    on left: 546, on right: 539
markup_head_1_item (318)
    on left: 563, on right: 564 565
markup_head_1_list (319)
    on left: 564 565, on right: 535 546 558 565 571
markup_list (307)
    on left: 539 540, on right: 530 534 550 552
markup_mode (301)
    on left: 531, on right: 532 533
markup_partial_function (316)
    on left: 557 558, on right: 533
markup_scm (305)
    on left: 538, on right: 543 570
markup_top (304)
    on left: 534 535 536, on right: 532
markup_uncomposed_list (308)
    on left: 541 542 543 545, on right: 540 546
maybe_notemode_duration (266)
    on left: 447 448, on right: 449 482 490
mode_changed_music (220)
    on left: 321 322, on right: 218
mode_changing_head (221)
    on left: 323 324 325 326 327, on right: 321
multiplied_duration (269)
    on left: 452, on right: 54 176 243 274 298 448
multipliers (271)
    on left: 455 456 457, on right: 249 452 456 457
music (176)
    on left: 169 170 171, on right: 141 173 180 181
music_assign (180)
    on left: 178 179, on right: 45 80 153 169
music_bare (197)
    on left: 218 219 220, on right: 206
music_embedded (178)
    on left: 173 174 175 176, on right: 55 166
music_embedded_backup (179)
    on left: 177, on right: 174 175
music_function_call (216)
    on left: 315, on right: 204 395 402
music_function_chord_body (246)
    on left: 395 396 397, on right: 394
music_list (174)
    on left: 165 166 167, on right: 55 166 167 168 185
music_or_context_def (170)
    on left: 153 154, on right: 160
music_property_def (235)
    on left: 361 362 363 364, on right: 187
new_chord (284)
    on left: 490 491, on right: 483
new_lyrics (192)
    on left: 202 203, on right: 203 212 217
note_chord_element (242)
    on left: 387, on right: 386
number_expression (291)
    on left: 508 509 510, on right: 70 508 509
number_factor (293)
    on left: 514 515, on right: 511 512 513 514
number_term (292)
    on left: 511 512 513, on right: 508 509 510
octave_check (254)
    on left: 418 419, on right: 392 482
optional_context_mods (188)
    on left: 194, on right: 200 201 202 203 322
optional_id (217)
    on left: 316 317, on right: 200 201
optional_rest (279)
    on left: 480 481, on right: 482
output_def (167)
    on left: 148, on right: 19 38 78 142 147
output_def_head (168)
    on left: 149 150 151, on right: 152
output_def_head_with_mode_switch (169)
    on left: 152, on right: 155
paper_block (166)
    on left: 147, on right: 113 127
partial_markup (303)
    on left: 533, on right: 30 85
pitch (260)
    on left: 429 430, on right: 251 260 302 431 482
pitch_as_music (177)
    on left: 172, on right: 171 210
pitch_or_music (280)
    on left: 482 483, on right: 81 172 242 272 296 375
pitch_or_tonic_pitch (261)
    on left: 431 432, on right: 392
post_event (250)
    on left: 409 410, on right: 53 400
property_operation (225)
    on left: 334 335 336 337, on right: 353
property_path (224)
    on left: 333, on right: 67 68 71 72 358 380 381
questions (298)
    on left: 527 528, on right: 392 482 528
quotes (255)
    on left: 420 421 422, on right: 419 427 428 430
reparsed_rhythm (205)
    on left: 249, on right: 244 275 299
repeated_music (181)
    on left: 180 181, on right: 205
revert_arg (226)
    on left: 338, on right: 336 337 362
revert_arg_backup (227)
    on left: 339, on right: 338 341 342 343
revert_arg_part (228)
    on left: 340 341 342 343, on right: 339
scm_function_call (139)
    on left: 46, on right: 25 41 44
score_block (161)
    on left: 137, on right: 13 34 75 115 128
score_body (162)
    on left: 138 139, on right: 137 139 545 568
score_item (163)
    on left: 140 141 142, on right: 144
score_items (164)
    on left: 143 144 146, on right: 138 144 146
script_dir (265)
    on left: 444 445 446, on right: 402 405 406
sequential_music (182)
    on left: 182 183, on right: 222
simple_element (281)
    on left: 484 485, on right: 382
simple_markup (320)
    on left: 566 568 569 570, on right: 535 536 571 572
simple_music (184)
    on left: 186 187 188, on right: 178
simple_revert_context (234)
    on left: 360, on right: 362
simple_string (238)
    on left: 370 371, on right: 180 181 207 208 317 332
simultaneous_music (183)
    on left: 184 185, on right: 221
start_symbol (129)
    on left: 1 3, on right: 0
steno_duration (268)
    on left: 450 451, on right: 162 163 452
steno_pitch (258)
    on left: 427, on right: 429
step_number (289)
    on left: 503 504 505, on right: 501 502
step_numbers (288)
    on left: 501 502, on right: 499 502
string (236)
    on left: 365 366, on right: 83 379
string_number_event (251)
    on left: 411, on right: 412
sub_quotes (257)
    on left: 425 426, on right: 421 426
sup_quotes (256)
    on left: 423 424, on right: 422 424
symbol (239)
    on left: 372 373, on right: 200 201 208 332 334 335
symbol_list_arg (199)
    on left: 223 224 225, on right: 248 276 300 338
symbol_list_element (202)
    on left: 230 231 232, on right: 229
symbol_list_part_bare (203)
    on left: 233 234, on right: 71 72 380 381
tempo_event (173)
    on left: 162 163 164, on right: 385
tempo_range (290)
    on left: 506 507, on right: 162 163
text (237)
    on left: 367 368 369, on right: 163 164
tremolo_type (272)
    on left: 458 459, on right: 414
unsigned_number (296)
    on left: 522 523 524, on right: 180 181 506 507

LilyPond — Contributor’s Guide v2.19.46 (development-branch).