help-flex
[Top][All Lists]
Advanced

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

RE: Reentrant flex & bison


From: Krishna Murthy Gudipati
Subject: RE: Reentrant flex & bison
Date: Thu, 02 Dec 2004 17:45:44 +0530

Hi Paul,

It seems my flex part is OK but i think i am not able to tell the yyparse
how to call lex. Can you please suggest on (YYPARSE_PARAM, YYLEX_PARAM
etc.).

Regards,
Krishna

Regards,
Krishna

-----Original Message-----
From: Krishna Murthy Gudipati [mailto:address@hidden
Sent: Thursday, December 02, 2004 5:36 PM
To: address@hidden
Cc: address@hidden
Subject: RE: Reentrant flex & bison


Hi Bruce,

I have upgraded my bison 1.875 and compiled my lexer and parser with %option
reentrant %option bison-bridge %pure_parser. And i made appropriate changes
in my .c code to pass the input file name using yyset_in().

My Code
-------
yyscan_t yyscanner;
extern int yyparse(yyscan_t yyscanner);
extern yylex_init(yyscan_t *yyscanner );
extern void yyset_in(FILE * in_str ,yyscan_t yyscanner );
FILE *inf;

.
.

some_function(){
.
.
yylex_init(&yyscanner);
yyset_in(inf, yyscanner);
yyparse(yyscanner);

.
.
}

The code is compiled but at run time it is giving the "fatal flex scanner
internal error--end of buffer missed". Thru the GDB i am not able to enter
into the function yyparse(yyscanner);

Please suggest.

Regards,
Krishna

-----Original Message-----
From: Bruce Lilly [mailto:address@hidden
Sent: Wednesday, December 01, 2004 4:13 AM
To: address@hidden
Cc: Krishna Murthy Gudipati
Subject: Re: Reentrant flex & bison


On Tue November 30 2004 09:21, Krishna Murthy Gudipati wrote:

> Earlier in my .c file i have declared yyin as 'extern FILE* yyin'. But now
> the yyin is '#define yyin yyg->yyin_r' i am not able to pass the input
file
> name to lexer.

You need to use the function yyset_in.  See the section in the
flex documentation regarding reentrant operation for details.






reply via email to

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