From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- libjava/scripts/unicode-decomp.pl | 146 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100755 libjava/scripts/unicode-decomp.pl (limited to 'libjava/scripts/unicode-decomp.pl') diff --git a/libjava/scripts/unicode-decomp.pl b/libjava/scripts/unicode-decomp.pl new file mode 100755 index 000000000..8aeed152a --- /dev/null +++ b/libjava/scripts/unicode-decomp.pl @@ -0,0 +1,146 @@ +#!/usr/bin/perl -w +# unicode-decomp.pl - script to generate database for java.text.Collator +# Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. +# +# This file is part of libjava. +# +# This software is copyrighted work licensed under the terms of the +# Libjava License. Please consult the file "LIBJAVA_LICENSE" for +# details. + +# Code for reading UnicodeData.txt and generating the code for +# gnu.java.lang.CharData. For now, the relevant Unicode definition files +# are found in libjava/gnu/gcj/convert/. +# +# Usage: ./unicode-decomp.pl [-n] +# where is obtained from www.unicode.org (named +# UnicodeData-3.0.0.txt for Unicode version 3.0.0), and +# is the final location of include/java-chardecomp.h. +# As of JDK 1.4, use Unicode version 3.0.0 for best results. +# +# If this exits with nonzero status, then you must investigate the +# cause of the problem. +# Diagnostics and other information to stderr. +# With -n, the files are not created, but all processing still occurs. + +# These maps characters to their decompositions. +my %canonical_decomposition = (); +my %full_decomposition = (); + +# Handle `-n' and open output files. +if ($ARGV[0] && $ARGV[0] eq '-n') +{ + shift @ARGV; + $ARGV[1] = '/dev/null'; +} +die "Usage: $0 " unless @ARGV == 2; +open (UNICODE, "< $ARGV[0]") || die "Can't open Unicode attribute file: $!\n"; + +# Process the Unicode file. +$| = 1; +my $count = 0; +print STDERR "Parsing attributes file"; +while () +{ + print STDERR "." unless $count++ % 1000; + chomp; + s/\r//g; + my ($ch, undef, undef, undef, undef, $decomp) = split ';'; + $ch = hex($ch); + + if ($decomp ne '') + { + my $is_full = 0; + my @decomp = (); + foreach (split (' ', $decomp)) + { + if (/^\<.*\>$/) + { + $is_full = 1; + next; + } + push (@decomp, hex ($_)); + } + my $s = pack "n*", @decomp; + if ($is_full) + { + $full_decomposition{$ch} = $s; + } + else + { + $canonical_decomposition{$ch} = $s; + } + } +} + +# Now generate decomposition tables. +open DECOMP, "> $ARGV[1]" or die "Can't open output file: $!\n"; +print STDERR "\nGenerating tables\n"; +print DECOMP <