#!/usr/bin/perl use strict; use utf8::all; undef $/; my %n; my @t=("?"); my $x="?"; while(<>){ while( m{\#(?\w+)\h+(?\w.*\w) |(?===) |\#(?\w+)\h*\{\h*(?\w.*\w) |\#(?\w+)\h*\{\h*\n |\#=\h*(?\w.*\w) |\#/\h*(?\w.*\w) |\#\h*\{\h*(?\w.*\w) |(?\{) |(?\}) |\n\h*(?\*)\s*(?

.*) |\n\h*(?[+†])\s*(?.*) }xg){ if ($+{A}){ triPrint($t[-1],$+{A},$+{A1}); $x=$+{A1} ; $n{$+{A1}}++ } elsif($+{Z}){ triPrint("\n===\n","","");@t=("?"); $x="?"; } elsif($+{B}){ triPrint($t[-1],$+{B},$+{B1}); push(@t,$+{B1}) ;$x=$+{B1}; $n{$+{B1}}++ } elsif($+{C}){ triPrint($t[-1],$+{C},"{}"); push(@t,"doc?"); } elsif($+{D}){ triPrint($t[-1],"alias",$+{D}); ; $n{$+{D}}++ } elsif($+{E}){ push(@t,$+{E}) ; $x=$+{E}; $n{$+{E}}++ } elsif($+{J}){ push(@t,$+{J}) ; $x=$+{J}; $n{$+{J}}++ } elsif($+{G}){ push(@t,"??");} elsif($+{F}){ pop(@t); $x=$t[-1]; } elsif($+{H}){ triPrint($x,"*",$+{H1}); } elsif($+{I}){ triPrint($x,"+",$+{I1}); } } } print "\nNames:\n"; for (sort keys %n){ print "$_ : $n{$_}\n" } sub triPrint{ my ($a,$b,$c)=@_; print "$a = $b => $c;\n"; } __END__ #/ #= #doc #bio{ #dono #mecenas_of #lived_in #seedoc #I #S #F #= #doc #/ #S #F #F #/ #= #S{ #= #P{ #morou #M{ #PP #PM #MP #MPI #MM #I{ #= #I{ #/casa:Honório #doc{ #/casa: #doc:HL2{