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


Python L.import_incast方法代码示例

本文整理汇总了Python中incoq.compiler.incast.L.import_incast方法的典型用法代码示例。如果您正苦于以下问题:Python L.import_incast方法的具体用法?Python L.import_incast怎么用?Python L.import_incast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在incoq.compiler.incast.L的用法示例。


在下文中一共展示了L.import_incast方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: py_preprocess

# 需要导入模块: from incoq.compiler.incast import L [as 别名]
# 或者: from incoq.compiler.incast.L import import_incast [as 别名]
def py_preprocess(tree):
    """Take in a Python AST tree, partially preprocess it, and return
    the corresponding IncAST tree along with parsed information.
    """
    # Rewrite QUERY directives to replace their source strings with
    # the corresponding parsed Python ASTs. Provided that the other
    # preprocessing steps are functional (i.e., apply equally to
    # multiple occurrences of the same AST), this ensures that any
    # subsequent steps that modify occurrences of a query will also
    # modify its occurrence in the QUERY directive.
    tree = preprocess_query_directives(tree)

    # Admit some constructs as syntactic sugar that would otherwise
    # be excluded from IncAST.
    tree = preprocess_constructs(tree)

    # Get rid of import statement and qualifiers for the runtime
    # library.
    tree = preprocess_runtime_import(tree)

    # Get rid of main boilerplate.
    tree = preprocess_main_call(tree)

    # Get relation declarations.
    tree, decls = preprocess_var_decls(tree)

    # Get symbol info.
    tree, info = preprocess_directives(tree)

    # Convert the tree and parsed query info to IncAST.
    tree = L.import_incast(tree)
    info.query_info = [(L.import_incast(query), value) for query, value in info.query_info]

    return tree, decls, info
开发者ID:jieaozhu,项目名称:dist_lang_reviews,代码行数:36,代码来源:py_rewritings.py


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