Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
spark.GenericASTTraversal Class Reference

List of all members.

Public Member Functions

def __init__
def typestring
def prune
def preorder
def postorder
def default

Public Attributes

 ast

Detailed Description

Definition at line 733 of file spark.py.


Constructor & Destructor Documentation

def spark.GenericASTTraversal.__init__ (   self,
  ast 
)

Definition at line 734 of file spark.py.

00734 
00735     def __init__(self, ast):
00736         self.ast = ast

Here is the caller graph for this function:


Member Function Documentation

def spark.GenericASTTraversal.default (   self,
  node 
)

Definition at line 780 of file spark.py.

00780 
00781     def default(self, node):
00782         pass
00783 
00784 #
00785 #  GenericASTMatcher.  AST nodes must have "__getitem__" and "__cmp__"
00786 #  implemented.
00787 #
00788 #  XXX - makes assumptions about how GenericParser walks the parse tree.
00789 #

Here is the caller graph for this function:

def spark.GenericASTTraversal.postorder (   self,
  node = None 
)

Definition at line 765 of file spark.py.

00765 
00766     def postorder(self, node=None):
00767         if node is None:
00768             node = self.ast
00769 
00770         for kid in node:
00771             self.postorder(kid)
00772 
00773         name = 'n_' + self.typestring(node)
00774         if hasattr(self, name):
00775             func = getattr(self, name)
00776             func(node)
00777         else:
00778             self.default(node)
00779 

Here is the call graph for this function:

Here is the caller graph for this function:

def spark.GenericASTTraversal.preorder (   self,
  node = None 
)

Definition at line 743 of file spark.py.

00743 
00744     def preorder(self, node=None):
00745         if node is None:
00746             node = self.ast
00747 
00748         try:
00749             name = 'n_' + self.typestring(node)
00750             if hasattr(self, name):
00751                 func = getattr(self, name)
00752                 func(node)
00753             else:
00754                 self.default(node)
00755         except GenericASTTraversalPruningException:
00756             return
00757 
00758         for kid in node:
00759             self.preorder(kid)
00760 
00761         name = name + '_exit'
00762         if hasattr(self, name):
00763             func = getattr(self, name)
00764             func(node)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 740 of file spark.py.

00740 
00741     def prune(self):
00742         raise GenericASTTraversalPruningException

def spark.GenericASTTraversal.typestring (   self,
  node 
)

Definition at line 737 of file spark.py.

00737 
00738     def typestring(self, node):
00739         return node.type

Here is the caller graph for this function:


Member Data Documentation

Definition at line 735 of file spark.py.


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