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


Python spark.GenericASTBuilder类代码示例

本文整理汇总了Python中spark.GenericASTBuilder的典型用法代码示例。如果您正苦于以下问题:Python GenericASTBuilder类的具体用法?Python GenericASTBuilder怎么用?Python GenericASTBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: resolve

 def resolve(self, list):
     if len(list) == 2 and "funcdef" in list and "assign" in list:
         return "funcdef"
     if "grammar" in list and "expr" in list:
         return "expr"
     # print >> sys.stderr, 'resolve', str(list)
     return GenericASTBuilder.resolve(self, list)
开发者ID:codepainters,项目名称:uncompyle2,代码行数:7,代码来源:Parser.py

示例2: nonterminal

	def nonterminal(self, type, args):
		#
		#  Flatten AST a bit by not making nodes if there's only
		#  one child.
		#
		if len(args) == 1:
			return args[0]
		return GenericASTBuilder.nonterminal(self, type, args)
开发者ID:Nisha1990,项目名称:poly-ql,代码行数:8,代码来源:test.py

示例3: nonterminal

    def nonterminal(self, nt, args):
        collect = ("stmts", "exprlist", "kvlist", "_stmts", "print_items")

        if nt in collect and len(args) > 1:
            #
            #  Collect iterated thingies together.
            #
            rv = args[0]
            rv.append(args[1])
        else:
            rv = GenericASTBuilder.nonterminal(self, nt, args)
        return rv
开发者ID:codepainters,项目名称:uncompyle2,代码行数:12,代码来源:Parser.py

示例4: nonterminal

    def nonterminal(self, nt, args):
        collect = ('stmts', 'exprlist', 'kvlist')

        if nt in collect and len(args) > 1:
            #
            #  Collect iterated thingies together.
            #
            rv = args[0]
            rv.append(args[1])
        else:
            rv = GenericASTBuilder.nonterminal(self, nt, args)
        return rv
开发者ID:Areizen,项目名称:unpyc,代码行数:12,代码来源:Parser.py

示例5: __init__

 def __init__(self, AST, start='func_list'):
         GenericASTBuilder.__init__(self, AST, start)
开发者ID:saurabhd14,项目名称:tinyos-1.x,代码行数:2,代码来源:functions.py

示例6: nonterminal

 def nonterminal(self, type, args):
     if len(args) == 1:
         return args[0]
     return GenericASTBuilder.nonterminal(self, type, args)
开发者ID:saurabhd14,项目名称:tinyos-1.x,代码行数:4,代码来源:functions.py

示例7: __ambiguity

 def __ambiguity(self, children):
     # only for debugging! to be removed hG/2000-10-15
     print children
     return GenericASTBuilder.ambiguity(self, children)
开发者ID:codepainters,项目名称:uncompyle2,代码行数:4,代码来源:Parser.py

示例8: __init__

 def __init__(self):
     GenericASTBuilder.__init__(self, AST, "stmts")
     self.customized = {}
开发者ID:codepainters,项目名称:uncompyle2,代码行数:3,代码来源:Parser.py

示例9: __init__

	def __init__(self, AST, start='expr'):
		GenericASTBuilder.__init__(self, AST, start)
开发者ID:Nisha1990,项目名称:poly-ql,代码行数:2,代码来源:test.py

示例10: __init__

 def __init__(self, ASTclass, start='top'):
     GenericASTBuilder.__init__(self, ASTclass, start)
开发者ID:martindurant,项目名称:starclassifier,代码行数:2,代码来源:spparser.py

示例11: resolve

	def resolve(self, list):
		if len(list) == 2 and 'funcdef' in list and 'assign' in list:
			return 'funcdef'
		#sys.stderr.writelines( ['resolve ', str(list), '\n'] )
		return GenericASTBuilder.resolve(self, list)
开发者ID:Aurebesh,项目名称:moul-scripts,代码行数:5,代码来源:decompyle.py

示例12: __init__

	def __init__(self):
		GenericASTBuilder.__init__(self, AST, 'code')
		self.customized = {}
开发者ID:Aurebesh,项目名称:moul-scripts,代码行数:3,代码来源:decompyle.py

示例13: __init__

	def __init__(self):
		GenericASTBuilder.__init__(self, AST, "file")
开发者ID:pyfltk,项目名称:pyfltk,代码行数:2,代码来源:FlParser.py


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