本文整理匯總了Python中clang.cindex.CursorKind.FUNCTION_TEMPLATE屬性的典型用法代碼示例。如果您正苦於以下問題:Python CursorKind.FUNCTION_TEMPLATE屬性的具體用法?Python CursorKind.FUNCTION_TEMPLATE怎麽用?Python CursorKind.FUNCTION_TEMPLATE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類clang.cindex.CursorKind
的用法示例。
在下文中一共展示了CursorKind.FUNCTION_TEMPLATE屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: show_info
# 需要導入模塊: from clang.cindex import CursorKind [as 別名]
# 或者: from clang.cindex.CursorKind import FUNCTION_TEMPLATE [as 別名]
def show_info(node, xfiles, xprefs, cur_fun=None):
if node.kind == CursorKind.FUNCTION_TEMPLATE:
if not is_excluded(node, xfiles, xprefs):
cur_fun = node
FULLNAMES[fully_qualified(cur_fun)].add(
fully_qualified_pretty(cur_fun))
if node.kind == CursorKind.CXX_METHOD or \
node.kind == CursorKind.FUNCTION_DECL:
if not is_excluded(node, xfiles, xprefs):
cur_fun = node
FULLNAMES[fully_qualified(cur_fun)].add(
fully_qualified_pretty(cur_fun))
if node.kind == CursorKind.CALL_EXPR:
if node.referenced and not is_excluded(node.referenced, xfiles, xprefs):
CALLGRAPH[fully_qualified_pretty(cur_fun)].append(node.referenced)
for c in node.get_children():
show_info(c, xfiles, xprefs, cur_fun)
示例2: read_cursor
# 需要導入模塊: from clang.cindex import CursorKind [as 別名]
# 或者: from clang.cindex.CursorKind import FUNCTION_TEMPLATE [as 別名]
def read_cursor(asg, cursor, scope):
if cursor.kind is CursorKind.UNEXPOSED_DECL:
if cursor.spelling == '':
children = []
for child in cursor.get_children():
children.extend(read_cursor(asg, child, scope))
return children
else:
warnings.warn('Named unexposed cursor not read')
return []
elif cursor.kind is CursorKind.TYPEDEF_DECL:
return read_typedef(asg, cursor, scope)
elif cursor.kind in [CursorKind.VAR_DECL, CursorKind.PARM_DECL]:
return read_variable(asg, cursor, scope)
elif cursor.kind in [CursorKind.FUNCTION_DECL, CursorKind.CXX_METHOD,
CursorKind.DESTRUCTOR, CursorKind.CONSTRUCTOR]:
return read_function(asg, cursor, scope)
elif cursor.kind is CursorKind.FIELD_DECL:
return read_field(asg, cursor, scope)
elif cursor.kind in [CursorKind.ENUM_DECL, CursorKind.STRUCT_DECL,
CursorKind.UNION_DECL, CursorKind.CLASS_DECL]:
return read_tag(asg, cursor, scope)
elif cursor.kind is CursorKind.NAMESPACE:
return read_namespace(asg, cursor, scope)
elif cursor.kind in [CursorKind.NAMESPACE_ALIAS, CursorKind.FUNCTION_TEMPLATE,
CursorKind.USING_DECLARATION, CursorKind.USING_DIRECTIVE,
CursorKind.UNEXPOSED_ATTR, CursorKind.CLASS_TEMPLATE,
CursorKind.CLASS_TEMPLATE_PARTIAL_SPECIALIZATION,
CursorKind.CXX_ACCESS_SPEC_DECL, CursorKind.CONVERSION_FUNCTION]:
return []
else:
warnings.warn('Undefined behaviour for \'' + str(cursor.kind) + '\' cursor')
return []