MCPcopy Create free account
hub / github.com/Nic30/hdlConvertor / visitLocal_parameter_declaration

Method visitLocal_parameter_declaration

src/svConvertor/paramDefParser.cpp:184–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184void VerParamDefParser::visitLocal_parameter_declaration(
185 sv2017Parser::Local_parameter_declarationContext *ctx,
186 vector<unique_ptr<HdlIdDef>> &_res) {
187 // local_parameter_declaration:
188 // KW_LOCALPARAM ( KW_TYPE list_of_type_assignments
189 // | ( data_type_or_implicit )? list_of_param_assignments
190 // );
191 auto &res = *reinterpret_cast<vector<unique_ptr<HdlIdDef>>*>(&_res);
192 auto orig_size = res.size();
193
194 if (ctx->KW_TYPE()) {
195 auto lta = ctx->list_of_type_assignments();
196 visitList_of_type_assignments(lta, res);
197 } else {
198 unique_ptr<iHdlExprItem> t;
199 auto dti = ctx->data_type_or_implicit();
200 if (dti) {
201 VerTypeParser tp(this);
202 t = tp.visitData_type_or_implicit(dti, nullptr);
203 } else
204 t = update_code_position(HdlValueSymbol::type_auto(), dti);
205 auto lpa = ctx->list_of_param_assignments();
206 auto doc = commentParser.parse(ctx);
207 visitTyped_list_of_param_assignments(move(t), lpa, doc, res);
208 }
209 if (orig_size < res.size()) {
210 for (size_t i = orig_size; i < res.size(); i++) {
211 res[i]->is_const = true;
212 }
213 }
214}
215
216}
217}

Calls 3

update_code_positionFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected