Hallo,
The Contributor Guide appendix 'LilyPond grammar' displays a summary
(ly-grammar.txt) which is derived from a summary produced by bison.
In the first section a production rule has a label on the left which
introduces the alternatives listed on the right. Or rather, _most_
rules are like that, but for a few of them the label occurs twice. So
if you are looking for a rule and find it, you may overlook some of
its alternatives.
This is OK by bison (and maybe a practised eye) but not by me.
So I propose a readability enhancement where there is only one label
per rule and submit a revised yyout2grammar.py which caters for this.
While testing it I noticed and corrected several errors:
- the elimination of @-items in the alternatives is inaccurate
- in the second section, continuation lines pile up at the top
- in the third section, more than 30 nonterminals are missing and
@-rules are included
In the script, the production rule part is completely rewritten and the
rest is extensively refactored. See yyout2g_robin_A.py
I worked with bison-2.4.1 (GnuWin32) and obtained parser.yy and
yyout2grammar.py from git a few days ago, i.e post 2.19.80.
The following summaries are generated from that snapshot:
- before: ly-grammar.txt
- after: ly-g_robin_A.txt
Cheers,
Robin
_______________________________________________
bug-lilypond mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-lilypond