#NEWLINE# def pretty( self , tab = 4 ) : #NEWLINE# #INDENT# ( yield ( '%s %s, ' % ( self . __class__ . __name__ , self . grammar . number2symbol . get ( self . type ) ) ) ) #NEWLINE# for child in self . children : #NEWLINE# #INDENT# if isinstance ( child , PNode ) : #NEWLINE# #INDENT# for line in child . pretty ( tab ) : #NEWLINE# #INDENT# ( yield ( ( ' ' * tab ) + line ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for line in child . __repr__ ( ) . splitlines ( ) : #NEWLINE# #INDENT# ( yield ( ( ' ' * tab ) + line ) )