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).
