bison-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] Use variants to support objects as semantic values.


From: Paolo Bonzini
Subject: Re: [PATCH] Use variants to support objects as semantic values.
Date: Tue, 04 Nov 2008 22:30:28 +0100
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

>> 3) no %union, no %define stype, b4_tag_seen_flag=1,
>> %define global_tokens_and_yystype => do not define YYSTYPE at global
> 
> I guess this is not what you meant here.

If you want an externally-defined YYSTYPE, you would have to do
something like

  #define YYSTYPE my_semantic_type

So in that case the %define would not define YYSTYPE anyway.  I agree
that these rules would be a damn mess to document and teach. :-(

But it's actually a big loop.  In your proposal...

> Or maybe use impossible values ?
> 
> %define semantic.type "%union" or "%variant" or "USER-TYPE".

It's just %variant, after all %union still needs to be a separate
directive if only for scanning purposes.  And then it goes back to

  %define semantic.type.variant

(or whatever we agree about, I would prefer types.semantic.variant or
stype.variant), checking for conflicts in the skeleton, which is more or
less what you are doing now except for the possibility to define a user
semantic type.

Go ahead with the patches, we'll sort it out at the end.

Paolo




reply via email to

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