title: PHP: How to parse Lilypond file?
body: <p>I need to extract the Score part from a Lilypond file (<a href="https://github.com/strch/public-domain-season-songs/blob/master/alle_jahre_wieder.ly" rel="nofollow noreferrer">example .ly file here)</a> with separated voices.</p>
  
  <p>My idea is to read the <a href="http://lilypond.org/doc/v2.19/Documentation/contributor/lilypond-grammar" rel="nofollow noreferrer">Lilypond grammar </a>from  a file and create a PHP parser using the <a href="https://www.php.net/manual/de/parle.examples.parser.php" rel="nofollow noreferrer">PHP builtin features for parsers.</a></p>
  
  <p>My question is how to read the Lilypond grammar? </p>
  
  <p>I did not find a standard EBNF grammar source for Lilypond. And the <a href="https://github.com/lilypond/lilypond/blob/483292eb80da0869d22cd773eb480c662a499e89/lily/parser.yy" rel="nofollow noreferrer">Lilypond parser written in BIson on Github</a> does not help much.</p>