[Top][All Lists]

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

Re: proposal: simplify prologue alternatives into %code

From: Hans Aberg
Subject: Re: proposal: simplify prologue alternatives into %code
Date: Tue, 9 Jan 2007 16:25:55 +0100

On 9 Jan 2007, at 16:10, Paolo Bonzini wrote:

Not a big case of interface mismatch.
If you think that, you are of course free to fix it your own way.
You idea is to let the C++ polymorphic class implementation to emulate the implementation of a C 'union', and such ties between unrelated features in different languages does not seem wise to me.

Absolutely not. I would be in favor of allowing to specify a type within %type<> (using static_cast instead of accessing a union).

This, even admitting dynamic_cast as well, may not be enough, in amore general setting. There are also the boost:variant's suggested by Akim. I do not recall their syntax.

What I meant, is that requiring the yystype to implement operator* () is not likely to put a lot of burden on somebody who has to resolve the interface mismatch.

Then one may have to convert the object constructed by the Bison generated parser to the ones used in the rest of the program. I would not want to program that way, but if you do, fine with me, as long as I do not have to do it. :-)

  Hans Aberg

reply via email to

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