[Top][All Lists]

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

Re: redundant merges for GLR

From: Joel E. Denny
Subject: Re: redundant merges for GLR
Date: Sun, 21 Aug 2005 03:05:51 -0400 (EDT)

On Wed, 10 Aug 2005, Joel E. Denny wrote:

> On Fri, 29 Jul 2005, Joel E. Denny wrote:
> > On Tue, 19 Jul 2005, Joel E. Denny wrote:
> >
> > > I am attempting to use bison's %glr-parser and %merge to construct parse
> > > forests.  I'm getting duplicate representations of some trees within the
> > > forest.  Both bison 1.875 and 2.0 give the same results.
> I haven't seen any response to my posts last month on problems I'm having
> with bison GLR:
> Were my explanations unclear?  Am I correct that this is unintended
> behavior?  Should I post these to bug-bison instead?
> I need these problems resolved for my work, so I may start exploring
> bison's source myself.  However, I don't want to waste my time moving in

I finally got around to this yesterday.  I spent some time exploring
"data/glr.c" from bison-2.0b, and I'm now fairly certain the redundant
parse tree problem is due to a bug in bison.  I haven't explored the other
issues yet.

resolveValue() invokes mergeOptionSets() but doesn't remove the merged
SemanticOption's.  Thus, within `if (yymerge)', resolveAction() and
userMerge() are invoked for each of several identical SemanticOption's.
This produces the redundant trees.

Attached is a patch to "data/glr.c" from bison-2.0b.  It seems to solve
the problem for my test cases.  I have not wrapped my head around your
code completely, so I'm not fully confident that there are no adverse
side-effects.  However, after applying this patch, I found that make check
produced no test failures.  I plan to test much more extensively and will
follow up if I discover problems.

If you would like to add a new test case to ensure this bug does not crop
up again, I posted one earlier on this thread at help-bison.

Joel Denny

Attachment: glr.c.patch
Description: Text document

reply via email to

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