bug-bison
[Top][All Lists]
Advanced

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

Re: Propagation of prefix change in "yylval" name


From: François PELLEGRINI
Subject: Re: Propagation of prefix change in "yylval" name
Date: Mon, 07 Jun 2010 17:16:26 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100422 Mandriva/3.0.4-0.4mdv2010.0 (2010.0) Thunderbird/3.0.4


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.



reply via email to

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