6 GetOptions \
our %Conf, qw(--verbose|v no|n leaves|l cc|c=s@ allccs|a nodes);
8 my $signature = qr/^([\w']*) ::/o;
11 #my $g = GraphViz->new();
14 if($_ =~ $signature) { $fn = $1; next }
15 #if($_ =~ $signature) { $fn = $1; $g->add_node($fn); next }
16 if($fn) { $funcs{$fn} .= $_ }
20 for my $key (keys %funcs) {
21 for my $func (keys %funcs) {
22 next if $func eq $key;
23 print "$key -> $func\n" if $Conf{verbose
} && $funcs{$key} =~ /\b$func\b/;
24 push @
{ $nodes{$key} }, $func if $funcs{$key} =~ /\b$func\b/;
25 # $g->add_edge($key, $func) if($funcs{$key} =~ $func)
30 print "$_\n" for grep { not defined $nodes{$_} } keys %funcs;
34 my %ccset = map { $_ => 1 } @
{ $Conf{cc
} };
36 print "$_\n" for sort keys %ccset;
40 $|++ if $Conf{verbose
};
42 for my $f (keys %nodes) {
43 print "." if $Conf{verbose
};
45 print "calculating cc for $f\n";
46 $allccs{$f} = [ keys %{comp_cc
(\
%cc)} ];
48 print ::Y
(\
%allccs),"\n";
50 #print $g->as_png unless $Conf{no};
53 print ::Y
(\
%nodes), "\n";
60 while ($oldn != keys %$ccset) {
62 for my $f (keys %$ccset) {
63 # $ccset->{$_} = 1 for @{ $nodes{$f} };
64 for (@
{ $nodes{$f} }) {
65 #print "Adding $_ based on $f\n" unless $ccset->{$_};
73 sub ::Y
{ require YAML
; YAML
::Dump
(@_) }
74 sub ::YY
{ require Carp
; Carp
::confess
(::Y
(@_)) }