当前位置: 首页>>代码示例>>Python>>正文


Python CursorKind.FUNCTION_TEMPLATE属性代码示例

本文整理汇总了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) 
开发者ID:Vermeille,项目名称:clang-callgraph,代码行数:22,代码来源:clang-callgraph.py

示例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 [] 
开发者ID:StatisKit,项目名称:AutoWIG,代码行数:35,代码来源:libclang_parser.py


注:本文中的clang.cindex.CursorKind.FUNCTION_TEMPLATE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。