Flatten a list of lists of lists... of strings into a string

        This is usually used as the action for sequence expressions:

        .. code-block::

            my_rule <- 'a' . 'c' {p_flatten}

        With the input "abc" and no action, this rule returns [ 'a', 'b', 'c'].
        { p_flatten } procuces "abc".

        >>> parser.p_flatten(['a', ['b', 'c']])
        'abc'

def p_flatten(self, obj, **kwargs):
        """ Flatten a list of lists of lists... of strings into a string

        This is usually used as the action for sequence expressions:

        .. code-block::

            my_rule <- 'a' . 'c' {p_flatten}

        With the input "abc" and no action, this rule returns [ 'a', 'b', 'c'].
        { p_flatten } procuces "abc".

        >>> parser.p_flatten(['a', ['b', 'c']])
        'abc'

        """
        if isinstance(obj, six.string_types):
            return obj
        result = ""
        for i in obj:
            result += self.p_flatten(i)
        return result