Hello, I am a neophyte trying to convert a yacc grammar to bison. The grammar in question runs fine with yacc but my requirements are to be able to run under linux and/or cygwinix - I'd rather fix the grammar for bison than try to find a yacc executable for win32.
Anyway, I had some initial problems getting YYSTYPE properly defined for yylval - perhaps they're not completely resolved. YYSTYPE is a union here but defined in a two stage process. To get past the compiler errors I merely #defined YYSTYPE right after the union declaration inside the .h file that defines the union. If I run the resultant parser I get a segfault but the compiler warnings are a pretty good clue to what's happening: warning: passing arg 1 of `stricmp' makes pointer from integer without a cast What's happening is bison is creating an 'int yytoken' - however, the hand-rolled lexical analyzer already declared a char *yytoken (it's actually a fixed array). If I comment out the "int yytoken" it compiles with fewer warnings but there is clearly a cognitive dissonance here. Any help on this matter would be greatly appreciated. ~Tom _______________________________________________ [email protected] http://lists.gnu.org/mailman/listinfo/help-bison
