def p_link(self, p): """link : real_outport GT void | void GT real_inport_list | real_outport GT inport_list | implicit_outport GT inport_list | internal_outport GT inport_list""" p[0] = ast.Link(outport=p[1], inport=p[3], debug_info=self.debug_info(p, 1))
def visit(self, node): link = node.parent block = link.parent for inport in node.children: new_link = ast.Link(outport=link.outport.clone(), inport=inport) block.add_child(new_link) link.delete()
def visit(self, node): # std.Constantify(constant) ports: in/out args = [ast.NamedArg(ident=ast.Id(ident='constant'), arg=node.value)] if node.label: transform_name = node.label.ident else: # Create a unique name if not given by label self.counter += 1 transform_name = '_transform_'+str(self.counter) transform_actor = ast.Assignment(ident=transform_name, actor_type='std.Constantify', args=args) transform_actor.debug_info = node.value.debug_info transform_actor_outport = ast.OutPort(actor=transform_name, port='out') transform_actor_inport = ast.InPort(actor=transform_name, port='in') link = node.parent block = link.parent block.add_child(transform_actor) new_link = ast.Link(outport=transform_actor_outport, inport=node.port) block.add_child(new_link) link.inport = transform_actor_inport