* Noteworthy changes in release ?.? (????-??-??) [?]
+** Warnings about useless semantic types
+
+ Bison now warns about useless (uninhabited) semantic types. Since
+ semantic types are not declared to Bison (they are defined in the opaque
+ %union structure), it is %printer/%destructor directives about useless
+ types that trigger the warning:
+
+ %token <type1> term
+ %type <type2> nterm
+ %printer {} <type1> <type3>
+ %destructor {} <type2> <type4>
+ %%
+ nterm: term { $$ = $1; };
+
+ 3.28-34: warning: type <type3> is used, but is not associated to any symbol
+ 4.28-34: warning: type <type4> is used, but is not associated to any symbol
+
+** Warnings about undeclared symbols
+
+ Bison used to raise an error for %printer and %destructor directives for
+ undefined symbols.
+
+ %printer {} symbol1
+ %destructor {} symbol2
+ %%
+ exp: "a";
+
+ This is now only a warning.
+
** Additional yylex/yyparse arguments
- The new directive %param declare additional argument to both yylex
- and yyparse. The %lex-param, %parse-param, and %param directives
- support one or more arguments. Instead of
+ The new directive %param declares additional arguments to both yylex and
+ yyparse. The %lex-param, %parse-param, and %param directives support one
+ or more arguments. Instead of
- %lex-param {arg1_type *arg1}
- %lex-param {arg2_type *arg2}
- %parse-param {arg1_type *arg1}
- %parse-param {arg2_type *arg2}
+ %lex-param {arg1_type *arg1}
+ %lex-param {arg2_type *arg2}
+ %parse-param {arg1_type *arg1}
+ %parse-param {arg2_type *arg2}
one may now declare
- %param {arg1_type *arg1} {arg2_type *arg2}
+ %param {arg1_type *arg1} {arg2_type *arg2}
** Java skeleton improvements
the generated files. This is especially useful to avoid collisions
with identifiers in the target language. For instance
- %token FILE for ERROR
- %define api.tokens.prefix "TOK_"
- %%
- start: FILE for ERROR;
+ %token FILE for ERROR
+ %define api.tokens.prefix "TOK_"
+ %%
+ start: FILE for ERROR;
will generate the definition of the symbols TOK_FILE, TOK_for, and
TOK_ERROR in the generated sources. In particular, the scanner must
allow the programmer to prune possible parses based on the values of
runtime expressions.
+* Noteworthy changes in release ?.? (????-??-??) [?]
+
+** Future changes:
+
+ The next major release will drop support for generating parsers in K&R C,
+ and remove the definitions of yystype and yyltype (removal announced since
+ Bison 1.875). YYPARSE_PARAM and YYLEX_PARAM, which were deprecated in
+ favor of %parse-param and %lex-param (introduced in Bison 1.875 too), will
+ no longer be supported.
+
+** The generated header is included (yacc.c)
+
+ Instead of duplicating the content of the generated header (definition of
+ YYSTYPE, yyltype etc.), the generated parser now includes it, as was
+ already the case for GLR or C++ parsers.
+
+** Headers (yacc.c, glr.c, glr.cc)
+
+*** Guards
+
+ The generated headers are now guarded, as is already the case for C++
+ parsers (lalr1.cc). For intance, with --defines=foo.h:
+
+ #ifndef YY_FOO_H
+ # define YY_FOO_H
+ ...
+ #endif /* !YY_FOO_H */
+
+*** New declarations
+
+ The generated header now declares yydebug and yyparse. Both honor
+ --name-prefix=bar_, and yield
+
+ int bar_parse (void);
+
+ rather than
+
+ #define yyparse bar_parse
+ int yyparse (void);
+
+ in order to facilitate the inclusion of several parser headers inside a
+ single compilation unit.
+
* Noteworthy changes in release 2.5.1 (2012-06-05) [stable]
** Future changes:
This includes warnings with some compilers, unexpected behavior of tools
such as diff, warning messages from the test suite itself, etc.
-*** The install-pdf target work properly:
+*** The install-pdf target works properly:
Running "make install-pdf" (or -dvi, -html, -info, and -ps) no longer
halts in the middle of its course.
- "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 anciliary 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.