コード例 #1
0
 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)
コード例 #2
0
ファイル: test.py プロジェクト: Nisha1990/poly-ql
	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)
コード例 #3
0
ファイル: Parser.py プロジェクト: NuruTasDemir/Pyc2Py-Symbian
	def nonterminal(self, nt, args):
		collect = ('stmts', 'exprlist', 'kvlist')
		if nt in collect and len(args) > 1:
			rv = args[0]
			rv.append(args[1])
		else:
			rv = GenericASTBuilder.nonterminal(self, nt, args)
		return rv
コード例 #4
0
    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
コード例 #5
0
ファイル: Parser.py プロジェクト: codepainters/uncompyle2
    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
コード例 #6
0
ファイル: Parser.py プロジェクト: Areizen/unpyc
    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
コード例 #7
0
ファイル: functions.py プロジェクト: saurabhd14/tinyos-1.x
 def nonterminal(self, type, args):
     if len(args) == 1:
         return args[0]
     return GenericASTBuilder.nonterminal(self, type, args)