diff options
author | Tom Tromey <tromey@cygnus.com> | 2000-07-20 19:34:29 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2000-07-20 19:34:29 +0000 |
commit | 7f8a07dbea5841742f43474131f9ba2832de0f5d (patch) | |
tree | c2196b416c9f7a980ee273332eeb426c719c8426 /libjava/scripts | |
parent | 5e5c1371d387354e8c380e30326e4f4cfe1ed536 (diff) | |
download | gcc-7f8a07dbea5841742f43474131f9ba2832de0f5d.zip gcc-7f8a07dbea5841742f43474131f9ba2832de0f5d.tar.gz gcc-7f8a07dbea5841742f43474131f9ba2832de0f5d.tar.bz2 |
classes.pl (scan): Print inner classes properly.
* scripts/classes.pl (scan): Print inner classes properly.
* gcj/javaprims.h: Updated class list.
From-SVN: r35151
Diffstat (limited to 'libjava/scripts')
-rw-r--r-- | libjava/scripts/classes.pl | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/libjava/scripts/classes.pl b/libjava/scripts/classes.pl index e9f17c7..9523823 100644 --- a/libjava/scripts/classes.pl +++ b/libjava/scripts/classes.pl @@ -1,7 +1,7 @@ # classes.pl - A perl program to generate most of the contents of # javaprims.h automatically. -# Copyright (C) 1998, 1999 Red Hat, Inc. +# Copyright (C) 1998, 1999, 2000 Red Hat, Inc. # # This file is part of libjava. # @@ -65,14 +65,29 @@ sub scan next unless $name =~ /\.java$/; open (FILE, "< $dir/$name"); + local ($outer, $classname); while (<FILE>) { # NOTE: we don't skip `/*' comments. s,//.*$,,; # For now assume that class names start with upper # case letter. - next unless /(class|interface) ([A-Z][A-Za-z0-9]+)/; - $classes{$2} = 1; + next unless /\b(class|interface) ([A-Z][A-Za-z0-9]+)/; + $classname = $2; + + # We assume the code is properly indented, so that we + # can print inner classes properly. + if (/^\s/) + { + die "no outer class for $classname in $dir/$name" + unless $outer; + $classes{$outer . "\$" . $classname} = 1; + } + else + { + $classes{$classname} = 1; + $outer = $classname; + } } close (FILE); } |