Re: design question? or puzzle?

It's verbose, but couldn't you do something like:

expression: ursum.
    -ursum: urproduct; sum.
       sum: product+addop.
-urproduct: urfactor; product.
etc

This is (correctly) ambiguous, but the first parse according to  the order of rule would return `<expression><number>3</number></expression>` - which I think is what you would want?

Tom

_________________
Tomos Hillman
eXpertML Ltd
+44 7793 242058
On 12 Apr 2021, 01:25 +0100, C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com>, wrote:
>
> Is there a way to write the ixml grammar so as to achieve the goal of serializing a nonterminal as an element if and only if it has two element children, and not to serialize it when it has only one element child?

Received on Tuesday, 13 April 2021 11:00:32 UTC