diff options
Diffstat (limited to 'Build/source/libs/teckit/TECkit-2.5.1/source/MakeUnicodeNames.pl')
-rw-r--r-- | Build/source/libs/teckit/TECkit-2.5.1/source/MakeUnicodeNames.pl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Build/source/libs/teckit/TECkit-2.5.1/source/MakeUnicodeNames.pl b/Build/source/libs/teckit/TECkit-2.5.1/source/MakeUnicodeNames.pl new file mode 100644 index 00000000000..e29439f51a3 --- /dev/null +++ b/Build/source/libs/teckit/TECkit-2.5.1/source/MakeUnicodeNames.pl @@ -0,0 +1,32 @@ +#!perl + +# make name list for teckit compiler from UnicodeData.txt + +open FH, "<UnicodeData.txt" or die; +while (<FH>) { + chomp; + @fields = split(/;/); + $uc = $fields[0]; + $un = $fields[1]; + + next if $un =~ /</; + + push @names, [ $uc, $un ]; +} +close FH; + +print << '__END__'; +#include "Compiler.h" + +CharName gUnicodeNames[] = { +__END__ + +# sort the names so that we can use binary search +foreach (sort { $a->[1] cmp $b->[1] } @names) { + print "{0x$_->[0],\"$_->[1]\"},\n"; +} + +print << '__END__'; +{0,0} +}; +__END__ |