help-flex
[Top][All Lists]
Advanced

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

how to get YY_CURRENT_BUFFER when using %option reentrant


From: henrik . sorensen
Subject: how to get YY_CURRENT_BUFFER when using %option reentrant
Date: Thu, 29 Jun 2006 21:53:39 +0000
User-agent: KMail/1.9.1

Hi List,

I am in the process of switching my flex scanner to a reentrant scanner.

In a sub function, that used the macro YY_CURRENT_BUFFER, how can I do this 
when using a reentrant scanner ?

The compiler complains over
../../gcc-src/gcc-4.2-20060415/gcc/pl1/pl1-scanner.l: In 
function 'stackCurrentBuffer':
../../gcc-src/gcc-4.2-20060415/gcc/pl1/pl1-scanner.l:1208: error: 'yyg' 
undeclared (first use in this function)
../../gcc-src/gcc-4.2-20060415/gcc/pl1/pl1-scanner.l:1208: error: (Each 
undeclared identifier is reported only once
../../gcc-src/gcc-4.2-20060415/gcc/pl1/pl1-scanner.l:1208: error: for each 
function it appears in.)

I could of course cheat and define yyg myself as
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

but is there not another way to get the YY_CURRENT_BUFFER ?

The version before the conversion to reentrant can be found in the source 
forge cvs:
http://pl1gcc.cvs.sourceforge.net/pl1gcc/gcc/gcc/pl1/pl1-scanner.l?revision=1.41&view=markup

thanks for your help

Henrik




reply via email to

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