def gen_uposix(table, posix_table):
    """Generate the posix table and write out to file."""

    # `Alnum: [\p{L&}\p{Nd}]`
    s = set(table['l']['c'] + table['n']['d'])
    posix_table["posixalnum"] = list(s)

    # `Alpha: [\p{L&}]`
    s = set(table['l']['c'])
    posix_table["posixalpha"] = list(s)

    # `ASCII: [\x00-\x7F]`
    s = set([x for x in range(0, 0x7F + 1)])
    posix_table["posixascii"] = list(s)

    # `Blank: [\p{Zs}\t]`
    s = set(table['z']['s'] + [0x09])
    posix_table["posixblank"] = list(s)

    # `Cntrl: [\p{Cc}]`
    s = set(table['c']['c'])
    posix_table["posixcntrl"] = list(s)

    # `Digit: [\p{Nd}]`
    s = set(table['n']['d'])
    posix_table["posixdigit"] = list(s)

    # `Graph: [^\p{Z}\p{C}]`
    s = set()
    for table_name in ('z', 'c'):
        for sub_table_name in table[table_name]:
            if not sub_table_name.startswith('^'):
                s |= set(table[table_name][sub_table_name])
    posix_table["^posixgraph"] = list(s)

    # `Lower: [\p{Ll}]`
    s = set(table['l']['l'])
    posix_table["posixlower"] = list(s)

    # `Print: [\P{C}]`
    s = set()
    for table_name in ('c',):
        for sub_table_name in table[table_name]:
            if not sub_table_name.startswith('^'):
                s |= set(table[table_name][sub_table_name])
    posix_table["^posixprint"] = list(s)

    # `Punct: [\p{P}\p{S}]`
    s = set()
    for table_name in ('p', 's'):
        for sub_table_name in table[table_name]:
            if not sub_table_name.startswith('^'):
                s |= set(table[table_name][sub_table_name])
    posix_table["posixpunct"] = list(s)

    # `Space: [\p{Z}\t\r\n\v\f]`
    s = set()
    for table_name in ('z',):
        for sub_table_name in table[table_name]:
            if not sub_table_name.startswith('^'):
                s |= set(table[table_name][sub_table_name])
    s |= set([x for x in range(0x09, 0x0e)])
    posix_table["posixspace"] = list(s)

    # `Upper: [\p{Lu}]`
    s = set(table['l']['u'])
    posix_table["posixupper"] = list(s)

    # `XDigit: [A-Fa-f0-9]`
    s = set([x for x in range(0x30, 0x39 + 1)])
    s |= set([x for x in range(0x41, 0x46 + 1)])
    s |= set([x for x in range(0x61, 0x66 + 1)])
    posix_table["posixxdigit"] = list(s)
Generate the posix table and write out to file.