Changeset 4184 for proto


Ignore:
Timestamp:
Sep 21, 2014, 10:05:54 PM (5 years ago)
Author:
cameron
Message:

Generating PropertyObjectArray?.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/charsetcompiler/UCD/UCD_properties.py

    r4183 r4184  
    293293   cformat.close_header_file(f)
    294294     
     295def generate_PropertyObjectArray_h(property_enum_name_list, property_kind_map):
     296   f = cformat.open_header_file_for_write('PropertyObjectArray')
     297   cformat.write_imports(f, ['"PropertyObjects.h"', '"PropertyAliases.h"', '"PropertyValueAliases.h"'])
     298   objlist = []
     299   for p in property_enum_name_list:
     300     k = property_kind_map[p]
     301     if k == 'Enumerated' or k == 'Catalog':
     302        objlist.append("EnumeratedPropertyObject(UCD::%s, UCD::%s::full_name, UCD::%s::alias_map)" % (p, p.upper(), p.upper()))
     303     else:
     304        objlist.append("%sPropertyObject(UCD::%s)" % (k, p))
     305   f.write("\nPropertyObject property_object_array[] = {\n    ")
     306   f.write(",\n    ".join(objlist) + '};\n')
     307   cformat.close_header_file(f)
     308
    295309def generate_ScriptExtensions_h():
    296310   (scx_sets, scx_map) = parse_UCD_codepoint_name_map('ScriptExtensions.txt')
     
    315329   # First parse all property names and their aliases
    316330   (property_enum_name_list, full_name_map, property_lookup_map, property_kind_map) = parse_PropertyAlias_txt()
    317    for k in property_kind_map.keys(): print "%sProperty(UCD::%s)" % (property_kind_map[k], k)
    318331   generate_PropertyAliases_h(property_enum_name_list, full_name_map, property_lookup_map)
    319332   # Next parse all property value names and their aliases
     
    323336   generate_PropertyValueSets_h(property_enum_name_list, property_value_list, property_value_enum_integer, property_value_full_name_map, property_value_lookup_map)
    324337   #
     338   generate_PropertyObjectArray_h(property_enum_name_list, property_kind_map)
     339   #
    325340   # Blocks
    326341   generate_property_value_file('Blocks', 'blk', property_value_lookup_map['blk'])
Note: See TracChangeset for help on using the changeset viewer.