(rules_or_grammar_declaration): Require a

semicolon after a grammar declaration, in the interest of possible
future changes to the Bison input language.
Do not allow a stray semicolon at the start of the grammar.
(rhses.1): Allow one or more semicolons after any rule, including
just before "|" as required by POSIX.
This commit is contained in:
Paul Eggert
2003-05-14 19:26:16 +00:00
parent caf37a3666
commit 8d0a98bb50

View File

@@ -332,7 +332,7 @@ grammar:
body of the grammar. */ body of the grammar. */
rules_or_grammar_declaration: rules_or_grammar_declaration:
rules rules
| grammar_declaration | grammar_declaration ";"
{ {
if (yacc_flag) if (yacc_flag)
complain_at (@$, _("POSIX forbids declarations in the grammar")); complain_at (@$, _("POSIX forbids declarations in the grammar"));
@@ -341,7 +341,6 @@ rules_or_grammar_declaration:
{ {
yyerrok; yyerrok;
} }
| ";"
; ;
rules: rules:
@@ -351,6 +350,7 @@ rules:
rhses.1: rhses.1:
rhs { grammar_rule_end (@1); } rhs { grammar_rule_end (@1); }
| rhses.1 "|" rhs { grammar_rule_end (@3); } | rhses.1 "|" rhs { grammar_rule_end (@3); }
| rhses.1 ";"
; ;
rhs: rhs: