mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
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:
22
NEWS
22
NEWS
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user