X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/7d6bad195977b0204fc8406cac57cf5a4f1c769b..f038e56cdc211396f54f138e95693d0906d6fafa:/NEWS?ds=inline diff --git a/NEWS b/NEWS index 461959e0..20c3100f 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,21 @@ GNU Bison NEWS * Noteworthy changes in release ?.? (????-??-??) [?] -** Incompatible changes +** WARNING: Future backward-incompatibilities! + + Bison will stop adding a semicolon at the end of the actions (as announced + in the release 2.5): + + foo.y:2.22: warning: a ';' might be needed at the end of action code + exp: "num" { $$ = $1 } + ^ + foo.y:2.22: future versions of Bison will not add the ';' + + Like other GNU packages, Bison will start using some of the C99 features + for its own code, especially the definition of variables after statements. + The generated C parsers still aim at C90. + +** Backward incompatible changes *** Obsolete features @@ -14,7 +28,29 @@ GNU Bison NEWS Support for YYLEX_PARAM and YYPARSE_PARAM is removed (deprecated in Bison 1.875): use %lex-param, %parse-param, or %param. -** Warnings +** Bug fixes + +*** The epilogue is no longer affected by internal #defines + + The glr.c skeleton uses defines such as #define yylval (yystackp->yyval) in + generated code. These weren't properly undefined before the inclusion of + the user epilogue, so functions such as the following were butchered by the + preprocessor expansion: + + int yylex (YYSTYPE *yylval); + + This is has been fixed: yylval, yynerrs, yychar, and yylloc are now valid + identifiers for user-provided variables. + +*** stdio.h is no longer needed when locations are enabled (yacc.c) + + Changes in Bison 2.7 introduced a dependency on FILE and fprintf when + locations are enabled. This is fixed. + +** Diagnostics reported by Bison + + Most of these features were contributed by Théophile Ranquet and Victor + Santet. *** Carets @@ -179,6 +215,8 @@ GNU Bison NEWS ** Java skeleton improvements + Contributed by Paolo Bonzini. + The constants for token names were moved to the Lexer interface. Also, it is possible to add code to the parser's constructors using "%code init" and "%define init_throws". @@ -204,18 +242,6 @@ GNU Bison NEWS used by the scanner, or rejecting invalid combinations from a factory invoked by the user actions). -*** The epilogue is no longer affected by internal #defines - - The glr.c skeleton uses defines such as #define yylval (yystackp->yyval) in - generated code. These weren't properly undefined before the inclusion of - the user epilogue, so functions such as the following were butchered by the - preprocessor expansion: - - int yylex (yy::parser::semantic_type *yylval); - - This is has been fixed: yylval, ynerrs, yychar, and yylloc are now valid - identifiers for user-provided variables. - ** Renamed %define variables The following variables have been renamed for consistency. Backward @@ -242,8 +268,6 @@ GNU Bison NEWS use these prefixed token names, although the grammar itself still uses the short names (as in the sample rule given above). - - ** Variable parse.error This variable controls the verbosity of error messages. The use of the @@ -252,6 +276,8 @@ GNU Bison NEWS ** Semantic predicates + Contributed by Paul Hilfinger. + The new, experimental, semantic-predicate feature allows actions of the form "%?{ BOOLEAN-EXPRESSION }", which cause syntax errors (as for YYERROR) if the expression evaluates to 0, and are evaluated immediately @@ -264,6 +290,84 @@ GNU Bison NEWS It used to be an error only if used in non GLR mode, _and_ if there are reduce/reduce conflicts. +** Token numbering has changed to preserve the user-defined order + + When declaring %token A B, the numbering for A is inferior to B. Up to now, + when declaring associativity at the same time, with %left (or %right, + %precedence, %nonassoc), B was inferior to A. + +** Useless precedence and associativity + + Contributed by Valentin Tolmer. + + When developping and maintaining a grammar, useless associativity and + precedence directives are common. They can be a nuisance: new ambiguities + arising are sometimes masked because their conflicts are resolved due to + the extra precedence or associativity information. Furthermore, it can + hinder the comprehension of a new grammar: one will wonder about the role + of a precedence, where in fact it is useless. The following changes aim + at detecting and reporting these extra directives. + +*** Precedence warning category + + A new category of warning, -Wprecedence, was introduced. It flags the + useless precedence and associativity directives. + +*** Useless associativity + + Bison now warns about symbols with a declared associativity that is never + used to resolve conflicts. In that case, using %precedence is sufficient; + the parsing tables will remain unchanged. Solving these warnings may raise + useless precedence warnings, as the symbols no longer have associativity. + For example: + + %left '+' + %left '*' + %% + exp: + "num" + | exp '+' "num" + | exp '*' exp + ; + + will produce a + + warning: useless associativity for '+', use %precedence [-Wprecedence] + %left '+' + ^^^ + +*** Useless precedence + + Bison now warns about symbols with a declared precedence and no declared + associativity (i.e., declared with %precedence), and whose precedence is + never used. In that case, the symbol can be safely declared with %token + instead, without modifying the parsing tables. For example: + + %precedence '=' + %% + exp: "var" '=' "num"; + + will produce a + + warning: useless precedence for '=' [-Wprecedence] + %precedence '=' + ^^^ + +*** Useless precedence and associativity + + In case of both useless precedence and associativity, the issue is flagged + as follows: + + %nonassoc '=' + %% + exp: "var" '=' "num"; + + The warning is: + + warning: useless precedence and associativity for '=' [-Wprecedence] + %nonassoc '=' + ^^^ + * Noteworthy changes in release 2.7 (2012-12-12) [stable] ** Bug fixes @@ -274,6 +378,8 @@ GNU Bison NEWS ** Diagnostics are improved + Contributed by Théophile Ranquet. + *** Changes in the format of error messages This used to be the format of many error reports: @@ -359,6 +465,8 @@ GNU Bison NEWS ** Graph improvements in DOT and XSLT + Contributed by Théophile Ranquet. + The graphical presentation of the states is more readable: their shape is now rectangular, the state number is clearly displayed, and the items are numbered and left-justified. @@ -800,7 +908,9 @@ GNU Bison NEWS These features are experimental. More user feedback will help to stabilize them. -** LAC (Lookahead Correction) for syntax error handling: +** LAC (Lookahead Correction) for syntax error handling + + Contributed by Joel E. Denny. Canonical LR, IELR, and LALR can suffer from a couple of problems upon encountering a syntax error. First, the parser might perform