In 3.3.3 Recursive Rules you say:

"...you should always use left recursion, because it can parse a sequence of any number of elements with bounded stack space. Right recursion uses up space on the Bison stack in proportion to the number of elements in the sequence ..."

In ANTLR (an LL(1) parser) I believe that the issue of putting lists in the wrong order is resolved. I wonder if that is a good thing to consider for Bison.

As just a comment, rather that go into the details of stack size wouldn't it be better to point out that in LR(1) grammars, BNF with LL(1) list definitions cause problems and should not be used. I guess I 'm confused as to the knowledge of the assumed audience for this document and whether they know about LR(1) and LL(1) grammars. You did mentions LALR(1) grammars in 1.1 Languages and Context-Free Grammar and IELR(1) and LR(1), but not SLR(1) (an immediate precursor to LALR(1), so I assume that the target audience has some knowledge about LR(1) and LL(1) lists.

I'm not done with the document, but so far I've seen no reference to EBNF, a.k.a., ambiguous grammars, but I do see their use. I hope this will be mentioned.

These comments are incidental to my reading of the document. If you like I can continue in a more methodical way and if you's like, can contribute alternate wording/text for your review. The current document is much, much better than the one I looked at in 2013 or thereabout. You are doing a great job.

thanks
art


Reply via email to