Hi everybody,

I have a problem with my parser. I spent some hours trying to fix it,
but I still don't understand what happens:

My parser is uses lex to read strings and bison to work on them.

The bison-file parser.y is like that:
#define YYSTYPE char *



The lex file is supposed to read strings and write them to yylval.
First, I include the header, which I think should tell the scanner that
yylval is a char-pointer 
#include "parser.h"   

Then I try to use it:
yylval = strdup(yytext)

The compiler (gcc) states that yylval is an integer:
Warning: assignment makes integer from pointer without a cast




My next thougth was that yylval is integer by default, and I added
(which I found in a tutorial):
Extern char *yylval

Now, the compiler answers:
Conflicting types for 'yylval'
Previous declaration of 'yylval'



Maybe somebody knows (or sees) what happens,


Kind regards,
Martin Bock
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to