3 # Compile GraphemeBreak.txt into C array declarations.
5 # The array's structure is [firstchar, lastchar, class], giving the
6 # linebreaking "class" for unicode character range firstchar-lastchar.
8 # The ranges are sorted in numerical order.
10 # An array gets generated for each block of 4096 unicode characters.
12 # Finally, two arrays get declared: a pointer to an array for each 4096
13 # unicode character block, and the number of elements in the array.
15 # The pointer is NULL for each block of 4096 unicode characters that is not
16 # defined in LineBreak.txt
18 # By definition, a unicode character that is not listed in the array is
25 open(F
, "<GraphemeBreakProperty.txt") || die;
29 # Invoke doclass() passing the first unicode char, the last unicode char,
30 # and the linebreaking class for the given unicode char range.
34 while (defined($_=<F
>))
38 next unless /^([0-9A-F]+)(\.\.([0-9A-F]+))?\s*\;\s*([^\s]+)\s*/;
49 push @breaklist, [$f, $l, $t];
53 my $obj=mkcommon
->new;
55 foreach (sort { $$a[0] <=> $$b[0] } @breaklist)
57 $obj->range($$_[0], $$_[1], "UNICODE_GRAPHEMEBREAK_$$_[2]");