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 12:59:07 -0700 (PDT)


Hans Aberg wrote:
> 
> On 2 May 2007, at 15:23, Leviathan wrote:
> 
>> 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
> 
> See the Bison 2.3 manual, sec. 4.2.4, "Calling Conventions for Pure  
> Parsers". When you invoke %pure-parser, the arguments of the parser  
> and lexer functions can be set by %parse-param and %lex-param.
> 
>    Hans Aberg
> 
> 
Hi Hans,
I 've already read this section but still the problem remains. It is ok
about the arguments however it does not provide a way to rename the yylex
function . I did also a little search of my own throughout the web and i got
more confused . From what i've read about the topic it seems that such thing
isn't possible due to preserving the namespace which you mentioned earlier.
So it is time for plan B i.e. move the functionality from the wrapper
function to yylex .Thanx once again Hans

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





reply via email to

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