Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: remove 8 of the grammar conflicts,...



details:   https://anonhg.NetBSD.org/src/rev/c4d90ed887f0
branches:  trunk
changeset: 1022218:c4d90ed887f0
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jul 10 04:57:41 2021 +0000

description:
lint: remove 8 of the grammar conflicts, 142 remaining

No functional change.

diffstat:

 usr.bin/xlint/lint1/cgram.y |  23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diffs (63 lines):

diff -r 5275ff1753a4 -r c4d90ed887f0 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sat Jul 10 04:47:25 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sat Jul 10 04:57:41 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.279 2021/07/10 04:47:25 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.280 2021/07/10 04:57:41 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.279 2021/07/10 04:47:25 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.280 2021/07/10 04:57:41 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -123,7 +123,7 @@
 }
 %}
 
-%expect 150
+%expect 142
 
 %union {
        val_t   *y_val;
@@ -721,26 +721,25 @@
          }
        ;
 
-/*
- * XXX: shift/reduce conflict, caused by:
- *     type_attribute noclass_declspecs
- *     noclass_declspecs type_attribute
- */
 noclass_declspecs:
+         noclass_declspecs_postfix
+       | type_attribute noclass_declspecs_postfix
+       ;
+
+noclass_declspecs_postfix:
          clrtyp_typespec {
                add_type($1);
          }
-       | type_attribute noclass_declspecs
        | noclass_declmods typespec {
                add_type($2);
          }
-       | noclass_declspecs T_QUAL {
+       | noclass_declspecs_postfix T_QUAL {
                add_qualifier($2);
          }
-       | noclass_declspecs notype_typespec {
+       | noclass_declspecs_postfix notype_typespec {
                add_type($2);
          }
-       | noclass_declspecs type_attribute
+       | noclass_declspecs_postfix type_attribute
        ;
 
 noclass_declmods:



Home | Main Index | Thread Index | Old Index