[pypy-svn] r20833 - pypy/dist/pypy/interpreter/astcompiler

adim at codespeak.net adim at codespeak.net
Wed Dec 7 16:09:17 CET 2005


Author: adim
Date: Wed Dec  7 16:09:09 2005
New Revision: 20833

Modified:
   pypy/dist/pypy/interpreter/astcompiler/ast.py
Log:
forgot to checkin regenerated ast.py

Modified: pypy/dist/pypy/interpreter/astcompiler/ast.py
==============================================================================
--- pypy/dist/pypy/interpreter/astcompiler/ast.py	(original)
+++ pypy/dist/pypy/interpreter/astcompiler/ast.py	Wed Dec  7 16:09:09 2005
@@ -1,9 +1,13 @@
+
 """Python abstract syntax node definitions
 
 This file is automatically generated by Tools/compiler/astgen.py
 """
 from consts import CO_VARARGS, CO_VARKEYWORDS, OP_ASSIGN
 from pypy.interpreter.baseobjspace import Wrappable
+from pypy.interpreter.typedef import TypeDef
+from pypy.interpreter.gateway import interp2app
+from pypy.interpreter.argument import Arguments
 
 def flatten(list):
     l = []
@@ -49,6 +53,28 @@
             res.append( self )
         return res
 
+    def __repr__(self):
+	return "Node()"
+
+    def descr_repr( self, space ):
+	return space.wrap( self.__repr__() )
+
+def descr_node_repr( space, w_obj ):
+    return w_obj.descr_repr( space )
+    
+def descr_getChildNodes( space, w_obj ):
+    lst = w_obj.getChildNodes()
+    return space.newlist( lst )
+
+def descr_accept( space, w_obj, w_visitor ):
+    return w_obj.descr_accept( space, w_visitor )
+
+Node.typedef = TypeDef('ASTNode',
+		       __repr__ = interp2app(descr_node_repr),
+		       getChildNodes = interp2app(descr_getChildNodes),
+		       accept = interp2app(descr_accept),
+		       )
+
         
 class EmptyNode(Node):
     def accept(self, visitor):
@@ -73,6 +99,8 @@
     def accept(self, visitor):
         return visitor.visitExpression(self)
 
+
+
 class AbstractFunction(Node):
     def __init__(self, lineno=-1):
         Node.__init__(self, lineno)
