From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,eeffc8cd0777020e,start X-Google-Attributes: gid103376,public From: skj@rb.icl.co.uk (Simon Johnston) Subject: WWW browser for GNAT libraries Date: 1995/04/21 Message-ID: <3n8ame$sc3@jerry.rb.icl.co.uk>#1/1 X-Deja-AN: 101370070 organization: ICL Retail Systems newsgroups: comp.lang.ada Date: 1995-04-21T00:00:00+00:00 List-Id: Hi, included in this mail is a Perl package 'alibdoc' which can be used to produce a WWW view of the GNAT library. comments are included, you need to create a script to call the two functions which will throw out on stdout an HTML file which uses the Unnumbered List construct to build a tree view of the library hierarchy. Each list element is a URL to the .ads file. This works fine for both OS/2 and Windows-NT, though there may be a some 'PC-isms' I haven't spotted. I am working on a script to break down the package specs themselves and produce a completely HTML overview, this may take some time. ----Start of alibdoc.pl package alibdoc; %packages = (); sub main'extract_packages { # Using the standard environment look for all files like *.ads # and check them for Ada packages. # The global dictionary packages associates the package file # name with the package. This does nothing more than compile # the list of packages available. foreach $dir (split(/;/, $ENV{"ADA_INCLUDE_PATH"})) { chdir($dir); foreach $afile (split(/\s+/, `ls *.ads`)) { open(FH, "<$afile") || die "cannot open $afile"; while () { if (/^package\s+(\S+)\s+is/) { $packages{$1} = $afile; end; } } close(FH); } } } sub main'print_package_hier { # This uses the list of packages in the global variable to # print a structures tree view of the Ada95 standard library. # The function extract_packages must have been called first # to ensure the state of the global dictionary. $depth = 0; $dir = $ENV{"ADA_INCLUDE_PATH"}; # Print the HTML header block. print "\n"; print "\n"; print "GNAT Package Hierarchy in dir\n"; print "\n"; print "

GNAT Packages:

\n"; print "\n"; $depth--; } # HTML trailer stuff. print "
\n"; print "This list produced automatically by the perl" print " script alibdoc.
\n"; print "
\n"; print "© 1995 Simon Johnston, TeamAda.
\n"; print "skj@rb.icl.co.uk\n"; print "
\n"; print "\n"; print "\n"; } 1; with StandardDisclaimer; use StandardDisclaimer; package body Sig is begin --,--------------------------------------------------------------------------. --|Simon K. Johnston - Development Engineer (C/C++) |ICL Retail Systems | --|------------------------------------------------------|3/4 Willoughby Road| --|Unix Mail : S.K.Johnston@bra0801.wins.icl.co.uk |Bracknell, Berks | --|Telephone : +44 (0)344 476320 Fax: +44 (0)344 476302|United Kingdom | --|Internal : 7261 6320 OP Mail: S.K.Johnston@BRA0801|RG12 8TJ | --`--------------------------------------------------------------------------' end Sig;