| 180 | } |
| 181 | |
| 182 | void VerModuleParser::visitModule_item(sv2017Parser::Module_itemContext *ctx, |
| 183 | vector<unique_ptr<iHdlObj>> &objs, ModuleCtx &m_ctx) { |
| 184 | // module_item: |
| 185 | // generate_region |
| 186 | // | ( attribute_instance )* module_item_item |
| 187 | // | specify_block |
| 188 | // | program_declaration |
| 189 | // | module_declaration |
| 190 | // | interface_declaration |
| 191 | // | timeunits_declaration |
| 192 | // | nonansi_port_declaration SEMI |
| 193 | // ; |
| 194 | auto doc = commentParser.parse(ctx); |
| 195 | auto gr = ctx->generate_region(); |
| 196 | if (gr) { |
| 197 | VerGenerateParser gp(commentParser, hierarchyOnly); |
| 198 | gp.visitGenerate_region(gr, objs); |
| 199 | return; |
| 200 | } |
| 201 | auto mii = ctx->module_item_item(); |
| 202 | if (mii) { |
| 203 | auto ai = ctx->attribute_instance(); |
| 204 | VerAttributeParser::visitAttribute_instance(ai); |
| 205 | auto prev_size = objs.size(); |
| 206 | visitModule_item_item(mii, objs, m_ctx.ent.generics); |
| 207 | if (objs.size() != prev_size) { |
| 208 | iHdlObj *_last = objs[prev_size].get(); |
| 209 | auto wd = dynamic_cast<WithDoc*>(_last); |
| 210 | wd->__doc__ = doc + wd->__doc__; |
| 211 | } |
| 212 | return; |
| 213 | } |
| 214 | auto sb = ctx->specify_block(); |
| 215 | if (sb) { |
| 216 | NotImplementedLogger::print("ModuleParser.module_item.specify_block", |
| 217 | sb); |
| 218 | return; |
| 219 | } |
| 220 | auto pd = ctx->program_declaration(); |
| 221 | if (pd) { |
| 222 | NotImplementedLogger::print( |
| 223 | "ModuleParser.module_item.program_declaration", pd); |
| 224 | return; |
| 225 | } |
| 226 | auto md = ctx->module_declaration(); |
| 227 | if (md) { |
| 228 | VerModuleParser mp(commentParser, hierarchyOnly); |
| 229 | mp.visitModule_declaration(md, objs); |
| 230 | return; |
| 231 | } |
| 232 | auto id = ctx->interface_declaration(); |
| 233 | if (id) { |
| 234 | NotImplementedLogger::print( |
| 235 | "ModuleParser.module_item.interface_declaration", id); |
| 236 | return; |
| 237 | } |
| 238 | auto td = ctx->timeunits_declaration(); |
| 239 | if (td) { |
nothing calls this directly
no test coverage detected