(self, start_node=None)
return str_buff
Returns a tree-formated string (s-expression) of the tree.

        :rtype: a S-Expression representing the tree
Returns a tree-formated string (s-expression) of the tree.
Returns a tree - formated string ( s - expression ) of the tree .
def getSExpression(self, start_node=None):
        """ Returns a tree-formated string (s-expression) of the tree.

        :rtype: a S-Expression representing the tree
        """
        str_buff = ""
        if start_node is None:
            start_node = self.getRoot()
            str_buff += "%s " % start_node.getData()

        is_leaf = start_node.isLeaf()
        if not is_leaf:
            str_buff += "( "

        for child_node in start_node.getChilds():
            str_buff += "%s " % child_node.getData()
            str_buff += self.getSExpression(child_node)

        if not is_leaf:
            str_buff += " )"
        return str_buff
def getSExpression ( self , start_node = None ) : str_buff = "" if start_node is None : start_node = self . getRoot ( ) str_buff += "%s " % start_node . getData ( ) is_leaf = start_node . isLeaf ( ) if not is_leaf : str_buff += "( " for child_node in start_node . getChilds ( ) : str_buff += "%s " % child_node . getData ( ) str_buff += self . getSExpression ( child_node ) if not is_leaf : str_buff += " )" return str_buff