Related articles |
---|
Reentrant Flex Bison - fatal flex scanner internal error--end of buffe krishna.gudipati@xilinx.com (2004-12-01) |
From: | krishna.gudipati@xilinx.com (Krishna) |
Newsgroups: | comp.compilers |
Date: | 1 Dec 2004 23:16:19 -0500 |
Organization: | http://groups.google.com |
Keywords: | lex, yacc, question |
Posted-Date: | 01 Dec 2004 23:16:19 EST |
Dear Friends,
Greetings !!
I am using flex 2.5.4 & bison 1.35. I am geting the run time error
"fatal flex scanner internal error--end of buffer missed" when i made
the lexer and parser as a part of shared lib and run . I am strugling
to make the lexer and parser reentrant and after reading the
discussions on reentrant flex in this group i have downloaded flex
2.5.31 (i cannot go for c++ version of scanner as of now) and added
%option reentrant in the scanner and %pure_parser in the parser.
On compilation this has resulted in yylex(yyscan_t yyscanner) in the
scanner 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
while linking 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
Return to the
comp.compilers page.
Search the
comp.compilers archives again.