| 182 | } |
| 183 | |
| 184 | void 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 | } |
no test coverage detected