A. LilyPond grammar

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

Grammar

    1 start_symbol: lilypond

    3 start_symbol: "#{"  embedded_lilypond

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

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

   21 lookup: LOOKUP_IDENTIFIER
   22       | LOOKUP_IDENTIFIER '.' symbol_list_rev

   23 embedded_scm_bare: SCM_TOKEN
   24                  | SCM_IDENTIFIER

   25 embedded_scm_active: SCM_IDENTIFIER
   26                    | scm_function_call
   27                    | lookup

   28 embedded_scm_bare_arg: SCM_ARG
   29                      | SCM_TOKEN
   30                      | FRACTION
   31                      | partial_markup
   32                      | full_markup_list
   33                      | context_modification
   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 embedded_scm

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

   62 assignment_id: STRING

   63 assignment: assignment_id '=' identifier_init
   64           | assignment_id '.' property_path '=' identifier_init
   65           | assignment_id ',' property_path '=' identifier_init

   66 identifier_init: identifier_init_nonumber
   67                | number_expression
   68                | symbol_list_part_bare '.' property_path
   69                | symbol_list_part_bare ',' property_path
   70                | post_event_nofinger post_events

   71 identifier_init_nonumber: score_block
   72                         | book_block
   73                         | bookpart_block
   74                         | output_def
   75                         | context_def_spec_block
   76                         | music_assign
   77                         | pitch_or_music
   78                         | FRACTION
   79                         | string
   80                         | embedded_scm
   81                         | partial_markup
   82                         | full_markup_list
   83                         | context_modification
   84                         | partial_function "\etc"

   85 partial_function: MUSIC_FUNCTION function_arglist_partial
   86                 | EVENT_FUNCTION function_arglist_partial
   87                 | SCM_FUNCTION function_arglist_partial
   88                 | "\override" grob_prop_path '='
   89                 | "\set" context_prop_spec '='
   90                 | MUSIC_FUNCTION 
                          "scheme?" 
                          function_arglist_optional 
                          partial_function 
   91                 | EVENT_FUNCTION 
                          "scheme?" 
                          function_arglist_optional 
                          partial_function 
   92                 | SCM_FUNCTION 
                          "scheme?" 
                          function_arglist_optional 
                          partial_function 
   93                 | "\override" grob_prop_path '=' partial_function
   94                 | "\set" context_prop_spec '=' partial_function
   95                 | MUSIC_FUNCTION 
                          "optional?" 
                          "scheme?" 
                          function_arglist_nonbackup 
                          partial_function 
   96                 | EVENT_FUNCTION 
                          "optional?" 
                          "scheme?" 
                          function_arglist_nonbackup 
                          partial_function 
   97                 | SCM_FUNCTION 
                          "optional?" 
                          "scheme?" 
                          function_arglist_nonbackup 
                          partial_function 

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

   99 context_mod_arg: embedded_scm

  101 context_mod_arg:  composite_music

  102 context_def_spec_body: /* empty */
  103                      | context_def_spec_body context_mod
  104                      | context_def_spec_body context_modification
  105                      | context_def_spec_body context_mod_arg

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

  107 book_body: /* empty */
  108          | BOOK_IDENTIFIER
  109          | book_body paper_block
  110          | book_body bookpart_block
  111          | book_body score_block
  112          | book_body composite_music
  113          | book_body full_markup
  114          | book_body full_markup_list
  115          | book_body SCM_TOKEN
  116          | book_body embedded_scm_active

  118 book_body: book_body  lilypond_header
  119          | book_body error

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

  121 bookpart_body: /* empty */
  122              | BOOK_IDENTIFIER
  123              | bookpart_body paper_block
  124              | bookpart_body score_block
  125              | bookpart_body composite_music
  126              | bookpart_body full_markup
  127              | bookpart_body full_markup_list
  128              | bookpart_body SCM_TOKEN
  129              | bookpart_body embedded_scm_active

  131 bookpart_body: bookpart_body  lilypond_header
  132              | bookpart_body error

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

  134 score_body: score_items
  135           | score_body error

  136 score_item: embedded_scm
  137           | music
  138           | output_def

  139 score_items: /* empty */
  140            | score_items score_item

  142 score_items: score_items  lilypond_header

  143 paper_block: output_def

  144 output_def: output_def_body '}'

  145 output_def_head: "\paper"
  146                | "\midi"
  147                | "\layout"

  148 output_def_head_with_mode_switch: output_def_head

  149 music_or_context_def: music_assign
  150                     | context_def_spec_block

  151 output_def_body: output_def_head_with_mode_switch '{'
  152                | output_def_body assignment
  153                | output_def_body embedded_scm_active
  154                | output_def_body SCM_TOKEN

  156 output_def_body: output_def_body  music_or_context_def
  157                | output_def_body error

  158 tempo_event: "\tempo" steno_duration '=' tempo_range
  159            | "\tempo" text steno_duration '=' tempo_range
  160            | "\tempo" text

  161 music_list: /* empty */
  162           | music_list music_embedded
  163           | music_list error

  164 braced_music_list: '{' music_list '}'

  165 music: music_assign
  166      | lyric_element_music
  167      | pitch_as_music

  168 pitch_as_music: pitch_or_music

  169 music_embedded: music
  170               | music_embedded_backup
  171               | music_embedded_backup 
                        "(backed-up?)" 
                        lyric_element_music 
  172               | multiplied_duration post_events

  173 music_embedded_backup: embedded_scm

  174 music_assign: simple_music
  175             | composite_music

  176 repeated_music: "\repeat" simple_string unsigned_number music
  177               | "\repeat" 
                        simple_string 
                        unsigned_number 
                        music 
                        "\alternative" 
                        braced_music_list 

  178 sequential_music: "\sequential" braced_music_list
  179                 | braced_music_list

  180 simultaneous_music: "\simultaneous" braced_music_list
  181                   | "<<" music_list ">>"

  182 simple_music: event_chord
  183             | music_property_def
  184             | context_change

  186 context_modification: "\with"  '{' context_mod_list '}'
  187                     | "\with" CONTEXT_MOD_IDENTIFIER
  188                     | CONTEXT_MOD_IDENTIFIER
  189                     | "\with" context_modification_arg

  190 context_modification_arg: embedded_scm
  191                         | MUSIC_IDENTIFIER

  192 optional_context_mod: /* empty */
  193                     | context_modification

  194 context_mod_list: /* empty */
  195                 | context_mod_list context_mod
  196                 | context_mod_list CONTEXT_MOD_IDENTIFIER
  197                 | context_mod_list context_mod_arg

  198 context_prefix: "\context" symbol optional_id optional_context_mod
  199               | "\new" symbol optional_id optional_context_mod

  200 new_lyrics: "\addlyrics" optional_context_mod lyric_mode_music
  201           | new_lyrics 
                    "\addlyrics" 
                    optional_context_mod 
                    lyric_mode_music 

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

  207 contextable_music: basic_music
  208                  | pitch_as_music
  209                  | event_chord

  210 contexted_basic_music: context_prefix contextable_music new_lyrics
  211                      | context_prefix contextable_music
  212                      | context_prefix contexted_basic_music

  213 composite_music: basic_music
  214                | contexted_basic_music
  215                | basic_music new_lyrics

  216 music_bare: mode_changed_music
  217           | MUSIC_IDENTIFIER
  218           | grouped_music_list

  219 grouped_music_list: simultaneous_music
  220                   | sequential_music

  221 symbol_list_arg: SYMBOL_LIST
  222                | SYMBOL_LIST '.' symbol_list_rev
  223                | SYMBOL_LIST ',' symbol_list_rev

  224 symbol_list_rev: symbol_list_part
  225                | symbol_list_rev '.' symbol_list_part
  226                | symbol_list_rev ',' symbol_list_part

  227 symbol_list_part: symbol_list_element

  228 symbol_list_element: STRING
  229                    | embedded_scm_bare
  230                    | UNSIGNED

  231 symbol_list_part_bare: STRING
  232                      | UNSIGNED

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

  247 reparsed_rhythm: DURATION_ARG dots multipliers post_events

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

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

  275 function_arglist: function_arglist_nonbackup
  276                 | "optional?" 
                          "scheme?" 
                          function_arglist_skip_nonbackup 
                          "\default" 

  277 function_arglist_skip_nonbackup: function_arglist_nonbackup
  278                                | "optional?" 
                                         "scheme?" 
                                         function_arglist_skip_nonbackup 

  279 function_arglist_partial: "scheme?" function_arglist_optional
  280                         | "scheme?" function_arglist_partial_optional
  281                         | "optional?" 
                                  "scheme?" 
                                  function_arglist_nonbackup 
  282                         | "optional?" 
                                  "scheme?" 
                                  function_arglist_partial 

  283 function_arglist_partial_optional: "scheme?" function_arglist_optional
  284                                  | "scheme?" 
                                           function_arglist_partial_optional 
  285                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_backup 
  286                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_partial_optional 

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

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

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

  311 function_arglist_skip_backup: function_arglist_backup
  312                             | "optional?" 
                                      "scheme?" 
                                      function_arglist_skip_backup 

  313 music_function_call: MUSIC_FUNCTION function_arglist

  314 optional_id: /* empty */
  315            | '=' simple_string

  317 lyric_mode_music:  grouped_music_list
  318                 | MUSIC_IDENTIFIER

  319 mode_changed_music: mode_changing_head grouped_music_list
  320                   | mode_changing_head_with_context 
                            optional_context_mod 
                            grouped_music_list 

  321 mode_changing_head: "\notemode"
  322                   | "\drummode"
  323                   | "\figuremode"
  324                   | "\chordmode"
  325                   | "\lyricmode"

  326 mode_changing_head_with_context: "\drums"
  327                                | "\figures"
  328                                | "\chords"
  329                                | "\lyrics"

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

  331 property_path: symbol_list_rev

  332 property_operation: symbol '=' scalar
  333                   | "\unset" symbol
  334                   | "\override" revert_arg '=' scalar
  335                   | "\revert" revert_arg

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

  337 revert_arg_backup: revert_arg_part

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

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

  351 context_mod: property_operation
  352            | context_def_mod STRING
  353            | context_def_mod embedded_scm

  354 grob_prop_spec: symbol_list_rev

  355 grob_prop_path: grob_prop_spec
  356               | grob_prop_spec property_path

  357 context_prop_spec: symbol_list_rev

  358 simple_revert_context: symbol_list_part

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

  363 string: STRING
  364       | full_markup

  365 text: STRING
  366     | full_markup
  367     | embedded_scm_bare

  368 simple_string: STRING
  369              | embedded_scm_bare

  370 symbol: STRING
  371       | embedded_scm_bare

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

  380 event_chord: simple_element post_events
  381            | CHORD_REPETITION optional_notemode_duration post_events
  382            | MULTI_MEASURE_REST optional_notemode_duration post_events
  383            | tempo_event
  384            | note_chord_element

  385 note_chord_element: chord_body optional_notemode_duration post_events

  386 chord_body: "<" chord_body_elements ">"
  387           | FIGURE_OPEN figure_list FIGURE_CLOSE

  388 chord_body_elements: /* empty */
  389                    | chord_body_elements chord_body_element

  390 chord_body_element: pitch_or_tonic_pitch 
                            exclamations 
                            questions 
                            octave_check 
                            post_events 
  391                   | DRUM_PITCH post_events
  392                   | music_function_chord_body

  393 music_function_chord_body: music_function_call
  394                          | MUSIC_IDENTIFIER
  395                          | embedded_scm

  396 event_function_event: EVENT_FUNCTION function_arglist

  397 post_events: /* empty */
  398            | post_events post_event

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

  407 post_event: post_event_nofinger
  408           | '-' fingering

  409 string_number_event: E_UNSIGNED

  410 direction_less_event: string_number_event
  411                     | EVENT_IDENTIFIER
  412                     | tremolo_type
  413                     | event_function_event

  414 direction_reqd_event: gen_text_def
  415                     | script_abbreviation

  416 octave_check: /* empty */
  417             | '=' quotes

  418 quotes: /* empty */
  419       | sub_quotes
  420       | sup_quotes

  421 sup_quotes: '''
  422           | sup_quotes '''

  423 sub_quotes: ','
  424           | sub_quotes ','

  425 steno_pitch: NOTENAME_PITCH quotes

  426 steno_tonic_pitch: TONICNAME_PITCH quotes

  427 pitch: steno_pitch
  428      | PITCH_IDENTIFIER quotes

  429 pitch_or_tonic_pitch: pitch
  430                     | steno_tonic_pitch

  431 gen_text_def: full_markup
  432             | STRING
  433             | embedded_scm

  434 fingering: UNSIGNED

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

  442 script_dir: '_'
  443           | '^'
  444           | '-'

  445 maybe_notemode_duration: /* empty */
  446                        | multiplied_duration

  447 optional_notemode_duration: maybe_notemode_duration

  448 steno_duration: UNSIGNED dots
  449               | DURATION_IDENTIFIER dots

  450 multiplied_duration: steno_duration multipliers

  451 dots: /* empty */
  452     | dots '.'

  453 multipliers: /* empty */
  454            | multipliers '*' UNSIGNED
  455            | multipliers '*' FRACTION

  456 tremolo_type: ':'
  457             | ':' UNSIGNED

  458 bass_number: UNSIGNED
  459            | STRING
  460            | full_markup
  461            | embedded_scm_bare

  462 figured_bass_alteration: '-'
  463                        | '+'
  464                        | '!'

  465 bass_figure: "_"
  466            | bass_number
  467            | bass_figure ']'
  468            | bass_figure figured_bass_alteration
  469            | bass_figure figured_bass_modification

  470 figured_bass_modification: "\+"
  471                          | "\!"
  472                          | '/'
  473                          | "\"

  474 br_bass_figure: bass_figure
  475               | '[' bass_figure

  476 figure_list: /* empty */
  477            | figure_list br_bass_figure

  478 optional_rest: /* empty */
  479              | "\rest"

  480 pitch_or_music: pitch 
                        exclamations 
                        questions 
                        octave_check 
                        maybe_notemode_duration 
                        optional_rest 
                        post_events 
  481               | new_chord post_events

  482 simple_element: DRUM_PITCH optional_notemode_duration
  483               | RESTNAME optional_notemode_duration

  484 lyric_element: full_markup
  485              | STRING
  486              | LYRIC_ELEMENT

  487 lyric_element_music: lyric_element 
                             optional_notemode_duration 
                             post_events 

  488 new_chord: steno_tonic_pitch maybe_notemode_duration
  489          | steno_tonic_pitch 
                   optional_notemode_duration 
                   chord_separator 
                   chord_items 

  490 chord_items: /* empty */
  491            | chord_items chord_item

  492 chord_separator: ":"
  493                | "^"
  494                | "/" steno_tonic_pitch
  495                | "/+" steno_tonic_pitch

  496 chord_item: chord_separator
  497           | step_numbers
  498           | CHORD_MODIFIER

  499 step_numbers: step_number
  500             | step_numbers '.' step_number

  501 step_number: UNSIGNED
  502            | UNSIGNED '+'
  503            | UNSIGNED "-"

  504 tempo_range: unsigned_number
  505            | unsigned_number '-' unsigned_number

  506 number_expression: number_expression '+' number_term
  507                  | number_expression '-' number_term
  508                  | number_term

  509 number_term: number_factor
  510            | number_factor '*' number_factor
  511            | number_factor '/' number_factor

  512 number_factor: '-' number_factor
  513              | bare_number

  514 bare_number_common: REAL
  515                   | NUMBER_IDENTIFIER
  516                   | REAL NUMBER_IDENTIFIER

  517 bare_number: bare_number_common
  518            | UNSIGNED
  519            | UNSIGNED NUMBER_IDENTIFIER

  520 unsigned_number: UNSIGNED
  521                | NUMBER_IDENTIFIER
  522                | embedded_scm

  523 exclamations: /* empty */
  524             | exclamations '!'

  525 questions: /* empty */
  526          | questions '?'

  528 full_markup_list: "\markuplist" 0 markup_list

  529 markup_mode: "\markup"

  530 full_markup: markup_mode markup_top

  531 partial_markup: markup_mode markup_partial_function "\etc"

  532 markup_top: markup_list
  533           | markup_head_1_list simple_markup
  534           | simple_markup

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

  537 markup_list: markup_composed_list
  538            | markup_uncomposed_list

  539 markup_uncomposed_list: markup_braced_list
  540                       | markup_command_list
  541                       | markup_scm MARKUPLIST_IDENTIFIER

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

  544 markup_composed_list: markup_head_1_list markup_uncomposed_list

  545 markup_braced_list: '{' markup_braced_list_body '}'

  546 markup_braced_list_body: /* empty */
  547                        | markup_braced_list_body markup
  548                        | markup_braced_list_body markup_list

  549 markup_command_list: MARKUP_LIST_FUNCTION markup_command_list_arguments

  550 markup_command_basic_arguments: "markup-list?" 
                                        markup_command_list_arguments 
                                        markup_list 
  551                               | "scheme?" 
                                        markup_command_list_arguments 
                                        embedded_scm 
  552                               | EXPECT_NO_MORE_ARGS

  553 markup_command_list_arguments: markup_command_basic_arguments
  554                              | "markup?" 
                                       markup_command_list_arguments 
                                       markup 

  555 markup_partial_function: MARKUP_FUNCTION markup_arglist_partial
  556                        | markup_head_1_list 
                                 MARKUP_FUNCTION 
                                 markup_arglist_partial 

  557 markup_arglist_partial: "markup?" markup_arglist_partial
  558                       | "scheme?" markup_arglist_partial
  559                       | "markup?" markup_command_list_arguments
  560                       | "scheme?" markup_command_list_arguments

  561 markup_head_1_item: MARKUP_FUNCTION 
                            "markup?" 
                            markup_command_list_arguments 

  562 markup_head_1_list: markup_head_1_item
  563                   | markup_head_1_list markup_head_1_item

  564 simple_markup: STRING

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

  569 markup: markup_head_1_list simple_markup
  570       | simple_markup


