While compiling lex program an error obtained : conflicting types for ‘yylval’ extern YYSTYPE *yylval;
Any idea how to correct this one? This the the lex code
%{
#include<stdio.h>
#include"y.tab.h"
extern char *yylval;
%}
%%
"int"|"float"|"char"|"double" { yylval=strdup(yytext); return TYP;}
[a-z A-Z][a-z A-Z 0-9]* { yylval=strdup(yytext); return ID;}
";" return SEMI;
"," return COMA;
"{" return LB;
"}" return RB;
"\n" return NL;
[\t]+;
.;
%%