[Top][All Lists]

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

Re: glr: include the created header

From: Paul Eggert
Subject: Re: glr: include the created header
Date: Wed, 28 Jun 2006 11:07:43 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

"Joel E. Denny" <address@hidden> writes:

> Why was the ability to concatenate several %union's together added?

I'm the guilty party on that.  As I recall, the problem was that Bison
formerly had undefined behavior if you had multiple %unions (it
generated garbage code), and I wanted it to do something more
reasonable.  I didn't put a lot of thought into it, and I don't think
anybody's really relying on it.  We shouldn't let this tail wag any

Now that I think of it, "%union foo { ... } %union bar { ... }"
probably generates garbage code even now.  I guess we should simply
disallow multiple %union, as C does.

Stepping back from this a bit, I'm totally confused now by all the
directives being proposed.

Here's one idea to simplify things a bit.  How about if we say that
"%union { ... }" is treated like:

     typedef union { ... } YYSTYPE;

That way, whatever solution we use for %{ also works for %union, and
%union is no longer a special case.

reply via email to

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