Bison version 2.2 has been released. Aside from bug fixes, the most important changes in Bison 2.2 are in the new parser skeletons, used to generate parsers other than the traditional Yacc-like parsers. Among other things, the distribution terms now permit using Bison-generated parsers in nonfree programs; previously this was allowed only for Yacc-like parsers. For more details please see the end of this message.
Bison is a parser generator that is compatible with Yacc. Please see <http://www.gnu.org/software/bison/> for more info. Here are the URLs for the gzip and bzip2 compressed tar images: ftp://ftp.gnu.org/gnu/bison/bison-2.2.tar.gz ftp://ftp.gnu.org/gnu/bison/bison-2.2.tar.bz2 Here are their MD5 and SHA1 checksums, respectively: 4b0ebf57fe935d7d5cc01907d1400b8b bison-2.2.tar.gz e345a5d021db850f06ce49eba78af027 bison-2.2.tar.bz2 5dfad03a9c651c4d24a4a389af3549dd52ef0f6f bison-2.2.tar.gz b01691c83cc0d08d3c03e32c494f6b03381ecd21 bison-2.2.tar.bz2 To try this version, please make sure you have GNU m4 1.4.4 installed. Then obtain the file bison-2.2.tar.gz, and execute the following shell commands or their equivalents: gunzip <bison-2.2.tar.gz | tar xf - cd bison-2.2 ./configure make make check We particularly appreciate tests on unusual hosts. Please report bugs to <bug-bison@gnu.org>. As usual, thanks to everyone who has contributed bug reports and improvements to Bison. Here is a list of user-visible changes in version 2.2, as compared to 2.1. * The distribution terms for all Bison-generated parsers now permit using the parsers in nonfree programs. Previously, this permission was granted only for Bison-generated LALR(1) parsers in C. * %name-prefix changes the namespace name in C++ outputs. * The C++ parsers export their token_type. * Bison now allows multiple %union declarations, and concatenates their contents together. * New warning: unused values Right-hand side symbols whose values are not used are reported, if the symbols have destructors. For instance: exp: exp "?" exp ":" exp { $1 ? $1 : $3; } | exp "+" exp ; will trigger a warning about $$ and $5 in the first rule, and $3 in the second ($1 is copied to $$ by the default rule). This example most likely contains three errors, and could be rewritten as: exp: exp "?" exp ":" exp { $$ = $1 ? $3 : $5; free ($1 ? $5 : $3); free ($1); } | exp "+" exp { $$ = $1 ? $1 : $3; if ($1) free ($3); } ; However, if the original actions were really intended, memory leaks and all, the warnings can be suppressed by letting Bison believe the values are used, e.g.: exp: exp "?" exp ":" exp { $1 ? $1 : $3; (void) ($$, $5); } | exp "+" exp { $$ = $1; (void) $3; } ; If there are mid-rule actions, the warning is issued if no action uses it. The following triggers no warning: $1 and $3 are used. exp: exp { push ($1); } '+' exp { push ($3); sum (); }; The warning is intended to help catching lost values and memory leaks. If a value is ignored, its associated memory typically is not reclaimed. * %destructor vs. YYABORT, YYACCEPT, and YYERROR. Destructors are now called when user code invokes YYABORT, YYACCEPT, and YYERROR, for all objects on the stack, other than objects corresponding to the right-hand side of the current rule. * %expect, %expect-rr Incorrect numbers of expected conflicts are now actual errors, instead of warnings. * GLR, YACC parsers. The %parse-params are available in the destructors (and the experimental printers) as per the documentation. * Bison now warns if it finds a stray `$' or `@' in an action. * %require "VERSION" This specifies that the grammar file depends on features implemented in Bison version VERSION or higher. * lalr1.cc: The token and value types are now class members. The tokens were defined as free form enums and cpp macros. YYSTYPE was defined as a free form union. They are now class members: tokens are enumerations of the `yy::parser::token' struct, and the semantic values have the `yy::parser::semantic_type' type. If you do not want or can update to this scheme, the directive `%define "global_tokens_and_yystype" "1"' triggers the global definition of tokens and YYSTYPE. This change is suitable both for previous releases of Bison, and this one. If you wish to update, then make sure older version of Bison will fail using `%require "2.2"'. * DJGPP support added. _______________________________________________ GNU Announcement mailing list <info-gnu@gnu.org> http://lists.gnu.org/mailman/listinfo/info-gnu