Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(51)  |  Call(51)  |  Derive(0)  |  Import(0)
main method of the visitor

src/f/p/fp.py-HEAD/visitors.py   fp.py(Download)
	def visit_ProgramNode(self, node):
		for c in node.combinators():
			self.visit(c)
 
	def visit_CombinatorNode(self, node):
		print node.name(),
		for p in node.parameters():
			print str(p),
		print '=',
		self.visit(node.body())
	def visit_LetNode(self, node):
		print 'let',
		for definition in node.children[0:-1]:
			self.visit(definition)
		print 'in',
		self.visit(node.children[-1])
	def visit_LetRecNode(self, node):
		print 'letrec',
		for definition in node.children[0:-1]:
			self.visit(definition)
		print 'in',

src/f/p/fp.py-HEAD/transforms.py   fp.py(Download)
	def visit_CombinatorNode(self, node, **data):
		for p in node.parameters():
			self.bound[str(p)] = True
		self.visit(node.body(), **data)
 
	def visit_LetNode(self, node, **data):
		for d in node.definitions():
			self.bound[d.name()] = True
			self.visit(d.body(), **data)
		self.visit(node.body(), **data)
	def visit_LetRecNode(self, node, **data):
		for d in node.definitions():
			self.bound[d.name()] = True
			self.visit(d.body(), **data)
		self.visit(node.body(), **data)