Ejemplo n.º 1
0
    def __init__(self, node, tree):
        self.name = node.get('name')
        utils.check_name(self.name)

        self.description = xml_utils.get_description(node)
        self.id = xml_utils.get_identifier(node)

        self.parameterType = self.__get_type(node, "parameterType", tree)
        self.returnType = self.__get_type(node, "returnType", tree)
Ejemplo n.º 2
0
	def __init__(self, node, tree):
		self.name = node.get('name')
		utils.check_name(self.name)
		
		self.description = xml_utils.get_description(node)
		self.id = xml_utils.get_identifier(node)
		
		self.parameterType = self.__get_type(node, "parameterType", tree)
		self.returnType = self.__get_type(node, "returnType", tree)
Ejemplo n.º 3
0
	def evaluate(self, tree):
		""" Load values form the XML node. """
		if self.node is None:
			return
		
		self.description = xml_utils.get_description(self.node)
		self.id = xml_utils.get_identifier(self.node)
		
		extends = self.node.get('extends')
		if extends is None:
			self.extends = None
		else:
			try:
				self.extends = tree.components[extends]
			except KeyError:
				raise ParserException("Found unknown super component '%s' in component '%s'!" % (extends, self.name))
		
		# parse functions and events
		self.__parse_actions(tree)
		self.__parse_events(tree)
		
		self.node = None
Ejemplo n.º 4
0
	def __init__(self, node, tree):
		""" Constructor
		
		Keyword arguments:
		node	--	XML node defining this event
		tree	--	currently evaluted communication structure tree
		"""
		self.name = node.get('name')
		utils.check_name(self.name)
		
		self.id = xml_utils.get_identifier(node)
		self.description = xml_utils.get_description(node)
		self.rate = node.get('rate')
		
		type = node.get('type')
		if type is None:
			self.type = None
		else:
			try:
				self.type = tree.types[type]
			except KeyError as e:
				raise ParserException("Type '%s' is not defined. Used by Event '%s')" % (type, self.name))
Ejemplo n.º 5
0
    def evaluate(self, tree):
        """ Load values form the XML node. """
        if self.node is None:
            return

        self.description = xml_utils.get_description(self.node)
        self.id = xml_utils.get_identifier(self.node)

        extends = self.node.get('extends')
        if extends is None:
            self.extends = None
        else:
            try:
                self.extends = tree.components[extends]
            except KeyError:
                raise ParserException(
                    "Found unknown super component '%s' in component '%s'!" %
                    (extends, self.name))

        # parse functions and events
        self.__parse_actions(tree)
        self.__parse_events(tree)

        self.node = None
Ejemplo n.º 6
0
    def __init__(self, node, tree):
        """ Constructor
		
		Keyword arguments:
		node	--	XML node defining this event
		tree	--	currently evaluted communication structure tree
		"""
        self.name = node.get('name')
        utils.check_name(self.name)

        self.id = xml_utils.get_identifier(node)
        self.description = xml_utils.get_description(node)
        self.rate = node.get('rate')

        type = node.get('type')
        if type is None:
            self.type = None
        else:
            try:
                self.type = tree.types[type]
            except KeyError as e:
                raise ParserException(
                    "Type '%s' is not defined. Used by Event '%s')" %
                    (type, self.name))