[comp.os.minix] yacc and flex - defining yylval

U5569462@ucsvc.unimelb.edu.au (DAVID CLUNIE) (08/16/89)

In regard to Guy Helmers psoting concerning trouble compiling flex with my
version of yacc, the following explains the problem.

Historically Decus yacc was sued in conjunction with Decus lex, and in this
configuration, yylval, the returned value from the lexical analyzer, was
defined in lex and declared extern in yacc.

This is contrary to AT&T yacc and bison policy, which define yylval in the
ytab.c output file rather than in the lex output file.

If this is a problem for your compiler then either ...

    - hand edit ytab.c  (ugly), or

    - change line 37 of yaophead.c from

      "extern YYSTYPE yylval;\n"

       to

      "YYSTYPE yylval;\n"

As far as memset is concerned, I presume this function is not in the Minix
library that you are using. Flex must refer to it, because I don't think my
yacc does. Better take a look at the previously posted flex for Minix that
went past recently.

Regards ... David Clunie