help-flex
[Top][All Lists]
Advanced

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

Reentrant flex & bison


From: Krishna Murthy Gudipati
Subject: Reentrant flex & bison
Date: Tue, 30 Nov 2004 19:51:33 +0530

Dear Friends,

Greetings !!

I have seen your discussion on the reentrant flex and bison. For the last
few days i am strugling to make the lexer and parser reentrant. I am using
flex 2.5.4 & bison 1.35 and after reading your discussions i have downloaded
flex 2.4.31 and added %option reentrant in the scanner and %pure_parser in
the parser. On compilation this has resulted in yylex(yyscan_t yyscanner)
and gave compilation error saying undefined reference to yylval. Then i have
added %option bison-bridge. It has compiled everything but gave error 'yyin
undefined reference' in my .c file where i am copying the input file name to
yyin.

In the new lexer the definition of yyin has changed (earlier FILE *yyin) to
#define yyin yyg->yyin_r.

Please suggest me how can i copy the input file name into yyin i.e
yyg->yyin_r. Since yyg is a local structure variable in the scanner.

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.

Please help me. Also i will be grateful to you if you suggest me what are
all the changes need to be done to .c files/scanner/parser if '%option
reentrant', '%option bison-bridge' and '%pure_parser' is added to scanner
and parser respectively.

Thanks in advance !!

Regards,
Krishna






reply via email to

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