# n - name # a - author # s - synopsis # d - description # f - include files # x - informal semantics BEGIN { print "; CAMILA quick pod generator was used upon this file" ; a = "No autor"; s = ""; x = ""; f = ""; } /#include/ { if (length(f)==0) { f = "Manual(s) of " $2 } else { f = f ", " $2 } } /;A/ { a =""; for (i=2; i<=NF; ++i) a = a " " $i; x = ""; } /;N/ { for (i=2; i<=NF; ++i) n = n " " $i; } /;D/,/;E/ { $1=""; d = d "\n" $0 # for (i=2; i<=NF; ++i) d = d " " $i; # d = d "\n" } /FUNC/,/RETURN/ { if ($1 == "FUNC") { aux = ""; for (i=2; i<=NF; ++i) aux = aux " " $i; x = x "=item " aux "\n\n"; s = s aux "\n\n" } else if ($1 == "RETURN") { x = x "\n" } else if (length > 1) { for (i=2; i<=NF; ++i) x = x " " $i; x = x "\n"; } } { print } # imprime todas as outras linhas END { print "=head1 NAME\n\n" n > "_"; print "\n=head1 SYNOPSYS\n\n" s >> "_"; print "=head1 DESCRIPTION\n" d >> "_"; print " The informal semantics of the operators" >> "_" print " are as follows:\n\n=over 4\n" >> "_" print x >> "_" print "=back\n" >> "_" print "=head1 SEE ALSO\n" >> "_" if (f=="") { print "No include commands found.\n" > "_" } else { print f ".\n" > "_" }; print "=head1 AUTHOR\n\n" a "\n" >> "_" }