[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: yacc.c does not prototype yyparse in the header
From: |
Paul Eggert |
Subject: |
Re: yacc.c does not prototype yyparse in the header |
Date: |
Tue, 12 Jun 2012 09:41:09 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 |
On 06/12/2012 06:54 AM, Akim Demaille wrote:
> First, there are no CPP guards used in our generated headers
> (for yacc.c). I would very much like them to have some, especially
> because in some cases it might help us simplify some of the "inner"
> guards we have (to avoid multiple definitions of the same
> typedefs for instance).
Sure, that makes sense.
> Second, I never really paid attention to this before,
> but how on earth can it be really useful to rename the
> global variables (--name-prefix) such as yylval, global
> functions, such as yyparse, but not the global types, such as
> YYSTYPE?
This "works" because different modules can include different
parser.h files. So long as no single module includes both
parser.h files, there is no clash at compile-time; and there
is no clash at link-time because types are invisible to the
linker. But it clearly would be better to do as you suggest
and to apply the prefix to the types as well -- that
would support programs where a single module wants to include
two parser.h files (something that does not work now).
- bison-2.5.1 released [stable], Akim Demaille, 2012/06/05
- Re: bison-2.5.1 released [stable], Richard Stallman, 2012/06/05
- Message not available
- Message not available
- Message not available
- yacc.c does not prototype yyparse in the header, Akim Demaille, 2012/06/11
- Re: yacc.c does not prototype yyparse in the header, Paul Eggert, 2012/06/11
- Re: yacc.c does not prototype yyparse in the header, Akim Demaille, 2012/06/12
- Re: yacc.c does not prototype yyparse in the header,
Paul Eggert <=
- Re: yacc.c does not prototype yyparse in the header, Akim Demaille, 2012/06/13
- Re: yacc.c does not prototype yyparse in the header, Paul Eggert, 2012/06/13
- Re: yacc.c does not prototype yyparse in the header, Akim Demaille, 2012/06/28
- Re: yacc.c does not prototype yyparse in the header, Akim Demaille, 2012/06/29
- FYI: glr.c: minor refactoring (was: yacc.c does not prototype yyparse in the header), Akim Demaille, 2012/06/12
- FYI: skeletons: factor yacc.c and glr.c (was: yacc.c does not prototype yyparse in the header), Akim Demaille, 2012/06/12
- RFC: yacc.c: factor (was: yacc.c does not prototype yyparse in the header), Akim Demaille, 2012/06/12
- Re: RFC: yacc.c: factor (was: yacc.c does not prototype yyparse in the header), Akim Demaille, 2012/06/12
- Re: RFC: yacc.c: factor (was: yacc.c does not prototype yyparse in the header), Akim Demaille, 2012/06/13
- Re: yacc.c: instead of duplicating y.tab.h inside y.tac.c, include it (was: RFC: yacc.c: factor), Akim Demaille, 2012/06/15