annotate python/c3/astprinter.py @ 175:a51b3c956386
Added function call in expressions
author |
Windel Bouwman |
date |
Fri, 19 Apr 2013 22:15:54 +0200 |
parents |
8104fc8b5e90 |
children |
c1ccb1cb4cef |
rev |
line source |
163
|
1 from .astnodes import *
|
|
2 from .scope import *
|
|
3 from .visitor import Visitor
|
|
4
|
|
5 class AstPrinter:
|
|
6 def __init__(self):
|
|
7 self.visitor = Visitor(self.print1, self.print2)
|
|
8 def printAst(self, pkg):
|
|
9 self.indent = 0
|
|
10 self.visitor.visit(pkg)
|
|
11 def print1(self, node):
|
|
12 print(' ' * self.indent + str(node))
|
|
13 self.indent += 2
|
|
14 def print2(self, node):
|
|
15 self.indent -= 2
|
|
16
|