help-bison
[Top][All Lists]
Advanced

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

Re: Change yylex name


From: Leviathan
Subject: Re: Change yylex name
Date: Wed, 2 May 2007 06:23:05 -0700 (PDT)


Hans Aberg wrote:
> 
> 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
> 
> 

First of all thanx a lot for your time.I am a bit confused about what you're
suggesting . I have used gnu-flex to generate  a lexer. The point is that i
have created a wrapper function which calls int yylex()  whose name is for
instance my_yylex and has a different signature lets say int my_yylex( char
* pointer , int * pointer2 , float * pointer2 ) ; 
This function apart from calling yylex() has some additional functionality .
My question actually is : Is there any way that i can get bison to call this
function instead of calling yylex() ?I hope i made some sense .Thanx again  


_______________________________________________
address@hidden http://lists.gnu.org/mailman/listinfo/help-bison


-- 
View this message in context: 
http://www.nabble.com/Change-yylex-name-tf3675999.html#a10285968
Sent from the Gnu - Bison - Help mailing list archive at Nabble.com.





reply via email to

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