Terminals, with rules where they appear



    251 252 253 254 256 257 258 259 260 261 262 263 264 265 266 267
    252 253 254 256 257 258 259 260 261 262 263 264 265 266 267 268
    268 269 276 278 279 280 281 282 283 284 285 286 288 289 290 291
    269 276 278 281 282 285 286 309 312
    292 293 294 295 296 297 298
    299 300 301 302 303 304 305 306 307 309 312 551 558 560
    501 502 503 518 519 520
    505 507 512
    564
"#{" (340) 3
"(backed-up?)" (335) 171 310 336 339 340 341 536
"(reparsed?)" (336) 240 241 242 243 244 245 246 270 271 272 273 274
"-" (320) 503
"--" (265) 401
"/" (321) 494
"/+" (317) 495
":" (319) 492
"<" (322) 386
"<<" (324) 181
">" (323) 386 439
">>" (325) 181
"\!" (327) 471
"\" (326) 473
"\+" (328) 470
"\accepts" (273) 344
"\addlyrics" (262) 200 201
"\alias" (274) 347
"\alternative" (260) 177
"\book" (275) 106
"\bookpart" (276) 120
"\change" (277) 330
"\chordmode" (278) 324
"\chords" (279) 328
"\consists" (280) 342
"\context" (281) 98 198
"\default" (282) 276 309
"\defaultchild" (283) 345
"\denies" (284) 346
"\description" (285) 349
"\drummode" (286) 322
"\drums" (287) 326
"\etc" (288) 84 531
"\figuremode" (289) 323
"\figures" (290) 327
"\header" (291) 61
"\layout" (293) 147
"\lyricmode" (294) 325
"\lyrics" (295) 329
"\lyricsto" (296) 205 206
"\markup" (297) 529
"\markuplist" (298) 528
"\midi" (299) 146
"\name" (300) 350
"\new" (316) 199
"\notemode" (301) 321
"\override" (302) 88 93 334 359
"\paper" (303) 145
"\remove" (304) 343
"\repeat" (259) 176 177
"\rest" (305) 479
"\revert" (306) 335 360
"\score" (307) 133 566
"\score-lines" (308) 543
"\sequential" (309) 178
"\set" (310) 89 94 361
"\simultaneous" (311) 180
"\tempo" (312) 158 159 160
"\type" (313) 348
"\unset" (314) 333 362
"\version-error" (292) 8 57
"\with" (315) 186 187 189
"^" (318) 493
"_" (331) 465
"__" (264) 402
"end of input" (0) 0
"markup-list?" (337) 550
"markup?" (333) 554 557 559 561
"optional?" (338) 95 96 97 234 235 236 237 238 239 248 249 250 251
"scheme?" (334) 90 91 92 95 96 97 234 235 236 237 238 239 248 249 250
'!' (33) 438 464 524
''' (39) 421 422
'*' (42) 454 455 510
'+' (43) 436 463 502 506
',' (44) 65 69 223 226 340 379 423 424
'-' (45) 47 235 236 237 264 265 266 291 306 307 376 408 437 444 462
'.' (46) 22 64 68 222 225 339 378 440 452 500
'/' (47) 472 511
':' (58) 456 457
'=' (61) 63 64 65 88 89 93 94 158 159 206 315 330 332 334 359 361 417
'?' (63) 526
'[' (91) 475
']' (93) 467
'^' (94) 405 435 443
'_' (95) 406 441 442
'{' (123) 61 98 106 120 133 151 164 186 543 545 566
'}' (125) 61 98 106 120 133 144 164 186 543 545 566
BOOK_IDENTIFIER (341) 13 108 122
CHORD_MODIFIER (342) 498
CHORD_REPETITION (343) 381
COMPOSITE (261)
CONTEXT_MOD_IDENTIFIER (344) 187 188 196
DRUM_PITCH (345) 391 482
DURATION_ARG (346) 247
DURATION_IDENTIFIER (263) 254 267 305 449
E_UNSIGNED (268) 409
error (256) 7 56 119 132 135 157 163
EVENT_FUNCTION (266) 86 91 96 396
EVENT_IDENTIFIER (267) 411
EXPECT_NO_MORE_ARGS (339) 287 552
FIGURE_CLOSE (329) 387
FIGURE_OPEN (330) 387
FRACTION (347) 30 78 455
LOOKUP_IDENTIFIER (348) 21 22
LYRIC_ELEMENT (349) 486
MARKUP_FUNCTION (350) 555 556 561 567
MARKUP_IDENTIFIER (352) 568
MARKUP_LIST_FUNCTION (351) 549
MARKUPLIST_IDENTIFIER (353) 541
MULTI_MEASURE_REST (332) 382
MUSIC_FUNCTION (354) 85 90 95 313
MUSIC_IDENTIFIER (355) 191 217 318 394
NOTENAME_PITCH (356) 425
NUMBER_IDENTIFIER (271) 49 237 263 266 291 515 516 519 521
PITCH_IDENTIFIER (357) 428
PREC_BOT (258)
PREC_TOP (272)
REAL (269) 236 262 265 307 514 516
RESTNAME (358) 483
SCM_ARG (359) 28 244 292 339 340 341
SCM_FUNCTION (360) 46 87 92 97
SCM_IDENTIFIER (361) 24 25 248 268 299 374
SCM_TOKEN (362) 18 23 29 115 128 154
STRING (363) 62 228 231 251 269 302 352 363 365 368 370 432 459 485
SYMBOL_LIST (364) 221 222 223
TONICNAME_PITCH (365) 426
UNARY_MINUS (366)
UNSIGNED (270) 49 230 232 235 253 261 264 304 306 434 448 454 457 458

Nonterminals, with rules where they appear


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

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