From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- support/splint/scripts/cslist.pl | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 support/splint/scripts/cslist.pl (limited to 'support/splint/scripts/cslist.pl') diff --git a/support/splint/scripts/cslist.pl b/support/splint/scripts/cslist.pl new file mode 100755 index 0000000000..d1df62bc07 --- /dev/null +++ b/support/splint/scripts/cslist.pl @@ -0,0 +1,40 @@ +for ($i = 0; $i <= $#ARGV; $i++) { + + open FILE, "<$ARGV[$i]" or die "Cannot open file $ARGV[$i]!\n"; + $filename = $ARGV[$i]; + + while() { + + $text = $_; + + while( $text =~ /(\\newcount|\\newtoks|\\newdimen|\\newif|\\let|\\([exg]|char|toks|count)*def)\w*(\\[a-zA-Z@]+)/g ) { + + $cs = $3; + push @all, $cs; + + if ( defined $secse{$cs}->{$filename} ) { $secse{$cs}->{$filename}++; } + else { $secse{$cs}->{$filename} = 1; }; + + } + + } +} +#print keys %secse; +@alphsecs = sort keys %secse; + +foreach $ocs (@alphsecs) { + + print "$ocs %"; + @fnames = sort keys $secse{$ocs}; + foreach $fname (@fnames) { + print " $fname ($secse{$ocs}->{$fname} occurence"; + if ( $secse{$ocs}->{$fname} > 1 ) {print "s";} + print ")"; + } + print "\n"; +} + +print "\n"; +$i = $#alphsecs; +$i++; +print "total sequences: $i\n"; -- cgit v1.2.3