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: solve 6 shift/reduce conflicts in ...



details:   https://anonhg.NetBSD.org/src/rev/76df5a790b76
branches:  trunk
changeset: 365780:76df5a790b76
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Apr 24 16:50:06 2022 +0000

description:
lint: solve 6 shift/reduce conflicts in notype_direct_declarator

No functional change intended.

diffstat:

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

diffs (59 lines):

diff -r 1dbda9b59f95 -r 76df5a790b76 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Sun Apr 24 15:55:50 2022 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Sun Apr 24 16:50:06 2022 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.397 2022/04/24 15:55:50 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.398 2022/04/24 16:50:06 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.397 2022/04/24 15:55:50 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.398 2022/04/24 16:50:06 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -126,7 +126,7 @@
 
 %}
 
-%expect 144
+%expect 138
 
 %union {
        val_t   *y_val;
@@ -834,6 +834,11 @@
        | type_attribute_list
        ;
 
+type_attribute_list_opt:
+         /* empty */
+       | type_attribute_list
+       ;
+
 type_attribute_list:
          type_attribute
        | type_attribute_list type_attribute
@@ -1223,14 +1228,11 @@
        ;
 
 notype_direct_declarator:
-         T_NAME {
-               $$ = declarator_name(getsym($1));
+         type_attribute_list_opt T_NAME {
+               $$ = declarator_name(getsym($2));
          }
-       | T_LPAREN type_declarator T_RPAREN {
-               $$ = $2;
-         }
-       | type_attribute notype_direct_declarator {
-               $$ = $2;
+       | type_attribute_list_opt T_LPAREN type_declarator T_RPAREN {
+               $$ = $3;
          }
        | notype_direct_declarator T_LBRACK array_size_opt T_RBRACK {
                $$ = add_array($1, $3.has_dim, $3.dim);



Home | Main Index | Thread Index | Old Index