This reverts to the behavior of Bison 1.33 and earlier, and improves compatibility with Yacc. - "parse error" -> "syntax error" Bison now uniformly uses the term "syntax error"; formerly, the code and manual sometimes used the term "parse error" instead. POSIX requires "syntax error" in diagnostics, and it was thought better to be consistent. - The documentation now emphasizes that yylex and yyerror must be declared before use. C99 requires this. - Bison now parses C99 lexical constructs like UCNs and backslash-newline within C escape sequences, as POSIX 1003.1-2001 requires. - File names are properly escaped in C output. E.g., foo\bar.y is output as "foo\\bar.y". - Yacc command and library now available The Bison distribution now installs a "yacc" command, as POSIX requires. Also, Bison now installs a small library liby.a containing implementations of Yacc-compatible yyerror and main functions. This library is normally not useful, but POSIX requires it. - Type clashes now generate warnings, not errors. - If the user does not define YYSTYPE as a macro, Bison now declares it using typedef instead of defining it as a macro. For consistency, YYLTYPE is also declared instead of defined. ** Other compatibility issues - %union directives can now have a tag before the "{", e.g., the directive "%union foo {...}" now generates the C code "typedef union foo { ... } YYSTYPE;"; this is for Yacc compatibility. The default union tag is "YYSTYPE", for compatibility with Solaris 9 Yacc. For consistency, YYLTYPE's struct tag is now "YYLTYPE" not "yyltype". This is for compatibility with both Yacc and Bison 1.35. - ";" is output before the terminating "}" of an action, for compatibility with Bison 1.35. - Bison now uses a Yacc-style format for conflict reports, e.g., "conflicts: 2 shift/reduce, 1 reduce/reduce". - "yystype" and "yyltype" are now obsolescent macros instead of being typedefs or tags; they are no longer documented and are planned to be withdrawn in a future release. ** GLR parser notes - GLR and inline Users of Bison have to decide how they handle the portability of the C keyword "inline". - "parsing stack overflow..." -> "parser stack overflow" GLR parsers now report "parser stack overflow" as per the Bison manual. ** %parse-param and %lex-param The macros YYPARSE_PARAM and YYLEX_PARAM provide a means to pass additional context to yyparse and yylex. They suffer from several shortcomings: - a single argument only can be added, - their types are weak (void *), - this context is not passed to ancillary functions such as yyerror, - only yacc.c parsers support them. The new %parse-param/%lex-param directives provide a more precise control. For instance: %parse-param {int *nastiness} %lex-param {int *nastiness} %parse-param {int *randomness} results in the following signatures: int yylex (int *nastiness); int yyparse (int *nastiness, int *randomness); or, if both %pure-parser and %locations are used: int yylex (YYSTYPE *lvalp, YYLTYPE *llocp, int *nastiness); int yyparse (int *nastiness, int *randomness); ** Bison now warns if it detects conflicting outputs to the same file, e.g., it generates a warning for "bison -d -o foo.h foo.y" since that command outputs both code and header to foo.h. ** #line in output files - --no-line works properly. ** Bison can no longer be built by a K&R C compiler; it requires C89 or later to be built. This change originally took place a few versions ago, but nobody noticed until we recently asked someone to try building Bison with a K&R C compiler.