@@ -90,6 +118,11 @@
     def accept(self, visitor):
         return visitor.visitAbstractFunction(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitAbstractFunction'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class AbstractTest(Node):
     def __init__(self, lineno=-1):
         Node.__init__(self, lineno)
@@ -107,6 +140,11 @@
     def accept(self, visitor):
         return visitor.visitAbstractTest(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitAbstractTest'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class BinaryOp(Node):
     def __init__(self, lineno=-1):
         Node.__init__(self, lineno)
@@ -124,6 +162,11 @@
     def accept(self, visitor):
         return visitor.visitBinaryOp(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitBinaryOp'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Add(BinaryOp):
     def __init__(self, (left, right), lineno=-1):
         Node.__init__(self, lineno)
@@ -143,6 +186,11 @@
     def accept(self, visitor):
         return visitor.visitAdd(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitAdd'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class And(AbstractTest):
     def __init__(self, nodes, lineno=-1):
         Node.__init__(self, lineno)
@@ -163,6 +211,11 @@
     def accept(self, visitor):
         return visitor.visitAnd(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitAnd'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class AssAttr(Node):
     def __init__(self, expr, attrname, flags, lineno=-1):
         Node.__init__(self, lineno)
@@ -183,6 +236,11 @@
     def accept(self, visitor):
         return visitor.visitAssAttr(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitAssAttr'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class AssSeq(Node):
     def __init__(self, lineno=-1):
         Node.__init__(self, lineno)
@@ -200,6 +258,11 @@
     def accept(self, visitor):
         return visitor.visitAssSeq(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitAssSeq'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class AssList(AssSeq):
     def __init__(self, nodes, lineno=-1):
         Node.__init__(self, lineno)
@@ -220,6 +283,11 @@
     def accept(self, visitor):
         return visitor.visitAssList(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitAssList'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class AssName(Node):
     def __init__(self, name, flags, lineno=-1):
         Node.__init__(self, lineno)
@@ -239,6 +307,11 @@
     def accept(self, visitor):
         return visitor.visitAssName(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitAssName'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class AssTuple(AssSeq):
     def __init__(self, nodes, lineno=-1):
         Node.__init__(self, lineno)
@@ -272,6 +345,11 @@
     def accept(self, visitor):
         return visitor.visitAssTuple(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitAssTuple'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Assert(Node):
     def __init__(self, test, fail, lineno=-1):
         Node.__init__(self, lineno)
@@ -298,6 +376,11 @@
     def accept(self, visitor):
         return visitor.visitAssert(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitAssert'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Assign(Node):
     def __init__(self, nodes, expr, lineno=-1):
         Node.__init__(self, lineno)
@@ -323,6 +406,11 @@
     def accept(self, visitor):
         return visitor.visitAssign(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitAssign'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class AugAssign(Node):
     def __init__(self, node, op, expr, lineno=-1):
         Node.__init__(self, lineno)
@@ -343,6 +431,11 @@
     def accept(self, visitor):
         return visitor.visitAugAssign(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitAugAssign'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class UnaryOp(Node):
     def __init__(self, lineno=-1):
         Node.__init__(self, lineno)
@@ -360,6 +453,11 @@
     def accept(self, visitor):
         return visitor.visitUnaryOp(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitUnaryOp'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Backquote(UnaryOp):
     def __init__(self, expr, lineno=-1):
         Node.__init__(self, lineno)
@@ -378,6 +476,11 @@
     def accept(self, visitor):
         return visitor.visitBackquote(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitBackquote'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class BitOp(Node):
     def __init__(self, lineno=-1):
         Node.__init__(self, lineno)
@@ -395,6 +498,11 @@
     def accept(self, visitor):
         return visitor.visitBitOp(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitBitOp'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Bitand(BitOp):
     def __init__(self, nodes, lineno=-1):
         Node.__init__(self, lineno)
@@ -415,6 +523,11 @@
     def accept(self, visitor):
         return visitor.visitBitand(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitBitand'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Bitor(BitOp):
     def __init__(self, nodes, lineno=-1):
         Node.__init__(self, lineno)
@@ -435,6 +548,11 @@
     def accept(self, visitor):
         return visitor.visitBitor(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitBitor'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Bitxor(BitOp):
     def __init__(self, nodes, lineno=-1):
         Node.__init__(self, lineno)
@@ -455,6 +573,11 @@
     def accept(self, visitor):
         return visitor.visitBitxor(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitBitxor'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Break(Node):
     def __init__(self, lineno=-1):
         Node.__init__(self, lineno)
@@ -472,6 +595,11 @@
     def accept(self, visitor):
         return visitor.visitBreak(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitBreak'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class CallFunc(Node):
     def __init__(self, node, args, star_args = None, dstar_args = None, lineno=-1):
         Node.__init__(self, lineno)
@@ -505,6 +633,11 @@
     def accept(self, visitor):
         return visitor.visitCallFunc(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitCallFunc'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Class(Node):
     def __init__(self, name, bases, doc, code, lineno=-1):
         Node.__init__(self, lineno)
@@ -534,6 +667,11 @@
     def accept(self, visitor):
         return visitor.visitClass(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitClass'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Compare(Node):
     def __init__(self, expr, ops, lineno=-1):
         Node.__init__(self, lineno)
@@ -562,6 +700,11 @@
     def accept(self, visitor):
         return visitor.visitCompare(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitCompare'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Const(Node):
     def __init__(self, value, lineno=-1):
         Node.__init__(self, lineno)
@@ -580,6 +723,11 @@
     def accept(self, visitor):
         return visitor.visitConst(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitConst'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Continue(Node):
     def __init__(self, lineno=-1):
         Node.__init__(self, lineno)
@@ -597,6 +745,11 @@
     def accept(self, visitor):
         return visitor.visitContinue(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitContinue'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Decorators(Node):
     def __init__(self, nodes, lineno=-1):
         Node.__init__(self, lineno)
@@ -617,6 +770,11 @@
     def accept(self, visitor):
         return visitor.visitDecorators(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitDecorators'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Dict(Node):
     def __init__(self, items, lineno=-1):
         Node.__init__(self, lineno)
@@ -641,6 +799,11 @@
     def accept(self, visitor):
         return visitor.visitDict(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitDict'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Discard(Node):
     def __init__(self, expr, lineno=-1):
         Node.__init__(self, lineno)
@@ -659,6 +822,11 @@
     def accept(self, visitor):
         return visitor.visitDiscard(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitDiscard'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Div(BinaryOp):
     def __init__(self, (left, right), lineno=-1):
         Node.__init__(self, lineno)
@@ -678,6 +846,11 @@
     def accept(self, visitor):
         return visitor.visitDiv(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitDiv'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Ellipsis(Node):
     def __init__(self, lineno=-1):
         Node.__init__(self, lineno)
@@ -695,6 +868,11 @@
     def accept(self, visitor):
         return visitor.visitEllipsis(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitEllipsis'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Exec(Node):
     def __init__(self, expr, locals, globals, lineno=-1):
         Node.__init__(self, lineno)
@@ -725,6 +903,11 @@
     def accept(self, visitor):
         return visitor.visitExec(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitExec'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class FloorDiv(BinaryOp):
     def __init__(self, (left, right), lineno=-1):
         Node.__init__(self, lineno)
@@ -744,6 +927,11 @@
     def accept(self, visitor):
         return visitor.visitFloorDiv(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitFloorDiv'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class For(Node):
     def __init__(self, assign, list, body, else_, lineno=-1):
         Node.__init__(self, lineno)
@@ -776,6 +964,11 @@
     def accept(self, visitor):
         return visitor.visitFor(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitFor'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class From(Node):
     def __init__(self, modname, names, lineno=-1):
         Node.__init__(self, lineno)
@@ -795,6 +988,11 @@
     def accept(self, visitor):
         return visitor.visitFrom(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitFrom'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Function(AbstractFunction):
     def __init__(self, decorators, name, argnames, defaults, flags, doc, code, lineno=-1):
         Node.__init__(self, lineno)
@@ -839,6 +1037,11 @@
     def accept(self, visitor):
         return visitor.visitFunction(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitFunction'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class GenExpr(AbstractFunction):
     def __init__(self, code, lineno=-1):
         Node.__init__(self, lineno)
@@ -861,6 +1064,11 @@
     def accept(self, visitor):
         return visitor.visitGenExpr(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitGenExpr'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class GenExprFor(Node):
     def __init__(self, assign, iter, ifs, lineno=-1):
         Node.__init__(self, lineno)
@@ -892,6 +1100,11 @@
     def accept(self, visitor):
         return visitor.visitGenExprFor(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitGenExprFor'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class GenExprIf(Node):
     def __init__(self, test, lineno=-1):
         Node.__init__(self, lineno)
@@ -910,6 +1123,11 @@
     def accept(self, visitor):
         return visitor.visitGenExprIf(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitGenExprIf'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class GenExprInner(Node):
     def __init__(self, expr, quals, lineno=-1):
         Node.__init__(self, lineno)
@@ -935,6 +1153,11 @@
     def accept(self, visitor):
         return visitor.visitGenExprInner(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitGenExprInner'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Getattr(Node):
     def __init__(self, expr, attrname, lineno=-1):
         Node.__init__(self, lineno)
@@ -954,6 +1177,11 @@
     def accept(self, visitor):
         return visitor.visitGetattr(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitGetattr'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Global(Node):
     def __init__(self, names, lineno=-1):
         Node.__init__(self, lineno)
@@ -972,6 +1200,11 @@
     def accept(self, visitor):
         return visitor.visitGlobal(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitGlobal'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class If(Node):
     def __init__(self, tests, else_, lineno=-1):
         Node.__init__(self, lineno)
@@ -1002,6 +1235,11 @@
     def accept(self, visitor):
         return visitor.visitIf(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitIf'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Import(Node):
     def __init__(self, names, lineno=-1):
         Node.__init__(self, lineno)
@@ -1020,6 +1258,11 @@
     def accept(self, visitor):
         return visitor.visitImport(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitImport'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Invert(UnaryOp):
     def __init__(self, expr, lineno=-1):
         Node.__init__(self, lineno)
@@ -1038,6 +1281,11 @@
     def accept(self, visitor):
         return visitor.visitInvert(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitInvert'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Keyword(Node):
     def __init__(self, name, expr, lineno=-1):
         Node.__init__(self, lineno)
@@ -1057,6 +1305,11 @@
     def accept(self, visitor):
         return visitor.visitKeyword(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitKeyword'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Lambda(AbstractFunction):
     def __init__(self, argnames, defaults, flags, code, lineno=-1):
         Node.__init__(self, lineno)
@@ -1093,6 +1346,11 @@
     def accept(self, visitor):
         return visitor.visitLambda(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitLambda'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class LeftShift(BinaryOp):
     def __init__(self, (left, right), lineno=-1):
         Node.__init__(self, lineno)
@@ -1112,6 +1370,11 @@
     def accept(self, visitor):
         return visitor.visitLeftShift(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitLeftShift'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class List(Node):
     def __init__(self, nodes, lineno=-1):
         Node.__init__(self, lineno)
@@ -1132,6 +1395,11 @@
     def accept(self, visitor):
         return visitor.visitList(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitList'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class ListComp(Node):
     def __init__(self, expr, quals, lineno=-1):
         Node.__init__(self, lineno)
@@ -1157,6 +1425,11 @@
     def accept(self, visitor):
         return visitor.visitListComp(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitListComp'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class ListCompFor(Node):
     def __init__(self, assign, list, ifs, lineno=-1):
         Node.__init__(self, lineno)
@@ -1185,6 +1458,11 @@
     def accept(self, visitor):
         return visitor.visitListCompFor(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitListCompFor'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class ListCompIf(Node):
     def __init__(self, test, lineno=-1):
         Node.__init__(self, lineno)
@@ -1203,6 +1481,11 @@
     def accept(self, visitor):
         return visitor.visitListCompIf(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitListCompIf'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Mod(BinaryOp):
     def __init__(self, (left, right), lineno=-1):
         Node.__init__(self, lineno)
@@ -1222,6 +1505,11 @@
     def accept(self, visitor):
         return visitor.visitMod(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitMod'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Module(Node):
     def __init__(self, doc, node, lineno=-1):
         Node.__init__(self, lineno)
@@ -1241,6 +1529,11 @@
     def accept(self, visitor):
         return visitor.visitModule(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitModule'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Mul(BinaryOp):
     def __init__(self, (left, right), lineno=-1):
         Node.__init__(self, lineno)
@@ -1260,6 +1553,11 @@
     def accept(self, visitor):
         return visitor.visitMul(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitMul'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Name(Node):
     def __init__(self, varname, lineno=-1):
         Node.__init__(self, lineno)
@@ -1278,6 +1576,11 @@
     def accept(self, visitor):
         return visitor.visitName(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitName'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class NoneConst(Node):
     def __init__(self, lineno=-1):
         Node.__init__(self, lineno)
@@ -1295,6 +1598,11 @@
     def accept(self, visitor):
         return visitor.visitNoneConst(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitNoneConst'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Not(UnaryOp):
     def __init__(self, expr, lineno=-1):
         Node.__init__(self, lineno)
@@ -1313,6 +1621,11 @@
     def accept(self, visitor):
         return visitor.visitNot(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitNot'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class NumberConst(Node):
     def __init__(self, number_value, lineno=-1):
         Node.__init__(self, lineno)
@@ -1331,6 +1644,11 @@
     def accept(self, visitor):
         return visitor.visitNumberConst(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitNumberConst'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Or(AbstractTest):
     def __init__(self, nodes, lineno=-1):
         Node.__init__(self, lineno)
@@ -1351,6 +1669,11 @@
     def accept(self, visitor):
         return visitor.visitOr(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitOr'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Pass(Node):
     def __init__(self, lineno=-1):
         Node.__init__(self, lineno)
@@ -1368,6 +1691,11 @@
     def accept(self, visitor):
         return visitor.visitPass(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitPass'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Power(BinaryOp):
     def __init__(self, (left, right), lineno=-1):
         Node.__init__(self, lineno)
@@ -1387,6 +1715,11 @@
     def accept(self, visitor):
         return visitor.visitPower(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitPower'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Print(Node):
     def __init__(self, nodes, dest, lineno=-1):
         Node.__init__(self, lineno)
@@ -1413,6 +1746,11 @@
     def accept(self, visitor):
         return visitor.visitPrint(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitPrint'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Printnl(Node):
     def __init__(self, nodes, dest, lineno=-1):
         Node.__init__(self, lineno)
@@ -1439,6 +1777,11 @@
     def accept(self, visitor):
         return visitor.visitPrintnl(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitPrintnl'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Raise(Node):
     def __init__(self, expr1, expr2, expr3, lineno=-1):
         Node.__init__(self, lineno)
@@ -1470,6 +1813,11 @@
     def accept(self, visitor):
         return visitor.visitRaise(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitRaise'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Return(Node):
     def __init__(self, value, lineno=-1):
         Node.__init__(self, lineno)
@@ -1491,6 +1839,11 @@
     def accept(self, visitor):
         return visitor.visitReturn(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitReturn'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class RightShift(BinaryOp):
     def __init__(self, (left, right), lineno=-1):
         Node.__init__(self, lineno)
@@ -1510,6 +1863,11 @@
     def accept(self, visitor):
         return visitor.visitRightShift(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitRightShift'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Slice(Node):
     def __init__(self, expr, flags, lower, upper, lineno=-1):
         Node.__init__(self, lineno)
@@ -1542,6 +1900,11 @@
     def accept(self, visitor):
         return visitor.visitSlice(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitSlice'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Sliceobj(Node):
     def __init__(self, nodes, lineno=-1):
         Node.__init__(self, lineno)
@@ -1562,6 +1925,11 @@
     def accept(self, visitor):
         return visitor.visitSliceobj(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitSliceobj'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Stmt(Node):
     def __init__(self, nodes, lineno=-1):
         Node.__init__(self, lineno)
@@ -1582,6 +1950,11 @@
     def accept(self, visitor):
         return visitor.visitStmt(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitStmt'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class StringConst(Node):
     def __init__(self, string_value, lineno=-1):
         Node.__init__(self, lineno)
@@ -1600,6 +1973,11 @@
     def accept(self, visitor):
         return visitor.visitStringConst(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitStringConst'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Sub(BinaryOp):
     def __init__(self, (left, right), lineno=-1):
         Node.__init__(self, lineno)
@@ -1619,6 +1997,11 @@
     def accept(self, visitor):
         return visitor.visitSub(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitSub'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Subscript(Node):
     def __init__(self, expr, flags, subs, lineno=-1):
         Node.__init__(self, lineno)
@@ -1646,6 +2029,11 @@
     def accept(self, visitor):
         return visitor.visitSubscript(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitSubscript'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class TryExcept(Node):
     def __init__(self, body, handlers, else_, lineno=-1):
         Node.__init__(self, lineno)
@@ -1683,6 +2071,11 @@
     def accept(self, visitor):
         return visitor.visitTryExcept(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitTryExcept'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class TryFinally(Node):
     def __init__(self, body, final, lineno=-1):
         Node.__init__(self, lineno)
@@ -1702,6 +2095,11 @@
     def accept(self, visitor):
         return visitor.visitTryFinally(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitTryFinally'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Tuple(Node):
     def __init__(self, nodes, lineno=-1):
         Node.__init__(self, lineno)
@@ -1722,6 +2120,11 @@
     def accept(self, visitor):
         return visitor.visitTuple(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitTuple'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class UnaryAdd(UnaryOp):
     def __init__(self, expr, lineno=-1):
         Node.__init__(self, lineno)
@@ -1740,6 +2143,11 @@
     def accept(self, visitor):
         return visitor.visitUnaryAdd(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitUnaryAdd'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class UnarySub(UnaryOp):
     def __init__(self, expr, lineno=-1):
         Node.__init__(self, lineno)
@@ -1758,6 +2166,11 @@
     def accept(self, visitor):
         return visitor.visitUnarySub(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitUnarySub'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class While(Node):
     def __init__(self, test, body, else_, lineno=-1):
         Node.__init__(self, lineno)
@@ -1787,6 +2200,11 @@
     def accept(self, visitor):
         return visitor.visitWhile(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitWhile'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 class Yield(Node):
     def __init__(self, value, lineno=-1):
         Node.__init__(self, lineno)
@@ -1805,6 +2223,11 @@
     def accept(self, visitor):
         return visitor.visitYield(self)
 
+    def descr_accept(self, space, w_visitor):
+        w_callable = space.getattr(w_visitor, space.wrap('visitYield'))
+        args = Arguments(space, [ self ])
+        return space.call_args(w_callable, args)
+
 
 class ASTVisitor(object):
     """This is a visitor base class used to provide the visit
@@ -1982,6 +2405,8 @@
     def visitYield(self, node):
         return self.default( node )
 
+
 for name, obj in globals().items():
     if isinstance(obj, type) and issubclass(obj, Node):
         nodes[name.lower()] = obj
+



More information about the Pypy-commit mailing list