[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 01/12] grammar: introduce %empty
From: |
Akim Demaille |
Subject: |
Re: [PATCH 01/12] grammar: introduce %empty |
Date: |
Mon, 18 Feb 2013 10:01:17 +0100 |
Le 16 févr. 2013 à 14:55, Akim Demaille <address@hidden> a écrit :
> Provide a means to explicitly denote empty right-hand sides of rules:
> instead of
>
> exp: { ... }
>
> allow
>
> exp: %empty { ... }
>
> Make sure that %empty is properly used.
>
> With help from Joel E. Denny and Gabriel Rassoul.
> http://lists.gnu.org/archive/html/bison-patches/2013-01/msg00142.html
>
> * src/reader.h, src/reader.c (grammar_current_rule_empty_set): New.
> * src/parse-gram.y (%empty): New token.
> Use it.
> * src/scan-gram.l (%empty): Scan it.
> * src/reader.c (grammar_rule_check): Check that %empty is properly used.
> * tests/actions.at (Invalid uses of %empty, Valid uses of %empty): New.
I will squash this in before pushing.
commit c728b8cd8371020827adbe7a323aab7865cd0893
Author: Akim Demaille <address@hidden>
Date: Mon Feb 18 09:59:52 2013 +0100
fixup! grammar: introduce %empty
diff --git a/tests/actions.at b/tests/actions.at
index fd69608..3021c7a 100644
--- a/tests/actions.at
+++ b/tests/actions.at
@@ -132,6 +132,7 @@ AT_DATA_GRAMMAR([[two.y]],
exp:
'a' %empty {}
| %empty 'a' {}
+| %empty {} {}
;
]])
@@ -142,6 +143,9 @@ AT_BISON_CHECK([-fcaret two.y], [1], [],
two.y:12.3-8: error: %empty on non-empty rule
| %empty 'a' {}
^^^^^^
+two.y:13.3-8: error: %empty on non-empty rule
+ | %empty {} {}
+ ^^^^^^
]])
AT_CLEANUP
- Re: RFC: explicit empty right-hand side of a rule, (continued)
- Re: RFC: explicit empty right-hand side of a rule, Joel E. Denny, 2013/02/03
- Re: RFC: explicit empty right-hand side of a rule, Akim Demaille, 2013/02/04
- Re: RFC: explicit empty right-hand side of a rule, Joel E. Denny, 2013/02/04
- Re: RFC: explicit empty right-hand side of a rule, Akim Demaille, 2013/02/05
- Re: RFC: explicit empty right-hand side of a rule, Joel E. Denny, 2013/02/05
- [PATCH 00/12] {master} explicit empty right-hand side of a rule, Akim Demaille, 2013/02/18
- Re: [PATCH 00/12] {master} explicit empty right-hand side of a rule, Akim Demaille, 2013/02/16
- Re: [PATCH 00/12] {master} explicit empty right-hand side of a rule, Akim Demaille, 2013/02/19
- [PATCH 02/12] parser: use %empty, Akim Demaille, 2013/02/18
- [PATCH 01/12] grammar: introduce %empty, Akim Demaille, 2013/02/18
- Re: [PATCH 01/12] grammar: introduce %empty,
Akim Demaille <=
- [PATCH 10/12] style: no longer use backquotes in messages, Akim Demaille, 2013/02/18
- [PATCH 08/12] doc: introduce %empty and -Wempty-rule, Akim Demaille, 2013/02/18
- Re: [PATCH 08/12] doc: introduce %empty and -Wempty-rule, Akim Demaille, 2013/02/16
- [PATCH 07/12] report: use %empty to denote empty rules, Akim Demaille, 2013/02/18
- [PATCH 09/12] doc: use %empty instead of /* empty */, Akim Demaille, 2013/02/18
- [PATCH 11/12] style: no longer use backquotes, Akim Demaille, 2013/02/18
- [PATCH 06/12] diagnostics: %empty enables -Wempty-rule, Akim Demaille, 2013/02/18
- [PATCH 05/12] -Wempty-rule: diagnose empty rules without %empty, Akim Demaille, 2013/02/18
- [PATCH 04/12] tests: use %empty, Akim Demaille, 2013/02/18
- [PATCH 12/12] style: no longer use backquotes, Akim Demaille, 2013/02/18