X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/b921d92fcbdb2c19fe2c6158e9a5181d451b976a..9641b918bae9eb8d0bb9099ab6d9d46383ba8bc9:/NEWS diff --git a/NEWS b/NEWS index 2b4ef26e..96a5deb1 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,23 @@ GNU Bison NEWS * 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 term + %type nterm + %printer {} + %destructor {} + %% + nterm: term { $$ = $1; }; + + 3.28-34: warning: type is used, but is not associated to any symbol + 4.28-34: warning: type 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 @@ -16,9 +33,9 @@ GNU Bison NEWS ** 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} @@ -85,8 +102,10 @@ GNU Bison NEWS ** Future changes: The next major release will drop support for generating parsers in K&R C, - and remove the definition of yystype (removal announced since Bison - 1.875). + 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) @@ -1282,6 +1301,33 @@ GNU Bison NEWS - "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.