[Flex-help] YY_DECL prototype not in flex header file
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Christian E. <eh...@zb...> - 2009-03-13 09:37:54
|
Hi everybody, when declaring YY_DECL in the flex file (lexer.l), the macro is only defined in the source file (lexer.c) and not in the header file (lexer.h), resulting in a incorrect prototype of yylex in the header file. Could not find a way to modify the lexer.h so the YY_DECL is included. By intuition, I would expect a definition of YY_DECL in lexer.h, since it is defined in lexer.l. bug? lexer.l: -------- %{ #include <math.h> #include <stdio.h> #include <string.h> #include "smarts_grammar.h" #define YY_DECL int smartslex( YYSTYPE* yylval_param, YYLTYPE* yylloc_param, char* smarts_read ) %} ... grep YY_DECL lexer.h #ifndef YY_DECL #define YY_DECL_IS_OURS 1 #define YY_DECL int smartslex \ #endif /* !YY_DECL */ #ifdef YY_DECL_IS_OURS #undef YY_DECL_IS_OURS #undef YY_DECL grep YY_DECL lexer.c #define YY_DECL int smartslex( YYSTYPE* yylval_param, YYLTYPE* yylloc_param, char* smarts_read ) #ifndef YY_DECL #define YY_DECL_IS_OURS 1 #define YY_DECL int smartslex \ #endif /* !YY_DECL */ YY_DECL |