comparison python/libs/compiler/display.py @ 63:32078200cdd6

Several move action
author windel
date Sun, 07 Oct 2012 17:04:10 +0200
parents python/ide/compiler/display.py@fd7d5069734e
children
comparison
equal deleted inserted replaced
62:fd7d5069734e 63:32078200cdd6
1 from .nodes import *
2
3 def printNode(node, indent=0):
4 """
5 Print visitor
6 all printing goes in here
7 """
8 print(' '*indent+str(node))
9 if type(node) is Procedure:
10 print(' '*indent+' PARAMETERS:')
11 for p in node.parameters:
12 printNode(p, indent+4)
13 if node.block:
14 print(' '*indent+' CODE:')
15 printNode(node.block, indent+4)
16 elif type(node) is Module:
17 print(node.symtable)
18 printNode(node.initcode, indent+2)
19 else:
20 for c in node.getChildren():
21 printNode(c, indent+2)