Mercurial > lcfOS
view python/ppci/display.py @ 96:a350055d6119
movage
author | windel |
---|---|
date | Mon, 24 Dec 2012 13:30:12 +0100 |
parents | python/libs/compiler/display.py@32078200cdd6 |
children |
line wrap: on
line source
from .nodes import * def printNode(node, indent=0): """ Print visitor all printing goes in here """ print(' '*indent+str(node)) if type(node) is Procedure: print(' '*indent+' PARAMETERS:') for p in node.parameters: printNode(p, indent+4) if node.block: print(' '*indent+' CODE:') printNode(node.block, indent+4) elif type(node) is Module: print(node.symtable) printNode(node.initcode, indent+2) else: for c in node.getChildren(): printNode(c, indent+2)