code: def visitComponent_def(self, ctx:SystemRDLParser.Component_defContext):
          
  
          # Get definition. Returns Component
          if ctx.component_anon_def() is not None:
              comp_def = self.visit(ctx.component_anon_def())
          elif ctx.component_named_def() is not None:
              comp_def = self.visit(ctx.component_named_def())
          else:
              raise RuntimeError
  
          comp_def.parent_scope = self.component
  
          if ctx.component_insts() is not None:
              if isinstance(self, RootVisitor) and isinstance(comp_def, comp.Addrmap):
                  self.msg.warning(
                      "Non-standard instantiation of an addrmap in root namespace will be ignored",
                      SourceRef.from_antlr(ctx.component_insts().component_inst(0).ID())
                  )
              else:
                  # Component is instantiated one or more times
                  if ctx.component_inst_type() is not None:
                      inst_type = self.visit(ctx.component_inst_type())
                  else:
                      inst_type = None
  
                  # Pass some temporary info to visitComponent_insts
                  self._tmp = (comp_def, inst_type, None)
                  self.visit(ctx.component_insts())
  
          return None
docs: Create, and possibly instantiate a component