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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7e0af11f0ae4fd3e,start X-Google-Attributes: gid103376,public From: mw@ipx2.rz.uni-mannheim.de (Marc Wachowitz) Subject: Annotated Reference Manual: Text to HTML Date: 1997/11/02 Message-ID: <63i5pj$4mu$1@trumpet.uni-mannheim.de> X-Deja-AN: 287392490 Organization: --- Newsgroups: comp.lang.ada Date: 1997-11-02T00:00:00+00:00 List-Id: I've written a simple Perl script which transforms the text version of the Annotated Ada-95 Reference Manual into a set of html documents - though only links from/to a table of contents and the previous/next section/annex are created. The result isn't very beautiful, but sufficient for me to save lots of paper. Feel free to use it as you like (improvements are welcome, though I'm only interested if it works with lynx, a text-mode browser). The text version of the AARM is available as ftp://sw-eng.falls-church.va.us/public/AdaIC/standards/95lrm_rat/v6.0/aarm.txt -- Marc Wachowitz #! /usr/local/bin/perl -w # Expect Annotated Ada-95 Reference Manual on standard input use strict; use English; # file name conventions; prefix/suffix are not applied to $file_toc # (I prefer to put all files into directory 'AARM' - which must exist) my $file_toc = 'AARM/index.html'; my $file_prefix = 'AARM/'; my $file_suffix = '.html'; # html name conventions; prefix/suffix are not applied to $html_toc # (e.g. change '.html' to '.html.gz' and gzip all generated files later) my $html_toc = 'index.html'; my $html_prefix = ''; my $html_suffix = '.html'; # html document type my $doc = ''; # Annex titles for generated table of contents my %annex = ('A' => 'Predefined Language Environment', 'B' => 'Interface to Other Languages', 'C' => 'Systems Programming', 'D' => 'Real-Time Systems', 'E' => 'Distributed Systems', 'F' => 'Information Systems', 'G' => 'Numerics', 'H' => 'Safety and Security', 'J' => 'Obsolescent Features', 'K' => 'Language-Defined Attributes', 'L' => 'Language-Defined Pragmas', 'M' => 'Implementation-Defined Characteristics', 'N' => 'Glossary', 'P' => 'Syntax Summary'); my $prev_link; # undefined or reference to previous document my $counter = 0; # used to generate unique names my $pending_blank = 0; # are there any pending blank lines? sub chapter { # start new chapter, or close the last one my $name = shift; # logical name for this chapter my $title = shift; # title my $last = shift; # close last chapter? # mangle logical names (not necessary, but it's nice in the file system): $name =~ s/^([0-9])$/0$1/; $name =~ s/^([A-Z])$/$1_/; $name =~ s/^([0-9])\./0$1\./; $name =~ s/^([A-Z])\./$1_\./; $name =~ s/\.([0-9])\./\.0$1\./; $name =~ s/\.([0-9])$/\.0$1/; $name =~ s/^(..)\.(..)$/$1\.$2.00/; $name =~ s/^(..)$/$1\.00.00/; $counter++; $name = "$name._$counter"; # make $name unique, no matter what happened my $html_name = "$html_prefix$name$html_suffix"; if (defined($prev_link)) { # finish previous document if (! $last) { print OUT "\n[NEXT]\n"; } print OUT "\n"; close(OUT); } if (! $last) { # open this new document my $file_name = "$file_prefix$name$file_suffix"; open(OUT, "> $file_name") or die "cannot open output to '$file_name':\n$ERRNO\n"; $title =~ s/^s+//; $title =~ s/\s+$//; print OUT "$doc\n\n$title\n\n
\n";
    if (defined($prev_link)) {
      print OUT "[PREV]";
    }
    print OUT "[TOC]\n\n";
    print TOC "
  • $title\n"; } $prev_link = $html_name; $pending_blank = 0; } sub main { my $first_index = 1; open(TOC, "> $file_toc") or die "cannot open output to '$file_toc':\n$ERRNO\n"; print TOC "$doc\nAnnotated Ada-95 Reference Manual\n
      \n"; chapter('0', 'Preface', 0); while (defined(my $line = <>)) { $line =~ s/\s*$/\n/; $line =~ s/&/&/; $line =~ s//>/; if ($line =~ /^ *Section +([0-9]+)(:.*)$/) { print TOC "\n

      \n"; chapter($1, "$1$2", 0); } elsif ($line =~ /^ *Annex +([A-Z])$/) { print TOC "\n

      \n"; chapter($1, "$1: $annex{$1}\n", 0); } elsif ($line =~ /^Index$/ && $first_index) { print TOC "\n

      \n"; chapter('XX', $line, 0); $first_index = 0; } elsif ($line =~ /^Contents$/) { print TOC "\n

      \n"; chapter('ZZ', $line, 0); } elsif ($line =~ /^(([0-9]+|[A-Z])\.[0-9]+(\.[0-9]+)*) +[A-Z]/) { chapter($1, $line, 0); } if ($line =~ /^$/) { # compress multiple blank lines to just one $pending_blank = 1; } else { if ($pending_blank) { $pending_blank = 0; print OUT "\n"; } print OUT $line; } } print TOC "
    \n"; close(TOC); chapter('ZZ', '...', 1); # pseudo-chapter, to properly end the last one } main() 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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7e0af11f0ae4fd3e X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: Annotated Reference Manual: Text to HTML Date: 1997/11/03 Message-ID: <345E0B46.6855@gsfc.nasa.gov>#1/1 X-Deja-AN: 286794981 References: <63i5pj$4mu$1@trumpet.uni-mannheim.de> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Reply-To: Stephen.Leake@gsfc.nasa.gov Newsgroups: comp.lang.ada Date: 1997-11-03T00:00:00+00:00 List-Id: Marc Wachowitz wrote: > > I've written a simple Perl script which transforms the text version of the > Annotated Ada-95 Reference Manual into a set of html documents - though only > links from/to a table of contents and the previous/next section/annex are > created. The result isn't very beautiful, but sufficient for me to save lots > of paper. Feel free to use it as you like (improvements are welcome, though > I'm only interested if it works with lynx, a text-mode browser). > > The text version of the AARM is available as > ftp://sw-eng.falls-church.va.us/public/AdaIC/standards/95lrm_rat/v6.0/aarm.txt > Hope you didn't spend too much time on this; the html rationale is on AdaHome, at: http://www.adahome.com/Resources/refs/rat95.html There used to be a way to download the whole thing from AdaHome, but I don't see it at the moment. It also comes with ObjectAda from Aonix. -- - Stephe 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,7e0af11f0ae4fd3e X-Google-Attributes: gid103376,public From: Jon S Anthony Subject: Re: Annotated Reference Manual: Text to HTML Date: 1997/11/03 Message-ID: #1/1 X-Deja-AN: 286836048 Distribution: world References: <63i5pj$4mu$1@trumpet.uni-mannheim.de> <345E0B46.6855@gsfc.nasa.gov> Organization: PSINet Newsgroups: comp.lang.ada Date: 1997-11-03T00:00:00+00:00 List-Id: Stephen Leake writes: > Marc Wachowitz wrote: > > > > I've written a simple Perl script which transforms the text version > > of the Annotated Ada-95 Reference Manual into a set of html > > documents - though only links from/to a table of contents and the > > previous/next section/annex are created. The result isn't very > > beautiful, but sufficient for me to save lots ... > Hope you didn't spend too much time on this; the html rationale is on > AdaHome, at: That's not the AARM. Having an HTML version of the AARM seems like a good thing IMO, thanks Marc. /Jon -- Jon Anthony Synquiry Technologies, Ltd., Belmont, MA 02178, 617.484.3383 "Nightmares - Ha! The way my life's been going lately, Who'd notice?" -- Londo Mollari 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,7e0af11f0ae4fd3e X-Google-Attributes: gid103376,public From: Simon Wright Subject: Re: Annotated Reference Manual: Text to HTML Date: 1997/11/03 Message-ID: #1/1 X-Deja-AN: 287967778 X-NNTP-Posting-Host: pogner.demon.co.uk [158.152.70.98] References: <63i5pj$4mu$1@trumpet.uni-mannheim.de> <345E0B46.6855@gsfc.nasa.gov> Organization: At Home Newsgroups: comp.lang.ada Date: 1997-11-03T00:00:00+00:00 List-Id: Stephen Leake writes: > Marc Wachowitz wrote: > > > > I've written a simple Perl script which transforms the text version of the > > Annotated Ada-95 Reference Manual into a set of html documents - though only > > links from/to a table of contents and the previous/next section/annex are > > created. The result isn't very beautiful, but sufficient for me to save lots > > of paper. Feel free to use it as you like (improvements are welcome, though > > I'm only interested if it works with lynx, a text-mode browser). > > > > The text version of the AARM is available as > > ftp://sw-eng.falls-church.va.us/public/AdaIC/standards/95lrm_rat/v6.0/aarm.txt > > Hope you didn't spend too much time on this; the html rationale is on > AdaHome, at: > > http://www.adahome.com/Resources/refs/rat95.html Actually the AARM and the Rationale are quite different. I find the AARM useful when trying to puzzle out some obscure point. Also, it makes a good text-only reference for searching in your favourite text editor (one that'll take 2.8MB, anyway). -- Simon Wright Work Email: simon.j.wright@gecm.com GEC-Marconi Radar & Defence Systems Voice: +44(0)1705-701778 Command & Information Systems Division FAX: +44(0)1705-701800 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,7e0af11f0ae4fd3e X-Google-Attributes: gid103376,public From: mw@ipx2.rz.uni-mannheim.de (Marc Wachowitz) Subject: Re: Annotated Reference Manual: Text to HTML Date: 1997/11/03 Message-ID: <63ll1d$7f8$1@trumpet.uni-mannheim.de>#1/1 X-Deja-AN: 289102971 Organization: --- Newsgroups: comp.lang.ada Date: 1997-11-03T00:00:00+00:00 List-Id: Stephen Leake wrote: > Hope you didn't spend too much time on this; the html rationale is on > AdaHome The Rationale isn't at all the same as the Annotated Reference Manual: The former is mostly a general outline of improvements since Ada-83, whereas the latter is the Reference Manual annotated with remarks about subtle issues of the language specification, i.e. the kind of stuff which compiler implementors, language lawyers and other people (like me) who're interested in the "dirty parts" of programming language design like to have. It's a bit like a contract's fine print with commentaries from those who invented it - non-lawyers aren't likely to find it very stimulating ;-) -- Marc Wachowitz 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,7e0af11f0ae4fd3e X-Google-Attributes: gid103376,public From: Chris Morgan Subject: Re: Annotated Reference Manual: Text to HTML Date: 1997/11/06 Message-ID: <87wwim9vcj.fsf@mihalis.i-have-a-misconfigured-system-so-shoot-me>#1/1 X-Deja-AN: 287343458 Sender: cm@mihalis References: <63i5pj$4mu$1@trumpet.uni-mannheim.de> <345E0B46.6855@gsfc.nasa.gov> Organization: Linux Hackers Unlimited X-NETCOM-Date: Wed Nov 05 9:20:38 PM PST 1997 Newsgroups: comp.lang.ada Date: 1997-11-05T21:20:38-08:00 List-Id: Simon Wright writes: > Actually the AARM and the Rationale are quite different. I find the > AARM useful when trying to puzzle out some obscure point. My first introduction to Ada95 (back when I didn't even know it existed) was borrowing and photocopying a draft AARM from a colleague. Needless to say I thought the revision was a good bit more scary than it really is. Also, it > makes a good text-only reference for searching in your favourite text > editor (one that'll take 2.8MB, anyway). Something that won't edit a file that size shouldn't really be anyones favourite, but let's let sleeping dogs lie :-) Chris -- "everything remotely enjoyable turns out to be powerfully addictive and expensive and bad for you" - Lizzy Bryant