help-bison
[Top][All Lists]
Advanced

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

bison calling reentrant flex scanner


From: Your Name
Subject: bison calling reentrant flex scanner
Date: Fri, 17 Dec 2004 12:12:08 +1000

Hi, 
 
My flex output file "lex.yy.c" compiles nicely, and so does everything 
else, but my bison output file, "mwbase.tab.c" produces a mysterious 
error: 
 
mwcompilertypes.hpp: In function `int yyparse(void*)': 
mwcompilertypes.hpp:44: error: too few arguments to function `int 
   yylex(YYSTYPE*, YYLTYPE*, void*)' 
mwbase.tab.c:949: error: at this point in file 
 
The line in question, mwcompilertypes.hpp:44, is my pre-definition of 
yylex, and reads as follows: 
 
extern int yylex( YYSTYPE* yylval_param, YYLTYPE* yylloc_param, 
yyscan_t yyscanner ); 
 
This is the exact same definition of the yylex function that flex 
produces - so I believe that it's correct. 
 
I managed to work out that bison is producing a different prototype of 
the function, without the last "yyscanner" parameter. How do I get 
bison to respect the reentrant calling procedures of the scanner? 
 
Here's the top of my bison file: 
 
%{ 
#define YYPARSE_PARAM param_ptr 
#define YYERROR_VERBOSE 
 
#include "basiccompilertypes.hpp" 
#include "mwbase.tab.h" 
#include "mwcompilertypes.hpp" 
%} 
 
%pure_parser 
%locations 
 
... 
 
and the same from my flex file... 
 
%{ 
#include "basiccompilertypes.hpp" 
#include "mwcompilertypes.hpp" 
%} 
 
%pointer 
%option reentrant 
%option bison-bridge 
%option bison-locations 
 
... 
 
 
 
 
 
Thanks in advance 
 
Aaron 
 




reply via email to

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