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: clean up grammar for member declar...



details:   https://anonhg.NetBSD.org/src/rev/fcbfc22d1f58
branches:  trunk
changeset: 1022184:fcbfc22d1f58
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Jul 08 03:35:07 2021 +0000

description:
lint: clean up grammar for member declarations

No functional change.

diffstat:

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

diffs (68 lines):

diff -r d2d305e91a05 -r fcbfc22d1f58 usr.bin/xlint/lint1/cgram.y
--- a/usr.bin/xlint/lint1/cgram.y       Thu Jul 08 03:22:47 2021 +0000
+++ b/usr.bin/xlint/lint1/cgram.y       Thu Jul 08 03:35:07 2021 +0000
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.268 2021/07/08 03:22:47 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.269 2021/07/08 03:35:07 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.268 2021/07/08 03:22:47 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.269 2021/07/08 03:35:07 rillig Exp $");
 #endif
 
 #include <limits.h>
@@ -290,7 +290,7 @@
 %type  <y_tspec>       struct
 %type  <y_sym>         struct_declaration
 %type  <y_sb>          identifier
-%type  <y_sym>         member_declaration_list_with_rbrace
+%type  <y_sym>         member_declaration_list_semi
 %type  <y_sym>         member_declaration_list
 %type  <y_sym>         member_declaration
 %type  <y_sym>         notype_member_decls
@@ -662,20 +662,19 @@
        ;
 
 struct_declaration:
-         struct_decl_lbrace member_declaration_list_with_rbrace {
-               $$ = $2;
+         T_LBRACE {
+               symtyp = FVFT;
+         } member_declaration_list_semi T_RBRACE {
+               $$ = $3;
          }
        ;
 
-struct_decl_lbrace:
-         T_LBRACE {
-               symtyp = FVFT;
+member_declaration_list_semi:
+         /* empty */ {
+               $$ = NULL;
          }
-       ;
-
-member_declaration_list_with_rbrace:
-         member_declaration_list T_SEMI T_RBRACE
-       | member_declaration_list T_RBRACE {
+       | member_declaration_list T_SEMI
+       | member_declaration_list {
                if (sflag) {
                        /* syntax req. ';' after last struct/union member */
                        error(66);
@@ -685,9 +684,6 @@
                }
                $$ = $1;
          }
-       | T_RBRACE {
-               $$ = NULL;
-         }
        ;
 
 member_declaration_list:



Home | Main Index | Thread Index | Old Index