Ejemplo n.º 1
0
    def __unique_name__(self, symbol_node: jcmuta.SymbolNode):
        """
		:param symbol_node: the node of which unique name is created
		:return: the unique name of the symbol_node
		"""
        class_name = symbol_node.get_class_name()
        class_id = symbol_node.get_class_id()
        class_flag = 'p'
        if class_id < 0:
            class_id = abs(class_id)
            class_flag = 'n'
        return self.__naming__.format(class_name, class_flag, class_id)
Ejemplo n.º 2
0
 def __parse_call_expression__(self, symbol_node: jcmuta.SymbolNode):
     function = symbol_node.get_child(0)
     if function.get_class_name() == "Identifier":
         func_name = function.get_content().get_token_value()
     else:
         func_name = self.__new_default_name__(function)
     arguments = symbol_node.get_child(1).get_children()
     for k in range(0, len(arguments)):
         arg = self.__parse__(arguments[k])
         self.__save__("{}#{}".format(func_name, k), arg)
     return self.__parse_by_name__(
         "{}_{}".format(func_name, symbol_node.get_class_id()),
         symbol_node.get_data_type())
Ejemplo n.º 3
0
 def __new_default_name__(self, symbol_node: jcmuta.SymbolNode):
     self.__assume__(None)
     return "{}_{}".format(symbol_node.get_class_name(),
                           abs(symbol_node.get_class_id()))