help-bison
[Top][All Lists]
Advanced

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

Re: Change yylex name


From: Hans Aberg
Subject: Re: Change yylex name
Date: Wed, 2 May 2007 12:59:50 +0200

On 1 May 2007, at 18:40, Leviathan wrote:

My intention is to change yylex name to e.g my_yylex . I have read in
bison's gnu manual that such thing is possible via the %name- prefix="my_yy" directive but it will also change prefix for yyparse , yyerror etc. I just want to change yylex's name and keep the default names for the rest .Is
there a way to do that?

I doubt it, because the idea is to create a name space, avoiding name conflicts in case one uses more than one parser. Instead, define a new function calling it, or if that is not possible, use the C/C++ preprocessor, something like:
#define yylex my_yy
... /* Changes yylex -> my_yy here */
#undef yylex

  Hans Aberg






reply via email to

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