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

   20 embedded_scm_bare: SCM_TOKEN
   21                  | SCM_IDENTIFIER

   22 embedded_scm_active: SCM_IDENTIFIER
   23                    | scm_function_call

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

   34 embedded_scm: embedded_scm_bare
   35             | scm_function_call

   36 embedded_scm_arg: embedded_scm_bare_arg
   37                 | scm_function_call
   38                 | music_assign

   39 scm_function_call: SCM_FUNCTION function_arglist

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

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

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

   49 assignment_id: STRING

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

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

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

   66 context_mod_arg: embedded_scm

   68 context_mod_arg:  composite_music

   69 context_mod_embedded: context_mod_arg

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

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

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

   87 book_body: book_body  lilypond_header
   88          | book_body error

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

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

  100 bookpart_body: bookpart_body  lilypond_header
  101              | bookpart_body error

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

  103 score_body: music
  104           | embedded_scm_active

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

  109 paper_block: output_def

  110 output_def: output_def_body '}'

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

  114 output_def_head_with_mode_switch: output_def_head

  115 music_or_context_def: music_arg
  116                     | context_def_spec_block

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

  122 output_def_body: output_def_body  music_or_context_def
  123                | output_def_body error

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

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

  130 braced_music_list: '{' music_list '}'

  131 music: music_arg
  132      | lyric_element_music

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

  136 music_embedded_backup: embedded_scm

  137 music_arg: simple_music
  138          | composite_music

  139 music_assign: simple_music
  140             | composite_music

  141 repeated_music: "\repeat" simple_string unsigned_number music
  142               | REPEAT_IDENTIFIER music
  143               | "\repeat" 
                        simple_string 
                        unsigned_number 
                        music 
                        "\alternative" 
                        braced_music_list 
  144               | REPEAT_IDENTIFIER 
                        music 
                        "\alternative" 
                        braced_music_list 

  145 sequential_music: "\sequential" braced_music_list
  146                 | braced_music_list

  147 simultaneous_music: "\simultaneous" braced_music_list
  148                   | "<<" music_list ">>"

  149 simple_music: event_chord
  150             | music_property_def
  151             | context_change

  153 context_modification: "\with"  '{' context_mod_list '}'
  154                     | "\with" CONTEXT_MOD_IDENTIFIER
  155                     | CONTEXT_MOD_IDENTIFIER
  156                     | "\with" context_modification_arg

  157 context_modification_arg: embedded_scm_closed
  158                         | MUSIC_IDENTIFIER

  159 optional_context_mod: /* empty */
  160                     | context_modification

  161 context_mod_list: /* empty */
  162                 | context_mod_list context_mod
  163                 | context_mod_list CONTEXT_MOD_IDENTIFIER
  164                 | context_mod_list context_mod_embedded

  165 composite_music: complex_music
  166                | music_bare

  167 closed_music: music_bare
  168             | complex_music_prefix closed_music
  169             | music_function_call_closed

  170 music_bare: mode_changed_music
  171           | MUSIC_IDENTIFIER
  172           | grouped_music_list

  173 grouped_music_list: simultaneous_music
  174                   | sequential_music

  175 function_arglist_nonbackup_common: "optional?" 
                                           "scheme?" 
                                           function_arglist_nonbackup 
                                           post_event_nofinger 
  176                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_nonbackup 
                                           '-' 
                                           UNSIGNED 
  177                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_nonbackup 
                                           '-' 
                                           REAL 
  178                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_nonbackup 
                                           '-' 
                                           NUMBER_IDENTIFIER 

  179 function_arglist_closed_nonbackup: function_arglist_nonbackup_common
  180                                  | function_arglist_closed_common
  181                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_nonbackup 
                                           embedded_scm_arg_closed 
  182                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_nonbackup 
                                           bare_number_closed 
  183                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_nonbackup 
                                           SCM_IDENTIFIER 
  184                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_nonbackup 
                                           STRING 
  185                                  | "optional?" 
                                           "scheme?" 
                                           function_arglist_nonbackup 
                                           full_markup 

  186 symbol_list_arg: SYMBOL_LIST
  187                | SYMBOL_LIST '.' symbol_list_rev

  188 symbol_list_rev: symbol_list_part
  189                | symbol_list_rev '.' symbol_list_part

  190 symbol_list_part: symbol_list_element

  191 symbol_list_element: STRING
  192                    | embedded_scm_bare

  193 function_arglist_nonbackup: function_arglist_nonbackup_common
  194                           | function_arglist_common
  195                           | "optional?" 
                                    "scheme?" 
                                    function_arglist_nonbackup 
                                    embedded_scm_arg 
  196                           | "optional?" 
                                    "scheme?" 
                                    function_arglist_nonbackup 
                                    bare_number_common 
  197                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    duration_length 
  198                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    bare_number_common 
  199                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    SCM_ARG 
  200                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    lyric_element_music 
  201                           | function_arglist_nonbackup_reparse 
                                    "(reparsed?)" 
                                    symbol_list_arg 

  202 function_arglist_nonbackup_reparse: "optional?" 
                                            "scheme?" 
                                            function_arglist_nonbackup 
                                            SCM_IDENTIFIER 
  203                                   | "optional?" 
                                            "scheme?" 
                                            function_arglist_nonbackup 
                                            STRING 
  204                                   | "optional?" 
                                            "scheme?" 
                                            function_arglist_nonbackup 
                                            full_markup 
  205                                   | "optional?" 
                                            "scheme?" 
                                            function_arglist_nonbackup 
                                            UNSIGNED 
  206                                   | "optional?" 
                                            "scheme?" 
                                            function_arglist_nonbackup 
                                            DURATION_IDENTIFIER 

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

  230 function_arglist: function_arglist_nonbackup
  231                 | "optional?" 
                          "scheme?" 
                          function_arglist_skip_nonbackup 
                          "\default" 

  232 function_arglist_skip_nonbackup: function_arglist_nonbackup
  233                                | "optional?" 
                                         "scheme?" 
                                         function_arglist_skip_nonbackup 

  234 function_arglist_common: EXPECT_NO_MORE_ARGS
  235                        | "scheme?" 
                                 function_arglist_optional 
                                 embedded_scm_arg 
  236                        | "scheme?" 
                                 function_arglist_optional 
                                 bare_number_common 
  237                        | "scheme?" 
                                 function_arglist_optional 
                                 post_event_nofinger 
  238                        | "scheme?" 
                                 function_arglist_optional 
                                 '-' 
                                 NUMBER_IDENTIFIER 
  239                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 SCM_ARG 
  240                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 lyric_element_music 
  241                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 bare_number_common 
  242                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 duration_length 
  243                        | function_arglist_common_reparse 
                                 "(reparsed?)" 
                                 symbol_list_arg 

  244 function_arglist_common_reparse: "scheme?" 
                                         function_arglist_optional 
                                         SCM_IDENTIFIER 
  245                                | "scheme?" 
                                         function_arglist_optional 
                                         STRING 
  246                                | "scheme?" 
                                         function_arglist_optional 
                                         full_markup 
  247                                | "scheme?" 
                                         function_arglist_optional 
                                         UNSIGNED 
  248                                | "scheme?" 
                                         function_arglist_optional 
                                         DURATION_IDENTIFIER 
  249                                | "scheme?" 
                                         function_arglist_optional 
                                         '-' 
                                         UNSIGNED 
  250                                | "scheme?" 
                                         function_arglist_optional 
                                         '-' 
                                         REAL 

  251 function_arglist_closed: function_arglist_closed_nonbackup
  252                        | "optional?" 
                                 "scheme?" 
                                 function_arglist_skip_nonbackup 
                                 "\default" 

  253 function_arglist_closed_common: EXPECT_NO_MORE_ARGS
  254                               | "scheme?" 
                                        function_arglist_optional 
                                        embedded_scm_arg_closed 
  255                               | "scheme?" 
                                        function_arglist_optional 
                                        bare_number_common_closed 
  256                               | "scheme?" 
                                        function_arglist_optional 
                                        '-' 
                                        NUMBER_IDENTIFIER 
  257                               | "scheme?" 
                                        function_arglist_optional 
                                        post_event_nofinger 
  258                               | function_arglist_common_reparse 
                                        "(reparsed?)" 
                                        SCM_ARG 
  259                               | function_arglist_common_reparse 
                                        "(reparsed?)" 
                                        bare_number_common_closed 
  260                               | function_arglist_common_reparse 
                                        "(reparsed?)" 
                                        symbol_list_arg 

  261 function_arglist_optional: function_arglist_backup
  262                          | "optional?" 
                                   "scheme?" 
                                   function_arglist_skip_backup 
                                   "\default" 
  263                          | function_arglist_skip_backup "(backed-up?)"

  264 function_arglist_skip_backup: function_arglist_backup
  265                             | "optional?" 
                                      "scheme?" 
                                      function_arglist_skip_backup 

  266 embedded_scm_closed: embedded_scm_bare
  267                    | scm_function_call_closed

  268 embedded_scm_arg_closed: embedded_scm_bare_arg
  269                        | scm_function_call_closed
  270                        | closed_music

  271 scm_function_call_closed: SCM_FUNCTION function_arglist_closed

  272 music_function_call: MUSIC_FUNCTION function_arglist

  273 optional_id: /* empty */
  274            | '=' simple_string

  275 complex_music: music_function_call
  276              | repeated_music
  277              | re_rhythmed_music
  278              | complex_music_prefix music

  279 complex_music_prefix: "\context" 
                              symbol 
                              optional_id 
                              optional_context_mod 
  280                     | "\new" symbol optional_id optional_context_mod

  281 mode_changed_music: mode_changing_head grouped_music_list
  282                   | mode_changing_head_with_context 
                            optional_context_mod 
                            grouped_music_list 

  283 mode_changing_head: "\notemode"
  284                   | "\drummode"
  285                   | "\figuremode"
  286                   | "\chordmode"
  287                   | "\lyricmode"

  288 mode_changing_head_with_context: "\drums"
  289                                | "\figures"
  290                                | "\chords"
  291                                | "\lyrics"

  293 new_lyrics: "\addlyrics"  composite_music

  295 new_lyrics: new_lyrics "\addlyrics" 0 composite_music

  296 re_rhythmed_music: composite_music new_lyrics

  298 re_rhythmed_music: "\lyricsto" simple_string 1 music

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

  300 property_path: symbol_list_rev
  301              | symbol_list_rev property_path

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

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

  307 revert_arg_backup: revert_arg_part

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

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

  320 context_mod: property_operation
  321            | context_def_mod STRING
  322            | context_def_mod embedded_scm

  323 grob_prop_spec: symbol_list_rev

  324 grob_prop_path: grob_prop_spec
  325               | grob_prop_spec property_path

  326 context_prop_spec: symbol_list_rev

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

  331 simple_revert_context: symbol_list_part

  332 music_property_def: simple_music_property_def

  333 string: STRING
  334       | full_markup

  335 simple_string: STRING
  336              | embedded_scm_bare

  337 symbol: STRING
  338       | embedded_scm_bare

  339 scalar: embedded_scm_arg
  340       | SCM_IDENTIFIER
  341       | bare_number
  342       | '-' bare_number
  343       | STRING
  344       | full_markup

  345 event_chord: simple_element post_events
  346            | simple_chord_elements post_events
  347            | CHORD_REPETITION optional_notemode_duration post_events
  348            | MULTI_MEASURE_REST optional_notemode_duration post_events
  349            | command_element
  350            | note_chord_element

  351 note_chord_element: chord_body optional_notemode_duration post_events

  352 chord_body: "<" chord_body_elements ">"
  353           | CHORD_BODY_IDENTIFIER

  354 chord_body_elements: /* empty */
  355                    | chord_body_elements chord_body_element

  356 chord_body_element: pitch 
                            exclamations 
                            questions 
                            octave_check 
                            post_events 
  357                   | DRUM_PITCH post_events
  358                   | music_function_chord_body

  359 music_function_chord_body: music_function_call
  360                          | MUSIC_IDENTIFIER

  361 music_function_call_closed: MUSIC_FUNCTION function_arglist_closed

  362 event_function_event: EVENT_FUNCTION function_arglist_closed

  363 command_element: command_event

  364 command_event: tempo_event

  365 post_events: /* empty */
  366            | post_events post_event

  367 post_event_nofinger: direction_less_event
  368                    | script_dir music_function_call_closed
  369                    | "--"
  370                    | "__"
  371                    | script_dir direction_reqd_event
  372                    | script_dir direction_less_event
  373                    | '^' fingering
  374                    | '_' fingering

  375 post_event: post_event_nofinger
  376           | '-' fingering

  377 string_number_event: E_UNSIGNED

  378 direction_less_event: string_number_event
  379                     | EVENT_IDENTIFIER
  380                     | tremolo_type
  381                     | event_function_event

  382 direction_reqd_event: gen_text_def
  383                     | script_abbreviation

  384 octave_check: /* empty */
  385             | '=' quotes

  386 quotes: /* empty */
  387       | sub_quotes
  388       | sup_quotes

  389 sup_quotes: '''
  390           | sup_quotes '''

  391 sub_quotes: ','
  392           | sub_quotes ','

  393 steno_pitch: NOTENAME_PITCH quotes

  394 steno_tonic_pitch: TONICNAME_PITCH quotes

  395 pitch: steno_pitch
  396      | PITCH_IDENTIFIER quotes

  397 pitch_arg: PITCH_ARG quotes

  398 gen_text_def: full_markup
  399             | STRING
  400             | embedded_scm_closed

  401 fingering: UNSIGNED

  402 script_abbreviation: '^'
  403                    | '+'
  404                    | '-'
  405                    | '!'
  406                    | ">"
  407                    | '.'
  408                    | '_'

  409 script_dir: '_'
  410           | '^'
  411           | '-'

  412 duration_length: multiplied_duration

  413 maybe_notemode_duration: /* empty */
  414                        | multiplied_duration

  415 optional_notemode_duration: maybe_notemode_duration

  416 steno_duration: UNSIGNED dots
  417               | DURATION_IDENTIFIER dots

  418 multiplied_duration: steno_duration
  419                    | multiplied_duration '*' UNSIGNED
  420                    | multiplied_duration '*' FRACTION

  421 dots: /* empty */
  422     | dots '.'

  423 tremolo_type: ':'
  424             | ':' UNSIGNED

  425 bass_number: UNSIGNED
  426            | STRING
  427            | full_markup
  428            | embedded_scm_bare

  429 figured_bass_alteration: '-'
  430                        | '+'
  431                        | '!'

  432 bass_figure: "_"
  433            | bass_number
  434            | bass_figure ']'
  435            | bass_figure figured_bass_alteration
  436            | bass_figure figured_bass_modification

  437 figured_bass_modification: "\+"
  438                          | "\!"
  439                          | '/'
  440                          | "\"

  441 br_bass_figure: bass_figure
  442               | '[' bass_figure

  443 figure_list: /* empty */
  444            | figure_list br_bass_figure

  445 figure_spec: FIGURE_OPEN figure_list FIGURE_CLOSE

  446 optional_rest: /* empty */
  447              | "\rest"

  448 simple_element: pitch 
                        exclamations 
                        questions 
                        octave_check 
                        maybe_notemode_duration 
                        optional_rest 
  449               | DRUM_PITCH optional_notemode_duration
  450               | RESTNAME optional_notemode_duration

  451 simple_chord_elements: new_chord
  452                      | figure_spec optional_notemode_duration

  453 lyric_element: full_markup
  454              | STRING
  455              | LYRIC_ELEMENT

  456 lyric_element_music: lyric_element 
                             optional_notemode_duration 
                             post_events 

  457 new_chord: steno_tonic_pitch maybe_notemode_duration
  458          | steno_tonic_pitch 
                   optional_notemode_duration 
                   chord_separator 
                   chord_items 

  459 chord_items: /* empty */
  460            | chord_items chord_item

  461 chord_separator: ":"
  462                | "^"
  463                | "/" steno_tonic_pitch
  464                | "/+" steno_tonic_pitch

  465 chord_item: chord_separator
  466           | step_numbers
  467           | CHORD_MODIFIER

  468 step_numbers: step_number
  469             | step_numbers '.' step_number

  470 step_number: UNSIGNED
  471            | UNSIGNED '+'
  472            | UNSIGNED "-"

  473 tempo_range: unsigned_number
  474            | unsigned_number '-' unsigned_number

  475 number_expression: number_expression '+' number_term
  476                  | number_expression '-' number_term
  477                  | number_term

  478 number_term: number_factor
  479            | number_factor '*' number_factor
  480            | number_factor '/' number_factor

  481 number_factor: '-' number_factor
  482              | bare_number

  483 bare_number_common: bare_number_common_closed
  484                   | REAL NUMBER_IDENTIFIER

  485 bare_number_common_closed: REAL
  486                          | NUMBER_IDENTIFIER

  487 bare_number: bare_number_common
  488            | UNSIGNED
  489            | UNSIGNED NUMBER_IDENTIFIER

  490 bare_number_closed: UNSIGNED
  491                   | bare_number_common_closed

  492 unsigned_number: UNSIGNED
  493                | NUMBER_IDENTIFIER
  494                | embedded_scm

  495 exclamations: /* empty */
  496             | exclamations '!'

  497 questions: /* empty */
  498          | questions '?'

  500 full_markup_list: "\markuplist" 2 markup_list

  502 full_markup: "\markup" 3 markup_top

  503 markup_top: markup_list
  504           | markup_head_1_list simple_markup
  505           | simple_markup

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

  508 markup_list: markup_composed_list
  509            | markup_uncomposed_list

  510 markup_uncomposed_list: markup_braced_list
  511                       | markup_command_list
  512                       | markup_scm MARKUPLIST_IDENTIFIER

  513 markup_composed_list: markup_head_1_list markup_uncomposed_list

  514 markup_braced_list: '{' markup_braced_list_body '}'

  515 markup_braced_list_body: /* empty */
  516                        | markup_braced_list_body markup
  517                        | markup_braced_list_body markup_list

  518 markup_command_list: MARKUP_LIST_FUNCTION markup_command_list_arguments

  519 markup_command_basic_arguments: "markup-list?" 
                                        markup_command_list_arguments 
                                        markup_list 
  520                               | "scheme?" 
                                        markup_command_list_arguments 
                                        embedded_scm_closed 
  521                               | EXPECT_NO_MORE_ARGS

  522 markup_command_list_arguments: markup_command_basic_arguments
  523                              | "markup?" 
                                       markup_command_list_arguments 
                                       markup 

  524 markup_head_1_item: MARKUP_FUNCTION 
                            "markup?" 
                            markup_command_list_arguments 

  525 markup_head_1_list: markup_head_1_item
  526                   | markup_head_1_list markup_head_1_item

  527 simple_markup: STRING

  529 simple_markup: "\score" 5 '{' score_body '}'
  530              | MARKUP_FUNCTION markup_command_basic_arguments
  531              | markup_scm MARKUP_IDENTIFIER

  532 markup: markup_head_1_list simple_markup
  533       | simple_markup


