]>
git.saurik.com Git - apple/icu.git/blob - icuSources/tools/genpname/gensvpa.pl
3 #*******************************************************************************
4 #* Copyright (C) 2006, International Business Machines
5 #* Corporation and others. All Rights Reserved.
6 #*******************************************************************************
8 #* file name: genspva.pl
10 #* tab size: 8 (not used)
13 #* Created by: Ram Viswanadha
15 #* This file filters iso15924-utf8-<date>.txt
30 #---------------------------------------------------------------------
35 "--destdir=s" => \
$destdir,
36 "--iso15924=s" => \
$iso,
38 "--code-start=s" => \
$code,
40 usage
() unless defined $destdir;
41 usage
() unless defined $iso;
42 usage
() unless defined $prop;
44 $outfile = "$destdir/SyntheticPropertyValueAliases.txt";
45 $propFH = IO
::File-
>new($prop,"r")
46 or die "could not open the file $prop for reading: $! \n";
47 $isoFH = IO
::File-
>new($iso,"r")
48 or die "could not open the file $iso for reading: $! \n";
49 $outFH = IO
::File-
>new($outfile,"w")
50 or die "could not open the file $outfile for reading: $! \n";
53 next if(!($_ =~/sc ; /));
58 print "Please add the following to UScriptCode enum in uscript.h.\n";
59 print "#ifndef U_HIDE_DRAFT_API\n";
62 next if($_=~/^#/);#skip if the line starts with a comment char
63 ($script, $t, $name, $rest) = split(/;/,$_,4);
65 $outstr = "sc ; $script";
68 # seach the propLines to make sure that this scipt code is not
70 foreach $key (@propLines){
71 if($key =~ /$outstr/){
75 next if($encoded == 1);
76 #ignore private use codes
77 next if($script =~ /Qa[ab][a-z]/);
79 #if($script eq "Qaaa"){
80 # $outstr = $outstr." ; Private_Use_Start\n";
81 #}elsif($script eq "Qabx"){
82 # $outstr = $outstr." ; Private_Use_End\n";
84 # $outstr = $outstr." ; $script \n";
87 $outstr = $outstr." ; $script \n";
92 if($name =~ /[(\s,\x80-\xFF]/){
97 $scriptcode = "USCRIPT_".uc($name);
98 print " $scriptcode = $code, /* $script */\n";
104 print "#endif /* U_HIDE_DRAFT_API */\n";
106 for($i=0; $i<2; $i++){
113 #-----------------------------------------------------------------------
116 ($DAY, $MONTH, $YEAR) = (localtime)[3,4,5];
118 #We will print our copyright here + warnings
119 print $outFH <<END_HEADER_COMMENT;
120 ########################################################################
121 # Copyright (c) 2006-$YEAR, International Business Machines
122 # Corporation and others. All Rights Reserved.
123 ########################################################################
124 # file name: SyntheticPropertyValueAliases.txt
126 # tab size: 8 (not used)
128 # created by: gensvpa.pl
129 ########################################################################
131 # This file follows the format of PropertyValueAliases.txt
132 # It contains synthetic property value aliases not present
133 # in the UCD. Unlike PropertyValueAliases.txt, it should
134 # NOT contain a version number.
136 ########################################################################
137 # THIS FILE IS MACHINE-GENERATED, DON'T PLAY WITH IT IF YOU DON'T KNOW
138 # WHAT YOU ARE DOING, OTHERWISE VERY BAD THINGS WILL HAPPEN!
139 ########################################################################
141 # set the same names as short and long names to fit the syntax without
142 # inventing names that we would have to support forever
148 #-----------------------------------------------------------------------
154 --destdir
=<directory
>
155 --iso15924
=<file name
>
156 --prop
=<PropertyValueAliases
.txt
>
158 e
.g
.: gensvpa
.pl
--destdir
=<icu
>/source/tools
/genpname
--iso15924
=iso15924-utf8-20041025
.txt
--prop
=<icu
>/source
/data
/unidata
--code-start
=60