Example #1
0
            desc  = m.group(4)
            for key in range(start,end,1):
                trans.append((key, value, desc, [t]))
            continue
        m = re.search('^ *([^;]+); *([^;]+); *(.*) *$', l)
        if m:
            key   = int(m.group(1), 0x10)
            value = m.group(2)
            desc  = m.group(3)
            trans.append((key, value, desc, [t]))
            continue

valTable = []
offsetTable = {}

trans = stringprep.sort_merge_trans(trans)

for x in trans:
    if x[0] == 0xad:
        print "fooresult %s" % ",".join(x[3])

for x in trans:
    (key, value, description, table) = x
    v = value.split()
    i = util.subList(valTable, v)
    if i:
        offsetTable[key] = i
    else:
        offsetTable[key] = len(valTable)
        valTable.extend(v)
Example #2
0
trans=[]

for t in error_list.iterkeys():
    for l in tables[t]:
        m = re.search('^ *([0-9A-F]+)-([0-9A-F]+); *(.*) *$', l)
        if m:
            start = int(m.group(1), 0x10)
            end   = int(m.group(2), 0x10)
            desc  = m.group(3)
            trans.append([start, end - start + 1, desc, [t]])
        else:
            m = re.search('^ *([0-9A-F]+); *(.*) *$', l)
            if m:
                trans.append([int(m.group(1), 0x10), 1, m.group(2), [t]])

trans = stringprep.sort_merge_trans(trans)

for x in trans:
    (start, length, description, tables) = x
    symbols = stringprep.symbols(error_list, tables)
    if len(symbols) == 0:
        print "no symbol for %s" % description
        sys.exit(1)
    errorlist_c.file.write("  {0x%x, 0x%x, %s}, /* %s: %s */\n"
                % (start, length, symbols, ",".join(tables), description))

errorlist_c.file.write(
'''};

''')