Mercurial > lcfOS
view python/c3/astprinter.py @ 204:de3a68f677a5
Added long comment to c3 parser
author | Windel Bouwman |
---|---|
date | Fri, 21 Jun 2013 15:01:08 +0200 |
parents | 8104fc8b5e90 |
children | c1ccb1cb4cef |
line wrap: on
line source
from .astnodes import * from .scope import * from .visitor import Visitor class AstPrinter: def __init__(self): self.visitor = Visitor(self.print1, self.print2) def printAst(self, pkg): self.indent = 0 self.visitor.visit(pkg) def print1(self, node): print(' ' * self.indent + str(node)) self.indent += 2 def print2(self, node): self.indent -= 2