Mercurial > lcfOS
comparison applications/ide/compiler/display.py @ 39:600f48b74799
Move ide
author | windel |
---|---|
date | Fri, 03 Feb 2012 18:40:43 +0100 |
parents | ide/compiler/display.py@92df07bc2081 |
children |
comparison
equal
deleted
inserted
replaced
38:a1c9c2158e99 | 39:600f48b74799 |
---|---|
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) |