On 2022-06-17 10:58, slipbits wrote: > Given that Bison has the ability to (and does) generate a parser for > itself, is there any possibility of removing all %code tags in future > releases.
This is not clear; remove what from where? For what purpose? How does Bison being partially self-hosted play into the removal? > This means that one code block, %code { declarations }, is all that is > required and removes the placement requirements and discussion in > the Bison User's Manual. By tag, do you want to remove the %code <qualifier> feature? >From where? The Bison grammar file parse-gram.y uses multiple %oode <qualifier> construcs. Are you looking to edit that file so that it has only one unqualified %code block? Why shouldn't it it have multiple, qualified blocks? This is a documented feature of Bison; the Bison grammar is just "eating the dogfood", which is good. Bison ships the generated parser as parse-gram.c, which means that it builds without needing an installation of Bison, and the grammar file can use the latest features provided in that same version of Bison. Removing the multiple qualified %oode blocks from Bison's own grammer would just mean that the feature is exercised less. The documentation makes it clear that the %code feature makes placement less important compared to the traditional %{ ... %} Bison gathers code from multiple %code blocks, then catenates them together (by qualifier) type. For any qualifier, the order is preserved. The code is then generated into the appropriate location based on the output type.