當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。