help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: x + (y) + z


From: Frank Heckenbach
Subject: Re: x + (y) + z
Date: Mon, 7 Mar 2005 17:31:23 +0100
User-agent: semail 20050101

Derek M Jones wrote:

> The problem comes with '(x) + (y) + z' (which I gave as
> a example on comment in this thread, rather than starting a
> new thread; as if people were not confused enough).
> There are four possible parses of this expression: two
> of which are causing my current problem.  The two
> possible parse trees of interest are
>
> >If your grammar is different and it doesn't work for you, it might
> >help to post the relevant parts of your actual grammar.
> 
> Your grammar contained a single %merge.  I thought at
> least two are required?

All the involved (top-level) rules must have a `%merge'. In the
original example, both happened to be the same rule.

The second example works and shows all four trees (after fixing a
few precedences in the grammar) with another `%merge' -- in the
final grammar you might need some more.

Frank

-- 
Frank Heckenbach, address@hidden
http://fjf.gnu.de/
GnuPG and PGP keys: http://fjf.gnu.de/plan (7977168E)

Attachment: ambiguity.y
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]