#NEWLINE# def _post_order( node , stack = None ) : #NEWLINE# #INDENT# '\n    generate a stack from a portion of the tree\n    ' #NEWLINE# if ( stack is None ) : #NEWLINE# #INDENT# stack = list ( ) #NEWLINE# #UNINDENT# if ( type ( node ) is list ) : #NEWLINE# #INDENT# if ( len ( node ) > 3 ) : #NEWLINE# #INDENT# _post_order ( node [ 3 ] , stack ) #NEWLINE# #UNINDENT# if ( len ( node ) > 4 ) : #NEWLINE# #INDENT# _post_order ( node [ 4 ] , stack ) #NEWLINE# #UNINDENT# stack . append ( node [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# stack . append ( node ) #NEWLINE# #UNINDENT# return stack