6969%type <std::string> valid_name
7070
7171%type <std::pair<verilog::PortDirection, verilog::ConnectionType> > port_type
72- %type <verilog::Port> port_declarations port_decl port_decl_clauses
72+ %type <verilog::Port> port_declarations port_decl port_decl_statements
7373
7474%type <verilog::NetType> net_type
75- %type <verilog::Net> net_decl_clauses net_decl
75+ %type <verilog::Net> net_decl_statements net_decl
7676
7777%type <verilog::Constant> constant
7878%type <verilog::Assignment> assignment
@@ -109,17 +109,17 @@ module
109109 {
110110 driver->add_module(std::move($2));
111111 }
112- clauses ENDMODULE
112+ statements ENDMODULE
113113 | MODULE valid_name '(' ')' ';'
114114 {
115115 driver->add_module(std::move($2));
116116 }
117- clauses ENDMODULE
117+ statements ENDMODULE
118118 | MODULE valid_name '(' port_names ')' ';'
119119 {
120120 driver->add_module(std::move($2));
121121 }
122- clauses ENDMODULE
122+ statements ENDMODULE
123123 | MODULE valid_name '('
124124 {
125125 driver->add_module(std::move($2));
@@ -128,7 +128,7 @@ module
128128 {
129129 driver->add_port(std::move($5));
130130 }
131- ';' clauses ENDMODULE
131+ ';' statements ENDMODULE
132132 ;
133133
134134// port names are ignored as they will be parsed later in declaration
@@ -183,30 +183,30 @@ port_decl
183183 }
184184 ;
185185
186- clauses
186+ statements
187187 : // empty
188- | clauses clause
189- | clauses clause_assign
188+ | statements statement
189+ | statements statement_assign
190190 ;
191191
192- clause
192+ statement
193193 : declaration
194194 | instance
195195 ;
196196
197197
198198declaration
199- : port_decl_clauses ';' { driver->add_port(std::move($1)); }
200- | net_decl_clauses ';' { driver->add_net(std::move($1)); }
199+ : port_decl_statements ';' { driver->add_port(std::move($1)); }
200+ | net_decl_statements ';' { driver->add_net(std::move($1)); }
201201 ;
202202
203- // e.g. "input a, b, output c, d" is not allowed in port declaration clauses
204- port_decl_clauses
203+ // e.g. "input a, b, output c, d" is not allowed in port declaration statements
204+ port_decl_statements
205205 : port_decl
206206 {
207207 $$ = $1;
208208 }
209- | port_decl_clauses ',' valid_name
209+ | port_decl_statements ',' valid_name
210210 {
211211 $1.names.emplace_back(std::move($3));
212212 $$ = $1;
@@ -225,12 +225,12 @@ net_type
225225 | SUPPLY1 { $$ = verilog::NetType::SUPPLY1; }
226226 ;
227227
228- net_decl_clauses
228+ net_decl_statements
229229 : net_decl
230230 {
231231 $$ = $1;
232232 }
233- | net_decl_clauses ',' valid_name
233+ | net_decl_statements ',' valid_name
234234 {
235235 $1.names.push_back(std::move($3));
236236 $$ = $1;
@@ -253,7 +253,7 @@ net_decl
253253 ;
254254
255255
256- clause_assign
256+ statement_assign
257257 : ASSIGN assignments ';'
258258
259259assignments
0 commit comments