summaryrefslogtreecommitdiff
path: root/libjava/scripts
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-17 04:51:25 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-17 04:51:25 +0000
commitf0119d9afa05cb6a82bfaf12021f5dde0a5a9067 (patch)
tree589f95defa08868b8681949b702699d1636b17ef /libjava/scripts
parent719884dd6ed2cac300227e49d3a2fd1102ed4345 (diff)
downloadgcc-f0119d9afa05cb6a82bfaf12021f5dde0a5a9067.tar.gz
* java/io/PushbackReader.java: Merged with Classpath.
* java/util/Arrays.java: Updated from Classpath. * scripts/blocks.pl: New file. * java/lang/Character.java (Subset): New class. (UnicodeBlock): New class. * java/lang/Math.java (toDegrees, toRadians): New methods. * java/lang/Float.java: Implement Comparable. (compareTo): New methods. * java/lang/Double.java: Implement Comparable. (compareTo): New methods. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37512 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/scripts')
-rw-r--r--libjava/scripts/blocks.pl48
1 files changed, 48 insertions, 0 deletions
diff --git a/libjava/scripts/blocks.pl b/libjava/scripts/blocks.pl
new file mode 100644
index 00000000000..400967145a6
--- /dev/null
+++ b/libjava/scripts/blocks.pl
@@ -0,0 +1,48 @@
+#! /usr/bin/perl
+
+if ($ARGV[0] eq '')
+{
+ $file = 'Blocks.txt';
+ if (! -f $file)
+ {
+ # Too painful to figure out how to get Perl to do it.
+ # FIXME.
+ system 'wget -o .wget-log http://www.isi.edu/in-notes/iana/unidata/Blocks.txt';
+ }
+}
+else
+{
+ $file = $ARGV[0];
+}
+
+open (INPUT, "< $file") || die "couldn't open $file: $!";
+
+@array = ();
+while (<INPUT>)
+{
+ next if /^#/;
+ chop;
+
+ ($start, $to, $text) = split (/; /);
+ ($symbol = $text) =~ tr/a-z/A-Z/;
+ $symbol =~ s/[- ]/_/g;
+
+ # Special case for one of the SPECIALS.
+ next if $start eq 'FEFF';
+
+ printf " public static final UnicodeBlock %s = new UnicodeBlock (\"%s\", '\\u%s', '\\u%s');\n",
+ $symbol, $text, $start, $to;
+
+ push (@array, $symbol);
+}
+
+printf " private static final UnicodeBlock[] blocks = {\n";
+foreach (@array)
+{
+ printf " %s", $_;
+ printf "," unless $_ eq 'SPECIALS';
+ printf "\n";
+}
+printf " };\n";
+
+close (INPUT);