예제 #1
0
 def accept(self, node, memo):
     """ Accept a node, possibly creating a child visitor. """
     tokType = tokens.map.get(node.token.type)
     missing = lambda node, memo:self
     call = getattr(self, 'accept{0}'.format(tokens.title(tokType)), missing)
     if call is missing:
         debug('no visitor accept method for %s', tokType)
     return call(node, memo)
예제 #2
0
    def accept(self, node, memo):
	""" Accept a node, possibly creating a child visitor. """
	tokType = tokens.map.get(node.token.type)
	missing = lambda node, memo:self
	call = getattr(self, 'accept{0}'.format(tokens.title(tokType)), missing)
	if call is missing:
	    debug('no visitor accept method for %s', tokType)
        return call(node, memo)