Re: Pragma Proposal ready for review

> On 14 Dec 2021, at 09:06, Dave Pawson <dave.pawson@gmail.com> wrote:
> 
> "We can do this in ixml by expanding the grammar, splitting each
> nonterminal into two rules, one producing a visible serialization and
> one hiding the nonterminal on serialization." Is this desirable |
> needed? Perhaps nice if it can be automated + hidden from the user.

From my practical experience this is desirable when you’re working with very deep production trees, in complex grammars for programming languages. For example in XPath, off the top of my head, without such ‘tree reduction’ a simple integer results in a tree some 20+ levels deep, every element of which has just a single child. Dealing with such a tree is of course possible, but wasteful, and at risk of a terrible pun, you ‘can’t see the wood for the trees’.

It just seemed to be an interesting use case for something that was ‘pragma-like’.

John Lumley 

Received on Tuesday, 14 December 2021 12:13:25 UTC