Module Name: src Committed By: rillig Date: Sun Apr 24 16:54:09 UTC 2022
Modified Files: src/usr.bin/xlint/lint1: cgram.y Log Message: lint: resolve 6 shift/reduce conflicts in type_direct_declarator No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.398 -r1.399 src/usr.bin/xlint/lint1/cgram.y Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.398 src/usr.bin/xlint/lint1/cgram.y:1.399 --- src/usr.bin/xlint/lint1/cgram.y:1.398 Sun Apr 24 16:50:06 2022 +++ src/usr.bin/xlint/lint1/cgram.y Sun Apr 24 16:54:09 2022 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.398 2022/04/24 16:50:06 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.399 2022/04/24 16:54:09 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.398 2022/04/24 16:50:06 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.399 2022/04/24 16:54:09 rillig Exp $"); #endif #include <limits.h> @@ -126,7 +126,7 @@ anonymize(sym_t *s) %} -%expect 138 +%expect 132 %union { val_t *y_val; @@ -1246,14 +1246,11 @@ notype_direct_declarator: ; type_direct_declarator: - identifier { - $$ = declarator_name(getsym($1)); - } - | T_LPAREN type_declarator T_RPAREN { - $$ = $2; + type_attribute_list_opt identifier { + $$ = declarator_name(getsym($2)); } - | type_attribute type_direct_declarator { - $$ = $2; + | type_attribute_list_opt T_LPAREN type_declarator T_RPAREN { + $$ = $3; } | type_direct_declarator T_LBRACK array_size_opt T_RBRACK { $$ = add_array($1, $3.has_dim, $3.dim);