view python/c3/astprinter.py @ 279:2ccd57b1d78c

Fix register allocator to do burn2 OK
author Windel Bouwman
date Sat, 12 Oct 2013 09:56:23 +0200
parents c1ccb1cb4cef
children
line wrap: on
line source

from .visitor import Visitor

class AstPrinter:
   def printAst(self, pkg):
      self.indent = 0
      visitor = Visitor()
      visitor.visit(pkg, self.print1, self.print2)
   def print1(self, node):
      print(' ' * self.indent + str(node))
      self.indent += 2
   def print2(self, node):
      self.indent -= 2