本文整理汇总了Python中pynestml.symbols.predefined_types.PredefinedTypes.get_string_type方法的典型用法代码示例。如果您正苦于以下问题:Python PredefinedTypes.get_string_type方法的具体用法?Python PredefinedTypes.get_string_type怎么用?Python PredefinedTypes.get_string_type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pynestml.symbols.predefined_types.PredefinedTypes
的用法示例。
在下文中一共展示了PredefinedTypes.get_string_type方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: visit_simple_expression
# 需要导入模块: from pynestml.symbols.predefined_types import PredefinedTypes [as 别名]
# 或者: from pynestml.symbols.predefined_types.PredefinedTypes import get_string_type [as 别名]
def visit_simple_expression(self, node):
"""
Visits a singe simple rhs which consists of a string literal and updates the type.
:param node: a simple rhs containing a string literal
:type node: ast_simple_expression
"""
node.type = PredefinedTypes.get_string_type()
node.type.referenced_object = node
示例2: __register_logger_warning_function
# 需要导入模块: from pynestml.symbols.predefined_types import PredefinedTypes [as 别名]
# 或者: from pynestml.symbols.predefined_types.PredefinedTypes import get_string_type [as 别名]
def __register_logger_warning_function(cls):
"""
Registers the logger warning method.
"""
params = list()
params.append(PredefinedTypes.get_string_type()) # the argument
symbol = FunctionSymbol(name=cls.LOGGER_WARNING, param_types=params,
return_type=PredefinedTypes.get_void_type(),
element_reference=None, is_predefined=True)
cls.name2function[cls.LOGGER_WARNING] = symbol
示例3: __register_print_function
# 需要导入模块: from pynestml.symbols.predefined_types import PredefinedTypes [as 别名]
# 或者: from pynestml.symbols.predefined_types.PredefinedTypes import get_string_type [as 别名]
def __register_print_function(cls):
"""
Registers the print function.
"""
params = list()
params.append(PredefinedTypes.get_string_type())
symbol = FunctionSymbol(name=cls.PRINT, param_types=params,
return_type=PredefinedTypes.get_void_type(),
element_reference=None, is_predefined=True)
cls.name2function[cls.PRINT] = symbol
示例4: __register_logger_info_function
# 需要导入模块: from pynestml.symbols.predefined_types import PredefinedTypes [as 别名]
# 或者: from pynestml.symbols.predefined_types.PredefinedTypes import get_string_type [as 别名]
def __register_logger_info_function(cls):
"""
Registers the logger info method into the scope.
"""
params = list()
params.append(PredefinedTypes.get_string_type()) # the argument
symbol = FunctionSymbol(name=cls.LOGGER_INFO, param_types=params,
return_type=PredefinedTypes.get_void_type(),
element_reference=None, is_predefined=True)
cls.name2function[cls.LOGGER_INFO] = symbol
示例5: visit_data_type
# 需要导入模块: from pynestml.symbols.predefined_types import PredefinedTypes [as 别名]
# 或者: from pynestml.symbols.predefined_types.PredefinedTypes import get_string_type [as 别名]
def visit_data_type(self, node):
"""
Visits a single data type meta_model node and updates, checks correctness and updates its type symbol.
This visitor can also be used to derive the original name of the unit.
:param node: a single datatype node.
:type node: ast_data_type
"""
if node.is_integer:
self.symbol = PredefinedTypes.get_integer_type()
node.set_type_symbol(self.symbol)
elif node.is_real:
self.symbol = PredefinedTypes.get_real_type()
node.set_type_symbol(self.symbol)
elif node.is_string:
self.symbol = PredefinedTypes.get_string_type()
node.set_type_symbol(self.symbol)
elif node.is_boolean:
self.symbol = PredefinedTypes.get_boolean_type()
node.set_type_symbol(self.symbol)
elif node.is_void:
self.symbol = PredefinedTypes.get_void_type()
node.set_type_symbol(self.symbol)