[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: proposal: simplify prologue alternatives into %code
From: |
Paolo Bonzini |
Subject: |
Re: proposal: simplify prologue alternatives into %code |
Date: |
Tue, 09 Jan 2007 14:36:44 +0100 |
User-agent: |
Thunderbird 1.5.0.9 (Macintosh/20061207) |
Then a special directive %typed triggering the Bison type system may not
be required, as this if %cast appears, one knows the .y file is typed.
Another way would that %cast can appear, but is not used, unless a
%typed also appears.
%typed is unnecessary if a <foo> tag is used in the grammar. While now
<foo> is always a member name, it will be a type name in Java and it
would be a type name also in C++ if one wants to expand
%type<some_class> xyz
to {static,dynamic}_cast<type>(*var).
In fact, something aking to your %typed is already exported to the
skeletons as b4_tag_seen_flag, where we have
m4_if(b4_tag_seen_flag, 0,
[[typedef int YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1]]
I'm also against a new directive such as your %cast, since Bison already
has too many and -- in this particular case -- a simple %define is all
that is needed.
The implementation of %typed would be the same as %union
It would be interesting if you took a look at the implementation of
%union (which is just a "code muscle", equivalent to something like
"%code stype") before making this imperscrutable statement. :-)
Paolo
- Re: [SPAM] Re: proposal: simplify prologue alternatives into %code, (continued)
- Re: [SPAM] Re: proposal: simplify prologue alternatives into %code, Paul Eggert, 2007/01/07
- Re: [SPAM] Re: proposal: simplify prologue alternatives into %code, Joel E. Denny, 2007/01/07
- Re: [SPAM] Re: proposal: simplify prologue alternatives into %code, Joel E. Denny, 2007/01/08
- Re: [SPAM] Re: proposal: simplify prologue alternatives into %code, Joel E. Denny, 2007/01/08
- Re: [SPAM] Re: proposal: simplify prologue alternatives into %code, Paul Eggert, 2007/01/08
- Re: [SPAM] Re: proposal: simplify prologue alternatives into %code, Joel E. Denny, 2007/01/08
- Re: [SPAM] Re: proposal: simplify prologue alternatives into %code, Joel E. Denny, 2007/01/08
Re: proposal: simplify prologue alternatives into %code, Hans Aberg, 2007/01/09
Re: proposal: simplify prologue alternatives into %code, Hans Aberg, 2007/01/09
Re: proposal: simplify prologue alternatives into %code, Paolo Bonzini, 2007/01/09
Re: proposal: simplify prologue alternatives into %code, Hans Aberg, 2007/01/09
Re: proposal: simplify prologue alternatives into %code, Paolo Bonzini, 2007/01/09
Re: proposal: simplify prologue alternatives into %code, Hans Aberg, 2007/01/09