Terminals, with rules where they appear



    204 205 206 208 209 210 211 212 213 214 215 216 217 218 219 220
    204 205 206 208 209 210 211 212 213 214 215 216 217 218 219 220
    221 222 223 224 231 233 235 236 237 238 244 245 246 247 248 249
    221 222 223 224 231 233 252 262 265
    241 242 243 258 259 260
    250 252 254 255 256 257 262 265 520
    472 488 489 490 492
    474 476 481
    527
"#{" (339) 3
"(backed-up?)" (334) 135 263 306 309 310 507
"(reparsed?)" (335) 197 198 199 200 201 225 226 227 228 229 239 240
"-" (319) 472
"--" (266) 369
"/" (320) 463
"/+" (316) 464
":" (318) 461
"<" (321) 352
"<<" (323) 148
">" (322) 352 406
">>" (324) 148
"\!" (326) 438
"\" (325) 440
"\+" (327) 437
"\accepts" (274) 313
"\addlyrics" (263) 293 295
"\alias" (275) 316
"\alternative" (261) 143 144
"\book" (276) 75
"\bookpart" (277) 89
"\change" (278) 299
"\chordmode" (279) 286
"\chords" (280) 290
"\consists" (281) 311
"\context" (282) 65 279
"\default" (283) 231 252 262
"\defaultchild" (284) 314
"\denies" (285) 315
"\description" (286) 318
"\drummode" (287) 284
"\drums" (288) 288
"\figuremode" (289) 285
"\figures" (290) 289
"\header" (291) 48
"\layout" (293) 113
"\lyricmode" (294) 287
"\lyrics" (295) 291
"\lyricsto" (296) 298
"\markup" (297) 502
"\markuplist" (298) 500
"\midi" (299) 112
"\name" (300) 319
"\new" (315) 280
"\notemode" (301) 283
"\override" (302) 304 327
"\paper" (303) 111
"\remove" (304) 312
"\repeat" (260) 141 143 209
"\rest" (305) 447
"\revert" (306) 305 328
"\score" (307) 102 529
"\sequential" (308) 145
"\set" (309) 329
"\simultaneous" (310) 147
"\tempo" (311) 124 125 126
"\type" (312) 317
"\unset" (313) 303 330
"\version-error" (292) 8 44
"\with" (314) 153 154 156
"^" (317) 462
"_" (330) 432
"__" (265) 370
"end of input" (0) 0
"markup-list?" (336) 519
"markup?" (332) 523 524
"optional?" (337) 175 176 177 178 181 182 183 184 185 195 196 202 203
"scheme?" (333) 175 176 177 178 181 182 183 184 185 195 196 202 203
'!' (33) 405 431 496
''' (39) 389 390
'*' (42) 419 420 479
'+' (43) 403 430 471 475
',' (44) 391 392
'-' (45) 176 177 178 216 217 218 238 249 250 256 342 376 404 411 429
'.' (46) 187 189 309 407 422 469
'/' (47) 439 480
':' (58) 423 424
'=' (61) 50 51 124 125 274 299 302 304 327 329 385
'?' (63) 498
'[' (91) 442
']' (93) 434
'^' (94) 373 402 410
'_' (95) 374 408 409
'{' (123) 48 65 75 89 102 117 118 130 153 514 529
'}' (125) 48 65 75 89 102 110 130 153 514 529
BOOK_IDENTIFIER (340) 77 91
CHORD_BODY_IDENTIFIER (341) 353
CHORD_MODIFIER (342) 467
CHORD_REPETITION (343) 347
COMPOSITE (262)
CONTEXT_DEF_IDENTIFIER (344) 71
CONTEXT_MOD_IDENTIFIER (345) 154 155 163
DRUM_PITCH (346) 357 449
DURATION_IDENTIFIER (264) 206 222 248 417
E_UNSIGNED (269) 377
error (256) 7 43 88 101 108 123 129
EVENT_FUNCTION (267) 362
EVENT_IDENTIFIER (268) 379
EXPECT_NO_MORE_ARGS (338) 234 253 521
FIGURE_CLOSE (328) 445
FIGURE_OPEN (329) 445
FRACTION (349) 26 60 420
LYRIC_ELEMENT (350) 455
MARKUP_FUNCTION (351) 524 530
MARKUP_IDENTIFIER (353) 531
MARKUP_LIST_FUNCTION (352) 518
MARKUPLIST_IDENTIFIER (354) 512
MULTI_MEASURE_REST (331) 348
MUSIC_FUNCTION (355) 272 361
MUSIC_IDENTIFIER (356) 158 171 360
NOTENAME_PITCH (357) 220 393
NUMBER_IDENTIFIER (272) 178 215 218 238 256 484 486 489 493
OUTPUT_DEF_IDENTIFIER (358) 118
PITCH_ARG (348) 397
PITCH_IDENTIFIER (347) 219 396
PREC_BOT (258)
PREC_TOP (273)
REAL (270) 177 214 217 250 484 485
REPEAT_IDENTIFIER (259) 142 144
RESTNAME (359) 450
SCM_ARG (360) 24 199 239 258 309 310
SCM_FUNCTION (361) 39 271
SCM_IDENTIFIER (362) 21 22 183 202 223 244 340
SCM_TOKEN (363) 17 20 25 84 97
STRING (364) 49 184 191 203 224 245 321 333 335 337 343 399 426 454
SYMBOL_LIST (365) 186 187
TONICNAME_PITCH (366) 221 394
UNARY_MINUS (367)
UNSIGNED (271) 176 205 213 216 247 249 401 416 419 424 425 470 471

Nonterminals, with rules where they appear


assignment (146)
    on left: 50 51, on right: 6 46 119
assignment_id (145)
    on left: 49, on right: 50 51
bare_number (299)
    on left: 487 488 489, on right: 341 342 482
bare_number_closed (300)
    on left: 490 491, on right: 182
bass_number (275)
    on left: 425 426 427 428, on right: 433
book_block (153)
    on left: 75, on right: 11 31 53
bookpart_block (156)
    on left: 89, on right: 12 32 54 79
br_bass_figure (279)
    on left: 441 442, on right: 444
braced_music_list (171)
    on left: 130, on right: 143 144 145 146 147
chord_body (242)
    on left: 352 353, on right: 210 351
chord_body_element (244)
    on left: 356 357 358, on right: 355
chord_body_elements (243)
    on left: 354 355, on right: 352 355
chord_item (290)
    on left: 465 466 467, on right: 460
chord_items (288)
    on left: 459 460, on right: 458 460
chord_separator (289)
    on left: 461 462 463 464, on right: 458 465
closed_music (187)
    on left: 167 168 169, on right: 168 270
command_element (248)
    on left: 363, on right: 349
command_event (249)
    on left: 364, on right: 363
complex_music (212)
    on left: 275 276 277 278, on right: 165
complex_music_prefix (213)
    on left: 279 280, on right: 168 278
context_change (222)
    on left: 299, on right: 151
context_def_spec_block (148)
    on left: 65, on right: 30 56 116
context_mod (229)
    on left: 320 321 322, on right: 72 162
context_mod_arg (149)
    on left: 66 68, on right: 69
context_mod_embedded (151)
    on left: 69, on right: 74 164
context_modification_arg (183)
    on left: 157 158, on right: 156
context_prop_spec (232)
    on left: 326, on right: 329 330
direction_less_event (254)
    on left: 378 379 380 381, on right: 367 372
direction_reqd_event (255)
    on left: 382 383, on right: 371
dots (273)
    on left: 421 422, on right: 416 417 422
duration_length (268)
    on left: 412, on right: 197 228 242
embedded_lilypond (142)
    on left: 40 41 42 43 44, on right: 3 44
embedded_scm (139)
    on left: 34 35, on right: 47 62 66 120 136 322 494
embedded_scm_active (137)
    on left: 22 23, on right: 18 85 98 104
embedded_scm_arg (140)
    on left: 36 37 38, on right: 195 235 339
embedded_scm_arg_closed (208)
    on left: 268 269 270, on right: 181 208 254
embedded_scm_closed (207)
    on left: 266 267, on right: 157 400 520
event_chord (240)
    on left: 345 346 347 348 349 350, on right: 149
event_function_event (247)
    on left: 362, on right: 381
exclamations (302)
    on left: 495 496, on right: 356 448 496
figure_list (280)
    on left: 443 444, on right: 444 445
figure_spec (281)
    on left: 445, on right: 452
figured_bass_alteration (276)
    on left: 429 430 431, on right: 435
figured_bass_modification (278)
    on left: 437 438 439 440, on right: 436
fingering (265)
    on left: 401, on right: 373 374 376
full_markup_list (304)
    on left: 500, on right: 16 27 63 83 96
function_arglist (199)
    on left: 230 231, on right: 39 272
function_arglist_closed (203)
    on left: 251 252, on right: 271 361 362
gen_text_def (264)
    on left: 398 399 400, on right: 382
grob_prop_path (231)
    on left: 324 325, on right: 327
grob_prop_spec (230)
    on left: 323, on right: 324 325
grouped_music_list (189)
    on left: 173 174, on right: 172 281 282
lilypond (133)
    on left: 4 5 6 7 8, on right: 1 5 6 7 8
lilypond_header (144)
    on left: 48, on right: 10 87 100 106
lilypond_header_body (143)
    on left: 45 46 47, on right: 46 47 48
lyric_element (285)
    on left: 453 454 455, on right: 456
lyric_element_music (286)
    on left: 456, on right: 132 135 200 240
markup (323)
    on left: 532 533, on right: 516 523
markup_braced_list (314)
    on left: 514, on right: 510
markup_braced_list_body (315)
    on left: 515 516 517, on right: 514 516 517
markup_command_list (316)
    on left: 518, on right: 511
markup_composed_list (313)
    on left: 513, on right: 508
markup_head_1_item (319)
    on left: 524, on right: 525 526
markup_head_1_list (320)
    on left: 525 526, on right: 504 513 526 532
markup_list (311)
    on left: 508 509, on right: 500 503 517 519
markup_scm (309)
    on left: 507, on right: 512 531
markup_top (308)
    on left: 503 504 505, on right: 502
markup_uncomposed_list (312)
    on left: 510 511 512, on right: 509 513
maybe_notemode_duration (269)
    on left: 413 414, on right: 415 448 457
mode_changed_music (214)
    on left: 281 282, on right: 170
mode_changing_head (215)
    on left: 283 284 285 286 287, on right: 281
multiplied_duration (272)
    on left: 418 419 420, on right: 412 414 419 420
music (172)
    on left: 131 132, on right: 103 133 141 142 143 144 278 298
music_arg (175)
    on left: 137 138, on right: 115 131
music_assign (176)
    on left: 139 140, on right: 38 57 225
music_bare (188)
    on left: 170 171 172, on right: 166 167
music_embedded (173)
    on left: 133 134 135, on right: 42 128
music_embedded_backup (174)
    on left: 136, on right: 134 135
music_function_call (210)
    on left: 272, on right: 275 359
music_function_call_closed (246)
    on left: 361, on right: 169 368
music_function_chord_body (245)
    on left: 359 360, on right: 358
music_list (170)
    on left: 127 128 129, on right: 42 128 129 130 148
music_or_context_def (166)
    on left: 115 116, on right: 122
music_property_def (235)
    on left: 332, on right: 150
new_chord (287)
    on left: 457 458, on right: 451
new_lyrics (217)
    on left: 293 295, on right: 295 296
note_chord_element (241)
    on left: 351, on right: 350
number_expression (294)
    on left: 475 476 477, on right: 59 475 476
number_factor (296)
    on left: 481 482, on right: 478 479 480 481
number_term (295)
    on left: 478 479 480, on right: 475 476 477
octave_check (256)
    on left: 384 385, on right: 356 448
optional_context_mod (184)
    on left: 159 160, on right: 279 280 282
optional_id (211)
    on left: 273 274, on right: 279 280
optional_rest (282)
    on left: 446 447, on right: 448
output_def (163)
    on left: 110, on right: 19 33 55 107 109
output_def_head (164)
    on left: 111 112 113, on right: 114
output_def_head_with_mode_switch (165)
    on left: 114, on right: 117 118
paper_block (162)
    on left: 109, on right: 78 92
pitch (262)
    on left: 395 396, on right: 356 448
pitch_arg (263)
    on left: 397, on right: 226
post_event (252)
    on left: 375 376, on right: 366
property_operation (224)
    on left: 302 303 304 305, on right: 320
property_path (223)
    on left: 300 301, on right: 51 301 304 325
questions (303)
    on left: 497 498, on right: 356 448 498
quotes (257)
    on left: 386 387 388, on right: 385 393 394 396 397
re_rhythmed_music (220)
    on left: 296 298, on right: 277
repeated_music (177)
    on left: 141 142 143 144, on right: 276
revert_arg (225)
    on left: 306, on right: 305 328
revert_arg_backup (226)
    on left: 307, on right: 306 309 310
revert_arg_part (227)
    on left: 308 309 310, on right: 307
scm_function_call (141)
    on left: 39, on right: 23 35 37
scm_function_call_closed (209)
    on left: 271, on right: 267 269
score_block (159)
    on left: 102, on right: 13 29 52 80 93
script_dir (267)
    on left: 409 410 411, on right: 368 371 372
sequential_music (178)
    on left: 145 146, on right: 174
simple_chord_elements (284)
    on left: 451 452, on right: 346
simple_element (283)
    on left: 448 449 450, on right: 345
simple_markup (321)
    on left: 527 529 530 531, on right: 504 505 532 533
simple_music (180)
    on left: 149 150 151, on right: 137 139
simple_music_property_def (233)
    on left: 327 328 329 330, on right: 332
simple_revert_context (234)
    on left: 331, on right: 328
simple_string (237)
    on left: 335 336, on right: 141 143 209 274 298 299
simultaneous_music (179)
    on left: 147 148, on right: 173
start_symbol (131)
    on left: 1 3, on right: 0
steno_duration (271)
    on left: 416 417, on right: 124 125 418
steno_pitch (260)
    on left: 393, on right: 395
steno_tonic_pitch (261)
    on left: 394, on right: 457 458 463 464
step_number (292)
    on left: 470 471 472, on right: 468 469
step_numbers (291)
    on left: 468 469, on right: 466 469
string (236)
    on left: 333 334, on right: 61
string_number_event (253)
    on left: 377, on right: 378
sub_quotes (259)
    on left: 391 392, on right: 387 392
sup_quotes (258)
    on left: 389 390, on right: 388 390
symbol (238)
    on left: 337 338, on right: 279 280 299 302 303
symbol_list_arg (192)
    on left: 186 187, on right: 201 229 243 260 306
symbol_list_element (195)
    on left: 191 192, on right: 190
symbol_list_part (194)
    on left: 190, on right: 188 189 308 309 310 331
symbol_list_rev (193)
    on left: 188 189, on right: 187 189 300 301 323 326
tempo_event (169)
    on left: 124 125 126, on right: 364
tempo_range (293)
    on left: 473 474, on right: 124 125
tremolo_type (274)
    on left: 423 424, on right: 380
unsigned_number (301)
    on left: 492 493 494, on right: 141 143 209 473 474

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