Skip to content

Commit 9f0614b

Browse files
committed
Verilog: make net_decl_assignment rule match SystemVerilog 1800-2017
This removes the net_name rule, and makes the assignment in the net_decl_assignment rule optional, to match SystemVerilog 1800-2017.
1 parent f7cf3fd commit 9f0614b

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

src/verilog/parser.y

+5-22
Original file line numberDiff line numberDiff line change
@@ -1160,12 +1160,7 @@ genvar_declaration:
11601160
;
11611161

11621162
net_declaration:
1163-
net_type drive_strength_opt vectored_scalared_opt data_type_or_implicit delay3_opt list_of_net_names ';'
1164-
{ init($$, ID_decl);
1165-
addswap($$, ID_class, $1);
1166-
addswap($$, ID_type, $4);
1167-
swapop($$, $6); }
1168-
| net_type drive_strength_opt vectored_scalared_opt data_type_or_implicit delay3_opt list_of_net_decl_assignments ';'
1163+
net_type drive_strength_opt vectored_scalared_opt data_type_or_implicit delay3_opt list_of_net_decl_assignments ';'
11691164
{ init($$, ID_decl);
11701165
addswap($$, ID_class, $1);
11711166
addswap($$, ID_type, $4);
@@ -1195,21 +1190,6 @@ vectored_scalared_opt:
11951190
| TOK_SCALARED { init($$, "scalared"); }
11961191
;
11971192

1198-
list_of_net_names:
1199-
net_name
1200-
{ init($$); mto($$, $1); }
1201-
| list_of_net_names ',' net_name
1202-
{ $$=$1; mto($$, $3); }
1203-
;
1204-
1205-
net_name: net_identifier unpacked_dimension_brace
1206-
{
1207-
$$=$1;
1208-
stack_expr($$).id(ID_declarator);
1209-
addswap($$, ID_type, $2);
1210-
}
1211-
;
1212-
12131193
list_of_net_decl_assignments:
12141194
net_decl_assignment
12151195
{ init($$); mto($$, $1); }
@@ -1673,7 +1653,10 @@ range: part_select;
16731653
// System Verilog standard 1800-2017
16741654
// A.2.4 Declaration assignments
16751655

1676-
net_decl_assignment: net_identifier '=' expression
1656+
net_decl_assignment:
1657+
net_identifier
1658+
{ $$ = $1; stack_expr($$).id(ID_declarator); }
1659+
| net_decl_assignment: net_identifier '=' expression
16771660
{ $$ = $1; stack_expr($$).id(ID_declarator); addswap($$, ID_value, $3); }
16781661
;
16791662

0 commit comments

Comments
 (0)