Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Member Functions
asdl.VisitorBase Class Reference
Inheritance diagram for asdl.VisitorBase:
Inheritance graph
[legend]
Collaboration diagram for asdl.VisitorBase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def visit

Public Attributes

 cache
 skip
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Private Member Functions

def _dispatch

Detailed Description

Definition at line 313 of file asdl.py.


Constructor & Destructor Documentation

def asdl.VisitorBase.__init__ (   self,
  skip = False 
)

Reimplemented in asdl_c.EmitVisitor.

Definition at line 315 of file asdl.py.

00315 
00316     def __init__(self, skip=False):
00317         self.cache = {}
00318         self.skip = skip

Here is the caller graph for this function:


Member Function Documentation

def asdl.VisitorBase._dispatch (   self,
  object 
) [private]

Definition at line 334 of file asdl.py.

00334 
00335     def _dispatch(self, object):
00336         assert isinstance(object, AST), repr(object)
00337         klass = object.__class__
00338         meth = self.cache.get(klass)
00339         if meth is None:
00340             methname = "visit" + klass.__name__
00341             if self.skip:
00342                 meth = getattr(self, methname, None)
00343             else:
00344                 meth = getattr(self, methname)
00345             self.cache[klass] = meth
00346         return meth

Here is the call graph for this function:

Here is the caller graph for this function:

def asdl.VisitorBase.visit (   self,
  object,
  args 
)

Definition at line 319 of file asdl.py.

00319 
00320     def visit(self, object, *args):
00321         meth = self._dispatch(object)
00322         if meth is None:
00323             return
00324         try:
00325             meth(object, *args)
00326         except Exception:
00327             output("Error visiting" + repr(object))
00328             output(str(sys.exc_info()[1]))
00329             traceback.print_exc()
00330             # XXX hack
00331             if hasattr(self, 'file'):
00332                 self.file.flush()
00333             os._exit(1)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 316 of file asdl.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 317 of file asdl.py.


The documentation for this class was generated from the following file: