doc: introduce %empty and -Wempty-rule

* doc/bison.texi (Grammar Rules): Make it a @section which
contains...
(Rules Syntax): this new subsection (with the previous contents of
"Grammar Rules".
(Empty Rules): New subsection, extracted from the former
"Grammar Rules".
Document %empty.
(Recursion): New a subsection of "Grammar Rules".
Complete a few index entries.
(Bison Options): Document -Wempty-rule.
This commit is contained in:
Akim Demaille
2013-02-16 13:23:23 +01:00
parent 8b807f1177
commit 09add9c24f
2 changed files with 96 additions and 20 deletions

22
NEWS
View File

@@ -362,6 +362,28 @@ GNU Bison NEWS
%nonassoc '='
^^^
** Empty rules
Empty rules (i.e., with an empty right-hand side) can now be explicitly
marked by the new %empty directive. Using %empty on a non-empty rule is
an error. The new -Wempty-rule warning reports empty rules without
%empty. On the following grammar:
%%
s: a b c;
a: ;
b: %empty;
c: 'a' %empty;
bison reports:
3.4-5: warning: empty rule without %empty [-Wempty-rule]
a: {}
^^
5.8-13: error: %empty on non-empty rule
c: 'a' %empty {};
^^^^^^
** Java skeleton improvements
Contributed by Paolo Bonzini.