bug-bison
[Top][All Lists]
Advanced

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

Re: Comments in %union processed incorrectly


From: Akim Demaille
Subject: Re: Comments in %union processed incorrectly
Date: 03 Jan 2002 10:15:44 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

>>>>> "Hans" == Hans Aberg <address@hidden> writes:

>> The problem is that we now use an union to compute the alignments,
>> and only for that.  It just happens that I do have a Location
>> class, which does have ctors.  But now, because of this single
>> union, this is no longer proper C++: classes with ctors cannot be
>> stored in a union.
>> 
>> As a result, my code no longer compiles.

Hans> I have looked a little on the skeleton code, and there are two
Hans> problems with union's and C++:

Hans> First, if one is using the %union option and C++ types, then a
Hans> proper C++ compiler should reject that. Now, Bison does not seem
Hans> to do anything with the types, except putting them in when
Hans> defined. %union seems to only require that all nonterminals are
Hans> typed; for that last part, I introduced a %typed option. Thus
Hans> %union { <body> } should be equivalent to %{ typedef union {
Hans> <body> } yystype; #define YYSTYPE yystype ...  %} %typed ...

Hans, I would *really* appreciate if you could keep the threads
focused on their subject.  I was *not* referring to what you just
wrote, and I made that *perfectly* clear.

We all know the other issue.  It's just not the subject.



reply via email to

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