Rebonjour M. Denny,
On 06/07/2010 04:40 PM, François PELLEGRINI wrote:
[...]
Of course, this can be a possibility, but
it is not what I want. I do not want to
re-engineer my software and lose compatibility
with respect to other parsers. I would like flex
and bison to benefit from the added value, in
terms of namespace isolation, of the "-p" and
"-P" options of flex and bison. This is why I
point that their implementation is not consistent :
one changes yylval, while the other does not.
The solution to this would be that, when a "-p"
option is present, flex adds a "#define" line to
the beginning of the "lex.yy.c" file it produces,
so that subsequent uses of the "yylval" variable
are properly renamed.
After some thinking, I think it is up to bison
to add the #define in its "y.tab.h". It is strange
it does it in its "y.tab.c" and not in "y.tab.h",
to be included by the lexer.
That would solve the problem.
Regards,
f.p.