'Parse block attributes.
>>> t = Textile()
>>> t.pba(r\'\')
>>> t.pba(r\'\3\', element=\'td\')
\' colspan="3"\'
>>> t.pba(r\'/4\', element=\'td\')
\' rowspan="4"\'
>>> t.pba(r\'\3/4\', element=\'td\')
\' colspan="3" rowspan="4"\'
>>> t.vAlign(\'^\')
\'top\'
>>> t.pba(\'^\', element=\'td\')
\' style="vertical-align:top;"\'
>>> t.pba(\'{line-height:18px}\')
\' style="line-height:18px;"\'
>>> t.pba(\'(foo-bar)\')
\' class="foo-bar"\'
>>> t.pba(\'(#myid)\')
\' id="myid"\'
>>> t.pba(\'(foo-bar#myid)\')
\' class="foo-bar" id="myid"\'
>>> t.pba(\'((((\')
\' style="padding-left:4em;"\'
>>> t.pba(\')))\')
\' style="padding-right:3em;"\'
>>> t.pba(\'[fr]\')
\' lang="fr"\''

def pba(self, input, element=None):

    style = []
    aclass = ''
    lang = ''
    colspan = ''
    rowspan = ''
    id = ''
    if (not input):
        return ''
    matched = input
    if (element == 'td'):
        m = re.search('\\\\(\\d+)', matched)
        if m:
            colspan = m.group(1)
        m = re.search('/(\\d+)', matched)
        if m:
            rowspan = m.group(1)
    if ((element == 'td') or (element == 'tr')):
        m = re.search(('(%s)' % self.vlgn), matched)
        if m:
            style.append(('vertical-align:%s;' % self.vAlign(m.group(1))))
    m = re.search('\\{([^}]*)\\}', matched)
    if m:
        style.append((m.group(1).rstrip(';') + ';'))
        matched = matched.replace(m.group(0), '')
    m = re.search('\\[([^\\]]+)\\]', matched, re.U)
    if m:
        lang = m.group(1)
        matched = matched.replace(m.group(0), '')
    m = re.search('\\(([^()]+)\\)', matched, re.U)
    if m:
        aclass = m.group(1)
        matched = matched.replace(m.group(0), '')
    m = re.search('([(]+)', matched)
    if m:
        style.append(('padding-left:%sem;' % len(m.group(1))))
        matched = matched.replace(m.group(0), '')
    m = re.search('([)]+)', matched)
    if m:
        style.append(('padding-right:%sem;' % len(m.group(1))))
        matched = matched.replace(m.group(0), '')
    m = re.search(('(%s)' % self.hlgn), matched)
    if m:
        style.append(('text-align:%s;' % self.hAlign(m.group(1))))
    m = re.search('^(.*)#(.*)$', aclass)
    if m:
        id = m.group(2)
        aclass = m.group(1)
    if self.restricted:
        if lang:
            return '    lang="%s"'
        else:
            return ''
    result = []
    if style:
        result.append(('    style="%s"' % ''.join(style)))
    if aclass:
        result.append(('    class="%s"' % aclass))
    if lang:
        result.append(('    lang="%s"' % lang))
    if id:
        result.append(('    id="%s"' % id))
    if colspan:
        result.append(('    colspan="%s"' % colspan))
    if rowspan:
        result.append(('    rowspan="%s"' % rowspan))
    return ''.join(result)
