| Revision 2474,
1.7 KB
checked in by chris, 3 years ago
(diff) |
|
Reorganise docs in trunk to match distribution layout, which is cleaner,
and makes Makefile work on distributions and trunk equally.
|
| Line | |
|---|
| 1 | #!/usr/bin/perl -w |
|---|
| 2 | use strict; |
|---|
| 3 | |
|---|
| 4 | open (EXCEPT, "< $ARGV[0]") or die "Can't open $ARGV[0]: $!\n"; |
|---|
| 5 | open (DOCBOOK, "> $ARGV[1]") or die "Can't open $ARGV[1] for writing: $!\n"; |
|---|
| 6 | |
|---|
| 7 | print DOCBOOK <<EOD; |
|---|
| 8 | <?xml version="1.0" encoding="UTF-8"?> |
|---|
| 9 | |
|---|
| 10 | <appendix> |
|---|
| 11 | <title>Exception codes</title> |
|---|
| 12 | |
|---|
| 13 | EOD |
|---|
| 14 | my $sectionName; |
|---|
| 15 | my $sectionNum; |
|---|
| 16 | my $sectionDesc; |
|---|
| 17 | my $exceptionCode; |
|---|
| 18 | my $exceptionShortDesc; |
|---|
| 19 | my $exceptionLongDesc; |
|---|
| 20 | while(<EXCEPT>) |
|---|
| 21 | { |
|---|
| 22 | next if(m/^#/); |
|---|
| 23 | chomp; |
|---|
| 24 | if(m/^EXCEPTION TYPE (\w+) (\d+)/) |
|---|
| 25 | { |
|---|
| 26 | $sectionName = ucfirst(lc($1)); |
|---|
| 27 | $sectionNum = $2; |
|---|
| 28 | if($sectionName ne "Common") |
|---|
| 29 | { |
|---|
| 30 | $sectionDesc = "the " . $sectionName; |
|---|
| 31 | } |
|---|
| 32 | else |
|---|
| 33 | { |
|---|
| 34 | $sectionDesc = "any"; |
|---|
| 35 | } |
|---|
| 36 | print DOCBOOK <<EOD; |
|---|
| 37 | <section> |
|---|
| 38 | <title>$sectionName Exceptions ($sectionNum)</title> |
|---|
| 39 | |
|---|
| 40 | <para>These are exceptions that can occur in $sectionDesc module |
|---|
| 41 | of the system.</para> |
|---|
| 42 | |
|---|
| 43 | <itemizedlist> |
|---|
| 44 | EOD |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | # The END TYPE line |
|---|
| 48 | if(m/^END TYPE$/) |
|---|
| 49 | { |
|---|
| 50 | print DOCBOOK " </itemizedlist>\n </section>\n"; |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | # The actual exceptions |
|---|
| 54 | if(m/(\(\d+\/\d+\)) - (\w+ \w+)(?: - )?(.*)$/) |
|---|
| 55 | { |
|---|
| 56 | $exceptionCode = $1; |
|---|
| 57 | $exceptionShortDesc = $2; |
|---|
| 58 | $exceptionLongDesc = $3; |
|---|
| 59 | |
|---|
| 60 | print DOCBOOK " <listitem>\n <para><emphasis role=\"bold\">"; |
|---|
| 61 | print DOCBOOK $exceptionCode . ": " . $exceptionShortDesc . "</emphasis>"; |
|---|
| 62 | if($exceptionLongDesc ne "") |
|---|
| 63 | { |
|---|
| 64 | print DOCBOOK " -- " . $exceptionLongDesc; |
|---|
| 65 | } |
|---|
| 66 | print DOCBOOK "</para>\n </listitem>\n"; |
|---|
| 67 | } |
|---|
| 68 | } |
|---|
| 69 | |
|---|
| 70 | print DOCBOOK "</appendix>\n"; |
|---|
| 71 | |
|---|
| 72 | close EXCEPT; |
|---|
| 73 | close DOCBOOK; |
|---|
| 74 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.