&header(); # list java file with hyperlinks # (c) 1999 Ward Cunningham my $root = "c:/jdk1.3/src"; my ($dir) = $query =~ /([^\/&]+)/; my $com = 0; my $public = 'public|private|protected|abstract|final|native|static|synchronized'; my $boolean = 'boolean|byte|short|int|char|long|float|double|void|[A-Z]\w+'; my $array = '\[\s*\]'; print "

$query

\n";
open (F, "$root/$query") or print "$file: $!";
while () {
	s/&/∧/g;
	s//>/g;
	s/"/"/g;
	
	$com = 1 if /^\s*\/\*/;
	
	if ($com or /^\s*\/\//) {
		s/.*/$&<\/font><\/i>/;
	} else {
		s/(class|interface)\s+(\w+)/$1 $2<\/b><\/font><\/a>/;
		s/(($public)\s+)*($boolean)(\s*$array)?\s+(\w+)(\s*\()/$1$3$4 $5<\/b><\/font><\/a>$6/;
		s/[{};]\s*$/$&<\/font>/;
	}
	
	$com = 0 if /.*\*\//;
	
	print ;
}
close (F);