Changeset 6179


Ignore:
Timestamp:
Oct 27, 2018, 2:08:02 PM (11 months ago)
Author:
cameron
Message:

UCD generator scripts for canonical and compatible equivalence

Location:
icGREP/icgrep-devel/UCD-scripts
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/UCD-scripts/UCD_parser.py

    r5749 r6179  
    362362        if rangeMatch:
    363363            rangeName = rangeMatch.group(1)
    364             print(rangeName, rangeMatch.group(2))
    365364            if rangeMatch.group(2) == 'First': name_range_starts[rangeName] = cp
    366365            if rangeMatch.group(2) == 'Last':
  • icGREP/icgrep-devel/UCD-scripts/UCD_property_objects.py

    r5749 r6179  
    214214            for cp in range(cp_lo, cp_hi+1):
    215215                if len(stringValue) == 1 and ord(stringValue[0]) == cp:
    216                     print("Found reflexive entry for %s: %s" % (self.property_code, stringValue))
     216                    #print("Found reflexive entry for %s: %s" % (self.property_code, stringValue))
    217217                    self.reflexive_set = uset_union(self.reflexive_set, singleton_uset(ord(stringValue[0])))
    218218                else:
  • icGREP/icgrep-devel/UCD-scripts/cformat.py

    r5749 r6179  
    1 import UCD_config
     1import UCD_config, sys, time
     2from datetime import date
    23
    34header_template = r"""#ifndef %s
    45#define %s
    56/*
    6  *  Copyright (c) 2017 International Characters, Inc.
     7 *  Copyright (c) %s International Characters, Inc.
    78 *  This software is licensed to the public under the Open Software License 3.0.
    89 *  icgrep is a trademark of International Characters, Inc.
     
    1516cpp_template = r"""
    1617/*
    17  *  Copyright (c) 2016 International Characters, Inc.
     18 *  Copyright (c) %s International Characters, Inc.
    1819 *  This software is licensed to the public under the Open Software License 3.0.
    1920 *  icgrep is a trademark of International Characters, Inc.
     
    2526"""
    2627
     28def open_header_file_for_write(filename):
     29   generator_name = sys.argv[0]
     30
     31   f = open(UCD_config.UCD_output_dir + '/' + filename + '.h', 'w')
     32   hname = filename.upper() + '_H'
     33   f.write(header_template % (hname, hname, date.today().year, generator_name))
     34   return f
     35
     36def open_cpp_file_for_write(filename):
     37   generator_name = sys.argv[0]
     38
     39   f = open(UCD_config.UCD_output_dir + '/' + filename + '.cpp', 'w')
     40   hname = filename.upper() + '_H'
     41   f.write(cpp_template % (date.today().year, generator_name, filename))
     42   return f
    2743
    2844
    29 def open_header_file_for_write(filename, generator_name='UCD_properties.py'):
    30    f = open(UCD_config.UCD_output_dir + '/' + filename + '.h', 'w')
    31    hname = filename.upper() + '_H'
    32    f.write(header_template % (hname, hname, generator_name))
    33    return f
     45
    3446
    3547def close_header_file(f):
    3648   f.write("\n#endif\n")
     49   f.close()
     50
     51def close_cpp_file(f):
    3752   f.close()
    3853
Note: See TracChangeset for help on using the changeset viewer.