#!/usr/bin/perl # n - name # a - author # s - synopsis # d - description # f - include files # x - informal semantics $File = shift; if($File =~ /(.*)\.cam$/) {$File=$1;} open(F, "$File.cam") or open(F, "$File") or die("cant find file $File.cam \n"); BEGIN { $a = "No autor"; } while(){ chop; if(/^#include/) { if ( length($f)==0){ $f = "Manual(s) of $'" } else { $f .= " $'" } } elsif(/^;A\s*/) { $a = $'; $x = ""; } elsif(/^;N\s*/) { $n .= $' } elsif(/^;D\s*/) { while(){ last if(/^;E/); if(/^;\s*/){ $d .= "\n". $' ; } } } elsif(/FUNC|func/){ $aux = $'; $x .= "\n=item $aux\n\n"; $s .= "$aux \n\n" ; while(){ next if( /^\s*PRE/i); last if( /^\s*RETURNS?|^\s*STATE/i); if (/^;\s*/){ $x .= $'}; if (/^pre\s*/i){}; } } } close F; END { open(D,"> $File.pod") or die "cant open file"; print D <<"."; =head1 NAME $n =head1 SYNOPSYS $s =head1 DESCRIPTION $d The informal semantics of the operators are as follows: =over 4 $x =back =head1 SEE ALSO . if ($f eq "") { print D "No include commands found.\n";} else { print D "$f.\n" ;}; print D "\n=head1 AUTHOR\n\n$a\n"; close D; system ( 'pod2man ' . "$File.pod > $File.man"); #system ( 'pod2man ' . "$File.pod| nroff -man "); # 'pod2man --center="The CAMILA Software Component (CSC) Library" ' . # "$File.pod| nroff -man "); }