#
#
# add_file "progs/arm_texinfo.adb"
#  content [7291d198ca61ecfe04d7362edb1dde8186a5f855]
# 
# add_file "progs/arm_texinfo.ads"
#  content [266d5c69e4795f81b1e609fc0ba0be883fbd96af]
# 
# patch "progs/arm_cont.adb"
#  from [6367999676bc6e64b7d6d11a401f1dac3fd1ca59]
#    to [d885d951af3ba9b6e41fd78e2001fcc74159a283]
# 
# patch "progs/arm_cont.ads"
#  from [6596716ec97c15a811b342a248759697f3092b3a]
#    to [ef3ac4e688d6574b38ea3d32b4a5d015db130f15]
# 
# patch "progs/arm_corr.adb"
#  from [8c3c083def7c6c54d5ba24fd601e369af7c715dc]
#    to [6bacc4dc096dfb9f3fa2f901f2e9d35015356083]
# 
# patch "progs/arm_db.adb"
#  from [f5f60a07051b87c049b0ecbd6462b6e9bfac38c3]
#    to [1d603365d5bb465bbb1cab92bf04dfa4fe64a7d1]
# 
# patch "progs/arm_file.adb"
#  from [c2bc065c1412b42d956a113825f463016e816550]
#    to [d2bfec6ddb79bb63fad90a1a6559681ecbd3bb96]
# 
# patch "progs/arm_form.ada"
#  from [b16d9b40ec87e171d579ffe166f2a9acfe2ade44]
#    to [c00aa04da68cb1b2c21f07bbec593cca5debec1c]
# 
# patch "progs/arm_frm.adb"
#  from [88a1527623f1c61882521ef8eebbf1f50200f291]
#    to [81a0a13966fdbca428831a7c17c7ef957cd77654]
# 
# patch "progs/arm_frm.ads"
#  from [e0e0bfa9ae14b868d1fb6af5d0cb3ca0bf4978cc]
#    to [37ae4d5c73239c0cab701e63d1f22775a11bfc44]
# 
# patch "progs/arm_html.adb"
#  from [f7485cae94631499305b48e073365eaf9a79bec1]
#    to [e2c8043f3f7cc70a7995d79701ac030ed4af6ee1]
# 
# patch "progs/arm_indx.adb"
#  from [85d524ffcd0687f48142f51f0568b4f187cde0f4]
#    to [4d4895df38d72351deed15d7549ea31d95376788]
# 
# patch "progs/arm_mast.adb"
#  from [bf1cc6c25a197650141a6c295fffe9bbb2fcccd9]
#    to [f07fb577134c87b82d27244f684fc01f34f075f3]
# 
# patch "progs/arm_rtf.adb"
#  from [dfa82e8697545d64775c89297cceeaa93d9101da]
#    to [77f0fffb0bd7a4d0b6293fad50388b82ec52827d]
# 
# patch "progs/arm_str.adb"
#  from [d12ec9e024dd28b7c7f83e8c281f6eb6ab35ba8e]
#    to [d05b795fb41d724d03e24c6adba1d4249da2bef2]
# 
# patch "progs/arm_sub.adb"
#  from [b585f4a75f9394d7cc2126667c6543165b9dbf12]
#    to [66564154cc0e70e30db4e5dbc92431ecbf341590]
# 
# patch "progs/arm_syn.adb"
#  from [b849027bd8ca131c1d0762ff315aa4f9c3709aa9]
#    to [d0031269276536bcbd8ae0b8844d12b5a881460e]
# 
# patch "progs/arm_text.adb"
#  from [0210659138fa315cfd969149fd13110072c9b906]
#    to [468b32811dce385ab7244ed4385ca746034c0e33]
# 
# patch "source_2005/AARM.MSM"
#  from [699210eae97f47f5b6e8572771f12aee8f04f075]
#    to [d6d3884441787cb4c2ecfe8855b88fe1fcffb0b0]
# 
# patch "source_2005/RM.MSM"
#  from [e854c6de287879445fa9230508b08e1059e33634]
#    to [92c2e5abae5daa80d679e9a11453d2ac0a3ba247]
# 
#   set "progs/arm_texinfo.adb"
#  attr "mtn:execute"
# value "true"
# 
#   set "progs/arm_texinfo.ads"
#  attr "mtn:execute"
# value "true"
#
============================================================
--- progs/arm_texinfo.adb	7291d198ca61ecfe04d7362edb1dde8186a5f855
+++ progs/arm_texinfo.adb	7291d198ca61ecfe04d7362edb1dde8186a5f855
@@ -0,0 +1,1992 @@
+with Ada.Exceptions;
+with Ada.Strings.Fixed;
+package body ARM_Texinfo is
+
+   --  Copyright (C) 2003, 2007, 2010 Stephen Leake.  All Rights Reserved.
+   --  E-Mail: stephen_leake@acm.org
+   --
+   --  This library is free software; you can redistribute it and/or
+   --  modify it under terms of the GNU General Public License as
+   --  published by the Free Software Foundation; either version 3, or (at
+   --  your option) any later version. This library is distributed in the
+   --  hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+   --  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+   --  PURPOSE. See the GNU General Public License for more details. You
+   --  should have received a copy of the GNU General Public License
+   --  distributed with this program; see file COPYING. If not, write to
+   --  the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+   --  MA 02111-1307, USA.
+   --
+   --  As a special exception, if other files instantiate generics from
+   --  this unit, or you link this unit with other files to produce an
+   --  executable, this  unit  does not  by itself cause  the resulting
+   --  executable to be covered by the GNU General Public License. This
+   --  exception does not however invalidate any other reasons why the
+   --  executable file  might be covered by the  GNU Public License.
+
+   use Ada.Text_IO;
+
+   Indentation : constant := 5;
+
+   --  VERSION: This is fragile; it changes with each version of the manual.
+   Index_Clause      : constant String    := "0.5";
+   Index_Clause_Name : constant String    := "Index";
+   Index_Clause_Next : constant String    := "operators";
+   Operators_Clause  : constant String    := "operators";
+   Last_Index_Clause : constant Character := 'Y';
+
+   ----------
+   --  local subprograms
+
+   procedure Check_Not_In_Paragraph (Output_Object : in Texinfo_Output_Type)
+   is begin
+      if Output_Object.In_Paragraph then
+         Ada.Exceptions.Raise_Exception
+           (ARM_Output.Not_Valid_Error'Identity,
+            "In paragraph");
+      end if;
+   end Check_Not_In_Paragraph;
+
+   procedure Check_Valid (Output_Object : in Texinfo_Output_Type)
+   is begin
+      if not Output_Object.Is_Valid then
+         Ada.Exceptions.Raise_Exception
+           (ARM_Output.Not_Valid_Error'Identity,
+            "Not valid object");
+      end if;
+   end Check_Valid;
+
+   procedure Unexpected_State (Output_Object : in Texinfo_Output_Type)
+   is begin
+      Ada.Exceptions.Raise_Exception
+        (ARM_Output.Not_Valid_Error'Identity,
+         "Unexpected state: " & State_Type'Image (Output_Object.State));
+   end Unexpected_State;
+
+   procedure Escape_Put
+     (Output_Object  : in Texinfo_Output_Type;
+      Char           : in Character;
+      Preserve_Space : in Boolean             := False)
+   is begin
+      --  Escape special chars
+      if Char = '@' then
+         Put (Output_Object.File, "@@");
+      elsif Char = '{' then
+         Put (Output_Object.File, "@{");
+      elsif Char = '}' then
+         Put (Output_Object.File, "@}");
+      elsif Char = ''' then
+         --  Avoid makeinfo converting '' into "
+         Put (Output_Object.File, "'@w{}");
+      elsif Char = '`' then
+         --  Avoid makeinfo converting `` into "
+         Put (Output_Object.File, "`@w{}");
+      elsif Char = '-' then
+         Put (Output_Object.File, "@minus{}");
+      elsif Char = ' ' and Preserve_Space then
+         --  Don't allow collapsing spaces
+         Put (Output_Object.File, "@w{ }");
+      elsif Char = '\' then
+         --  This confuses texi2dvi if not escaped.
+         Put (Output_Object.File, "@code{\}");
+      else
+         Put (Output_Object.File, Char);
+      end if;
+   end Escape_Put;
+
+   procedure Escape_Put
+     (Output_Object  : in Texinfo_Output_Type;
+      Text           : in String;
+      Preserve_Space : in Boolean             := False)
+   is begin
+      for I in Text'Range loop
+         Escape_Put (Output_Object, Text (I), Preserve_Space);
+      end loop;
+   end Escape_Put;
+
+   procedure End_Title_Page (Output_Object : in out Texinfo_Output_Type)
+   is
+      use ARM_Contents;
+
+      procedure Put_Top_Menu_Item
+        (Title         : in     Title_Type;
+         Level         : in     Level_Type;
+         Clause_Number : in     Clause_Number_Type;
+         Version       : in     ARM_Contents.Change_Version_Type;
+         Quit          :    out Boolean)
+      is
+         pragma Unreferenced (Version); --  we are only concerned with version 2
+         First_Part : String (1 .. 14); --  Get all Titles aligned.
+      begin
+         Quit := False;
+
+         case Level is
+         when Section | Normative_Annex | Informative_Annex =>
+            Ada.Strings.Fixed.Move
+              (Source =>
+                 "* " &
+                 Make_Clause_Number (Level, Clause_Number) &
+                 " ::",
+               Target => First_Part);
+
+            Put_Line (Output_Object.File, First_Part & Title);
+
+         when Unnumbered_Section | Clause | Subclause | Subsubclause =>
+            null;
+
+         end case;
+      end Put_Top_Menu_Item;
+
+      procedure Put_Top_Menu is new For_Each (Put_Top_Menu_Item);
+   begin
+
+      New_Line (Output_Object.File); --  Terminate unneeded "@center"
+
+      Put_Line (Output_Object.File, "@dircategory GNU Ada tools");
+      Put_Line (Output_Object.File, "@direntry");
+      Put_Line (Output_Object.File, "* Ada Reference Manual: (arm2005).");
+      Put_Line (Output_Object.File, "* Annotated ARM: (aarm2005).");
+      Put_Line (Output_Object.File, "@end direntry");
+
+      Put_Line (Output_Object.File, "@menu");
+      Put_Line (Output_Object.File, "* Front Matter:: Copyright, Foreword, etc."); --  Not a section in ARM sources
+      Put_Top_Menu;
+      Put_Line (Output_Object.File, "* Index ::    Index"); --  Not in ARM sources
+      Put_Line (Output_Object.File, "@end menu");
+
+      -- @node current, next, prev, up
+      Put_Line (Output_Object.File, "@node Front Matter, 0.1, Top, Top");
+      Put_Line (Output_Object.File, "@chapter Front Matter");
+   end End_Title_Page;
+
+   procedure Get_Clause_Section
+     (Clause_String  : in     String;
+      Section_Number :    out ARM_Contents.Section_Number_Type;
+      Clause_Integer :    out Natural)
+   is
+      --  This is a partial inverse of ARM_Contents.Make_Clause_Number.
+      --
+      --  Clause_String has "section.clause.subclause", possibly no subclause.
+      --
+      --  "section" can be a number, a letter "N", or "Annex N", where
+      --
+      --  'N' = Character'Val (Character'Pos('A') + (Section_Number - ANNEX_START)
+
+      Section_Dot : constant Natural := Ada.Strings.Fixed.Index (Source => Clause_String, Pattern => ".");
+
+      Clause_Dot : constant Natural := Ada.Strings.Fixed.Index
+        (Source => Clause_String (Section_Dot + 1 .. Clause_String'Last),
+         Pattern => ".");
+
+      use type ARM_Contents.Section_Number_Type;
+   begin
+      if Section_Dot = 8 then
+         --  Section is "Annex N"
+         Section_Number := ARM_Contents.ANNEX_START +
+           Character'Pos (Clause_String (Clause_String'First + 6)) - Character'Pos ('A');
+      elsif Character'Pos (Clause_String (Clause_String'First)) >= Character'Pos ('A') then
+         --  Section is letter.
+         Section_Number := ARM_Contents.ANNEX_START +
+           Character'Pos (Clause_String (Clause_String'First)) - Character'Pos ('A');
+      else
+         Section_Number := ARM_Contents.Section_Number_Type'Value
+           (Clause_String (Clause_String'First .. Section_Dot - 1));
+      end if;
+
+      if Clause_Dot = 0 then
+         Clause_Integer := Natural'Value
+           (Clause_String (Section_Dot + 1 .. Clause_String'Last));
+      else
+         Clause_Integer := Natural'Value
+           (Clause_String (Section_Dot + 1 .. Clause_Dot - 1));
+      end if;
+   end Get_Clause_Section;
+
+   procedure Add_To_Column_Item (Output_Object : in out Texinfo_Output_Type; Text : in String)
+   is begin
+      if Output_Object.Column_Text (Output_Object.Current_Column) = null or else
+        Output_Object.Column_Text (Output_Object.Current_Column).Row /= Output_Object.Current_Row
+      then
+         --  Start a new row.
+         Output_Object.Column_Text (Output_Object.Current_Column) :=
+           new Column_Text_Item_Type'
+           (Text   => (others => ' '),
+            Length => 0,
+            Row    => Output_Object.Current_Row,
+            Next   => Output_Object.Column_Text (Output_Object.Current_Column));
+      end if;
+
+      if Output_Object.Column_Text (Output_Object.Current_Column).Length + Text'Length >
+        Output_Object.Column_Text (Output_Object.Current_Column).Text'Length
+      then
+         Ada.Exceptions.Raise_Exception
+           (ARM_Output.Not_Valid_Error'Identity,
+            "Column item full, but more text: " &
+              Output_Object.Column_Text (Output_Object.Current_Column).Text
+              (1 .. Output_Object.Column_Text (Output_Object.Current_Column).Length));
+      else
+         declare
+            Current_Text : Column_Text_Item_Type renames Output_Object.Column_Text (Output_Object.Current_Column).all;
+         begin
+            Current_Text.Text (Current_Text.Length + 1 .. Current_Text.Length + Text'Length) := Text;
+
+            Current_Text.Length := Current_Text.Length + Text'Length;
+
+            if Output_Object.Column_Widths (Output_Object.Current_Column) < Current_Text.Length then
+               Output_Object.Column_Widths (Output_Object.Current_Column) := Current_Text.Length;
+            end if;
+         end;
+      end if;
+   end Add_To_Column_Item;
+
+   procedure Pad_Columns (Output_Object : in out Texinfo_Output_Type)
+   --  Ensure that all columns have the same number of (possibly
+   --  empty) rows, for table headers.
+   is
+      Item          : Column_Text_Ptr;
+      First_New_Row : Natural;
+   begin
+      for Col in 1 .. Output_Object.Column_Count loop
+         Item := Output_Object.Column_Text (Col);
+         if Item = null then
+            First_New_Row := 1;
+         else
+            First_New_Row := Item.Row + 1;
+         end if;
+
+         for I in First_New_Row .. Output_Object.Max_Row loop
+            Output_Object.Column_Text (Col) :=
+              new Column_Text_Item_Type'
+              (Text   => (others => ' '),
+               Length => 1,
+               Row    => I,
+               Next   => Output_Object.Column_Text (Col));
+         end loop;
+      end loop;
+   end Pad_Columns;
+
+   procedure Output_Column_Widths (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      New_Line (Output_Object.File);
+      Put (Output_Object.File, "@multitable ");
+      for I in 1 .. Output_Object.Column_Count loop
+         Put
+           (Output_Object.File,
+            " {" &
+              String'(1 .. Output_Object.Column_Widths (I) => 'w') &
+              "}");
+      end loop;
+   end Output_Column_Widths;
+
+   procedure Output_Columns (Output_Object : in out Texinfo_Output_Type)
+   is
+      Row  : Natural         := 1;
+      Item : Column_Text_Ptr;
+      Temp : Column_Text_Ptr;
+   begin
+      Rows :
+      loop
+         New_Line (Output_Object.File);
+         Put (Output_Object.File, "@item ");
+
+         --  For all columns, output the items for this row. Note that
+         --  the last row is at the front of each column list; the
+         --  first row is at the end. We delete the rows as we output
+         --  them, so the one we want is always at the end of the
+         --  column list.
+         Columns :
+         for Col in 1 .. Output_Object.Column_Count loop
+            Item := Output_Object.Column_Text (Col);
+
+            if Item = null then
+               --  Previously finished column
+               null;
+
+            elsif Item.Next = null then
+               --  This is the last item in the column.
+               if Item.Row /= Row then
+                  --  This column is empty for this row.
+                  Item := null;
+               else
+                  --  Output Item, and mark that we're done outputing
+                  --  this column.
+                  Output_Object.Column_Text (Col) := null;
+               end if;
+            else
+               --  Find first item for this row in the column.
+               while Item.Next /= null and then Item.Next.Row /= Row loop
+                  Item := Item.Next;
+               end loop;
+
+               --  Output Item.Next, take it out of list.
+               Temp      := Item;
+               Item      := Item.Next;
+               Temp.Next := null;
+            end if;
+
+            if Item /= null then
+               --  Output the item
+               Escape_Put (Output_Object, Item.Text (1 .. Item.Length), Preserve_Space => True);
+               Free (Item);
+
+               if Col /= Output_Object.Column_Count then
+                  Put (Output_Object.File, " @tab ");
+               end if;
+
+            else
+               --  This column is empty for this row
+               if Col < Output_Object.Column_Count then
+                  Put (Output_Object.File, " @tab ");
+               end if;
+            end if;
+         end loop Columns;
+
+         if Output_Object.Column_Text = Column_Text_Ptrs_Type'(others => null) then
+            --  We've output everything.
+            exit Rows;
+         end if;
+
+         --  End the row:
+         Row := Row + 1;
+      end loop Rows;
+   end Output_Columns;
+
+   procedure Index_Menu (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      Put_Line (Output_Object.File, "@menu");
+      Put_Line (Output_Object.File, "* operators::");
+      Put_Line (Output_Object.File, "* A::");
+      Put_Line (Output_Object.File, "* B::");
+      Put_Line (Output_Object.File, "* C::");
+      Put_Line (Output_Object.File, "* D::");
+      Put_Line (Output_Object.File, "* E::");
+      Put_Line (Output_Object.File, "* F::");
+      Put_Line (Output_Object.File, "* G::");
+      Put_Line (Output_Object.File, "* H::");
+      Put_Line (Output_Object.File, "* I::");
+      Put_Line (Output_Object.File, "* J::");
+      Put_Line (Output_Object.File, "* K::");
+      Put_Line (Output_Object.File, "* L::");
+      Put_Line (Output_Object.File, "* M::");
+      Put_Line (Output_Object.File, "* N::");
+      Put_Line (Output_Object.File, "* O::");
+      Put_Line (Output_Object.File, "* P::");
+      Put_Line (Output_Object.File, "* Q::");
+      Put_Line (Output_Object.File, "* R::");
+      Put_Line (Output_Object.File, "* S::");
+      Put_Line (Output_Object.File, "* T::");
+      Put_Line (Output_Object.File, "* U::");
+      Put_Line (Output_Object.File, "* V::");
+      Put_Line (Output_Object.File, "* W::");
+      Put_Line (Output_Object.File, "* X::");
+      Put_Line (Output_Object.File, "* Y::");
+      --  Put_Line (Output_Object.File, "* Z::"); --  VERSION: No entries in Z
+      Put_Line (Output_Object.File, "@end menu");
+
+      --  @node current, next, prev, up
+      Put_Line
+        (Output_Object.File,
+         "@node " & Operators_Clause &
+           ", A, " & Index_Clause_Name &
+           ", " & Index_Clause_Name);
+
+      Put_Line (Output_Object.File, "@section operators");
+   end Index_Menu;
+
+   ----------
+   --  Public subprograms. Alphabetical order
+
+   procedure AI_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      AI_Number     : in     String)
+   is begin
+      Ordinary_Text (Output_Object, AI_Number & Text);
+   end AI_Reference;
+
+   procedure Category_Header
+     (Output_Object : in out Texinfo_Output_Type;
+      Header_Text   :        String)
+   is begin
+      Check_Not_In_Paragraph (Output_Object);
+
+      --  Can't be in a multi-column setting.
+      --
+      --  Don't use @heading; that causes a weird underline in info,
+      --  that isn't centered!
+      Put_Line (Output_Object.File, "@center @emph{" & Header_Text & "}");
+      New_Line (Output_Object.File, 2);
+   end Category_Header;
+
+   procedure Clause_Header
+     (Output_Object : in out Texinfo_Output_Type;
+      Header_Text   : in     String;
+      Level         : in     ARM_Contents.Level_Type;
+      Clause_Number : in     String;
+      No_Page_Break : in     Boolean                 := False)
+   is
+      pragma Unreferenced (No_Page_Break);
+      Title : constant String := Clause_Number & " " & Header_Text;
+
+      use ARM_Contents;
+
+      Section_Number : Section_Number_Type;
+      Clause_Integer : Natural;
+
+      procedure Put_Clause_Menu_Item
+        (Item_Title         : in     Title_Type;
+         Item_Level         : in     Level_Type;
+         Item_Clause_Number : in     Clause_Number_Type;
+         Version            : in     ARM_Contents.Change_Version_Type;
+         Quit               :    out Boolean)
+      is
+         pragma Unreferenced (Version); --  only version 2
+         First_Part : String (1 .. 14); --  Get all Titles aligned.
+      begin
+         Quit := False;
+
+         case Item_Level is
+         when Section | Unnumbered_Section | Normative_Annex | Informative_Annex | Subclause | Subsubclause =>
+            --  We are doing Clause here
+            null;
+
+         when Clause  =>
+            if Item_Clause_Number.Section < Section_Number then
+               null;
+
+            elsif Item_Clause_Number.Section = Section_Number then
+               Ada.Strings.Fixed.Move
+                 (Source =>
+                    "* " &
+                    Make_Clause_Number (Item_Level, Item_Clause_Number) &
+                    " ::",
+                  Target => First_Part);
+
+               Put_Line (Output_Object.File, First_Part & Item_Title);
+            else
+               Quit := True;
+            end if;
+         end case;
+      end Put_Clause_Menu_Item;
+
+      procedure Put_Clause_Menu is new For_Each (Put_Clause_Menu_Item);
+
+      procedure Put_Subclause_Menu_Item
+        (Item_Title         : in     Title_Type;
+         Item_Level         : in     Level_Type;
+         Item_Clause_Number : in     Clause_Number_Type;
+         Version            : in     ARM_Contents.Change_Version_Type;
+         Quit               :    out Boolean)
+      is
+         pragma Unreferenced (Version); --  only version 2
+         First_Part : String (1 .. 14); --  Get all Titles aligned.
+      begin
+         Quit := False;
+
+         case Item_Level is
+            when Section | Unnumbered_Section | Normative_Annex | Informative_Annex | Clause | Subsubclause =>
+               --  We are doing Subclause here
+               null;
+
+         when Subclause  =>
+            if Item_Clause_Number.Section < Section_Number then
+               null;
+
+            elsif Item_Clause_Number.Section = Section_Number then
+               if Item_Clause_Number.Clause < Clause_Integer then
+                  null;
+
+               elsif Item_Clause_Number.Clause = Clause_Integer then
+                  Ada.Strings.Fixed.Move
+                    (Source =>
+                       "* " &
+                       Make_Clause_Number (Item_Level, Item_Clause_Number) &
+                       " ::",
+                     Target => First_Part);
+
+                  Put_Line (Output_Object.File, First_Part & Item_Title);
+               else
+                  Quit := True;
+               end if;
+            else
+               Quit := True;
+            end if;
+         end case;
+      end Put_Subclause_Menu_Item;
+
+      procedure Put_Subclause_Menu is new For_Each (Put_Subclause_Menu_Item);
+
+      function Safe_Next_Clause (Clause : in String) return String
+      is begin
+         if Clause = Index_Clause then
+            return Index_Clause_Next;
+         else
+            declare
+               Result : constant String := ARM_Contents.Next_Clause (Clause);
+            begin
+               if Result = Index_Clause then
+                  return Index_Clause_Name;
+               else
+                  return Result;
+               end if;
+            end;
+         end if;
+      exception
+      when Not_Found_Error =>
+         return "";
+      end Safe_Next_Clause;
+
+      function Safe_Previous_Clause (Clause : in String) return String
+      is begin
+         return ARM_Contents.Previous_Clause (Clause);
+      exception
+      when Not_Found_Error =>
+         return "";
+      end Safe_Previous_Clause;
+
+      function Safe_Parent_Clause (Clause : in String) return String
+      is
+         Temp : constant String := ARM_Contents.Parent_Clause (Clause_Number);
+      begin
+         if Temp'Length = 0 or Temp = "0" then
+            return "Top";
+         else
+            return Temp;
+         end if;
+      end Safe_Parent_Clause;
+
+   begin
+      Check_Not_In_Paragraph (Output_Object);
+
+      --  Handle special cases
+      if Clause_Number = "" and Header_Text = "Table of Contents" then
+         --  Actual contents output in TOC_Marker below.
+         return;
+
+      elsif Header_Text = "The Standard Libraries" then
+         --  This section has no content; don't confuse makeinfo.
+         return;
+
+      elsif Clause_Number = Index_Clause and Header_Text = Index_Clause_Name then
+
+         Put_Line
+           (Output_Object.File,
+            "@node " & Index_Clause_Name &
+              ", " & Index_Clause_Next &
+              ", " & Safe_Previous_Clause (Clause_Number) &
+              ", " & Safe_Parent_Clause (Clause_Number));
+
+         Put_Line (Output_Object.File, "@chapter Index");
+         Output_Object.State := Index_Start;
+
+         return;
+      end if;
+
+      case Level is
+      when Section | Normative_Annex | Informative_Annex =>
+         --  Menu of these done at @node Top
+         null;
+
+      when Unnumbered_Section =>
+         --  Unnumbered sections are not in ARM_Contents, but there's
+         --  currently only one of them, so they are not worth adding;
+         --  just hard-code the menu here.
+         Get_Clause_Section (Clause_Number, Section_Number, Clause_Integer);
+
+         if Section_Number = 0 and Clause_Integer = 1 then
+            Put_Line (Output_Object.File, "@menu");
+            Put_Line (Output_Object.File, "* 0.1 :: Foreword to this version of the Ada Reference Manual");
+            Put_Line (Output_Object.File, "* 0.2 :: Foreword");
+            Put_Line (Output_Object.File, "* 0.3 :: Introduction");
+            Put_Line (Output_Object.File, "* 0.99 :: International Standard");
+            Put_Line (Output_Object.File, "@end menu");
+         end if;
+
+      when Clause =>
+         --  Output menu of Clauses in this section, if we haven't already
+         Get_Clause_Section (Clause_Number, Section_Number, Clause_Integer);
+
+         if Output_Object.Menu_Section /= Section_Number then
+            Put_Line (Output_Object.File, "@menu");
+            Put_Clause_Menu;
+            Put_Line (Output_Object.File, "@end menu");
+            Output_Object.Menu_Section := Section_Number;
+            Output_Object.Menu_Clause  := 0;
+         end if;
+
+      when Subclause =>
+         --  Output menu of Subclauses in this Clause, if we haven't already
+         Get_Clause_Section (Clause_Number, Section_Number, Clause_Integer);
+
+         if Output_Object.Menu_Section = Section_Number and
+           Output_Object.Menu_Clause /= Clause_Integer
+         then
+            Put_Line (Output_Object.File, "@menu");
+            Put_Subclause_Menu;
+            Put_Line (Output_Object.File, "@end menu");
+            Output_Object.Menu_Clause := Clause_Integer;
+         end if;
+
+      when Subsubclause =>
+         Put_Line (Output_Object.File, "FIXME: Clause_Header: Subsubclause");
+      end case;
+
+      Put_Line
+        (Output_Object.File,
+         "@node " & Clause_Number &
+           ", " & Safe_Next_Clause (Clause_Number) &
+           ", " & Safe_Previous_Clause (Clause_Number) &
+           ", " & Safe_Parent_Clause (Clause_Number));
+
+      case Level is
+      when Section =>
+         Put_Line (Output_Object.File, "@chapter " & Title);
+
+      when Normative_Annex | Informative_Annex =>
+         Put_Line (Output_Object.File, "@chapter " & Title);
+
+      when Clause | Unnumbered_Section =>
+         Put_Line (Output_Object.File, "@section " & Title);
+
+      when Subclause =>
+         Put_Line (Output_Object.File, "@subsection " & Title);
+
+      when Subsubclause =>
+         Put_Line (Output_Object.File, "@subsubsection " & Title);
+
+      end case;
+
+   end Clause_Header;
+
+   procedure Clause_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Clause_Number : in     String)
+   is begin
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Multi_Column | Table_Header =>
+         --  If this happens, we need to store escaped text in columns.
+         Ada.Exceptions.Raise_Exception
+           (ARM_Output.Not_Valid_Error'Identity,
+            "clause reference in multi-column");
+
+      when Normal =>
+         if Text = Clause_Number then
+            Put
+              (Output_Object.File,
+               "@ref{" &
+                 Clause_Number &
+                 "}");
+         else
+            Put
+              (Output_Object.File,
+               "@ref{" &
+                 Clause_Number &
+                 "} " &
+                 Text);
+         end if;
+
+      when Title | Index_Start | Index =>
+         Unexpected_State (Output_Object);
+
+      end case;
+   end Clause_Reference;
+
+   procedure Close (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      Check_Valid (Output_Object);
+
+      Put_Line (Output_Object.File, "@bye");
+
+      Close (Output_Object.File);
+
+      Output_Object.Is_Valid := False;
+   end Close;
+
+   procedure Create
+     (Output_Object : in out Texinfo_Output_Type;
+      File_Prefix   : in     String;
+      Title         : in     String)
+   is
+      File_Name : constant String := Ada.Strings.Fixed.Trim (File_Prefix & ".texinfo", Ada.Strings.Right);
+   begin
+      if Output_Object.Is_Valid then
+         Ada.Exceptions.Raise_Exception
+           (ARM_Output.Not_Valid_Error'Identity,
+            "Already valid object");
+      end if;
+
+      Output_Object.Is_Valid := True;
+
+      Create (Output_Object.File, Out_File, File_Name);
+
+      Put_Line (Output_Object.File, "\input texinfo");
+      Put_Line (Output_Object.File, "@settitle " & Title);
+      Put_Line (Output_Object.File, "@paragraphindent none");
+      Put_Line (Output_Object.File, "@exampleindent" & Integer'Image (Indentation));
+
+      Put_Line (Output_Object.File, "@node Top");
+      Put_Line (Output_Object.File, "@top " & Title);
+
+      Output_Object.State           := ARM_Texinfo.Title;
+      Output_Object.First_Word_Last := 0;
+
+   end Create;
+
+   procedure DR_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      DR_Number     : in     String)
+   is begin
+      Ordinary_Text (Output_Object, DR_Number & Text);
+   end DR_Reference;
+
+   procedure End_Hang_Item (Output_Object : in out Texinfo_Output_Type)
+   is
+      use ARM_Output;
+   begin
+      case Output_Object.Paragraph_Format is
+      when
+        Swiss_Examples | Small_Swiss_Examples |
+        Swiss_Indented_Examples | Small_Swiss_Indented_Examples |
+        Small_Syntax_Indented |
+        Nested_X2_Bulleted | Small_Nested_X2_Bulleted |
+        Indented_Nested_Bulleted |
+        Inner_Indented | Small_Inner_Indented =>
+         Put_Line
+           (Output_Object.File,
+            "FIXME: End_Hang_Item: hanging? "& Paragraph_Type'Image (Output_Object.Paragraph_Format));
+
+      when Normal |
+        Wide |
+        Notes |
+        Notes_Header |
+        Annotations |
+        Wide_Annotations |
+        Index |
+        Syntax_Summary |
+        Examples |
+        Small_Examples |
+        Indented_Examples |
+        Small_Indented_Examples |
+        Syntax_Indented |
+        Code_Indented |
+        Small_Code_Indented |
+        Indented |
+        Small_Indented |
+        Bulleted |
+        Nested_Bulleted |
+        Small_Bulleted |
+        Small_Nested_Bulleted |
+        Indented_Bulleted |
+        Code_Indented_Bulleted |
+        Code_Indented_Nested_Bulleted |
+        Syntax_Indented_Bulleted |
+        Notes_Bulleted |
+        Notes_Nested_Bulleted =>
+
+         null;
+
+      when Hanging |
+        Small_Hanging |
+        Indented_Hanging |
+        Small_Indented_Hanging |
+        Hanging_in_Bulleted |
+        Small_Hanging_in_Bulleted =>
+
+         --  End of term in definition list; indent rest of paragraph.
+         --  But sometimes we never get an "end_hang_item" in a
+         --  hanging paragraph, so let End_Paragraph know we got one
+         --  this time.
+         Output_Object.End_Hang_Seen := True;
+
+         New_Line (Output_Object.File);
+         Put_Line (Output_Object.File, "@quotation");
+
+      when Enumerated |
+        Small_Enumerated |
+        Nested_Enumerated |
+        Small_Nested_Enumerated =>
+
+         --  Number has just been output; start text.
+         Put (Output_Object.File, "@w{  }");
+
+      end case;
+
+   end End_Hang_Item;
+
+   procedure End_Paragraph (Output_Object : in out Texinfo_Output_Type)
+   is
+      use ARM_Output;
+   begin
+      Output_Object.In_Paragraph := False;
+
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Multi_Column =>
+         --  Skip a row, to separate paragraphs in a column.
+         Output_Object.Current_Row := Output_Object.Current_Row + 2;
+
+      when Title =>
+         if Output_Object.Line_Empty then
+            null;
+         else
+            New_Line (Output_Object.File, 2);
+            Put (Output_Object.File, "@center ");
+            Output_Object.Line_Empty := True;
+         end if;
+
+      when Normal =>
+         case Output_Object.Paragraph_Format is
+         when
+           Swiss_Examples | Small_Swiss_Examples |
+           Swiss_Indented_Examples | Small_Swiss_Indented_Examples |
+           Small_Syntax_Indented |
+           Small_Nested_X2_Bulleted |
+           Small_Inner_Indented =>
+            Put_Line
+              (Output_Object.File, "FIXME : End_Paragraph: " & Paragraph_Type'Image (Output_Object.Paragraph_Format));
+
+         when Normal |
+           Wide |
+           Index =>
+
+            New_Line (Output_Object.File, 2);
+
+         when Notes |
+           Syntax_Summary |
+           Syntax_Indented =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end quotation");
+            New_Line (Output_Object.File);
+
+         when Annotations |
+           Wide_Annotations |
+           Code_Indented |
+           Small_Code_Indented |
+           Inner_Indented |
+           Indented |
+           Small_Indented =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end quotation");
+            Put_Line (Output_Object.File, "@end quotation");
+            New_Line (Output_Object.File);
+
+         when Examples |
+           Small_Examples =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end example");
+            New_Line (Output_Object.File);
+
+         when Indented_Examples |
+           Small_Indented_Examples =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end example");
+            Put_Line (Output_Object.File, "@end quotation");
+            New_Line (Output_Object.File);
+
+         when Notes_Header =>
+            New_Line (Output_Object.File, 2);
+
+         when Bulleted |
+           Small_Bulleted =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            New_Line (Output_Object.File);
+
+         when Nested_Bulleted |
+           Small_Nested_Bulleted =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end itemize");
+            New_Line (Output_Object.File);
+
+         when Nested_X2_Bulleted =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end itemize");
+            New_Line (Output_Object.File);
+
+         when Indented_Bulleted |
+           Code_Indented_Bulleted |
+           Notes_Bulleted =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end quotation");
+            New_Line (Output_Object.File);
+
+         when Code_Indented_Nested_Bulleted |
+           Indented_Nested_Bulleted |
+           Notes_Nested_Bulleted =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end quotation");
+            New_Line (Output_Object.File);
+
+         when Syntax_Indented_Bulleted =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            Put_Line (Output_Object.File, "@end quotation");
+            New_Line (Output_Object.File);
+
+         when Hanging |
+           Small_Hanging |
+           Indented_Hanging |
+           Small_Indented_Hanging |
+           Hanging_in_Bulleted |
+           Small_Hanging_in_Bulleted =>
+
+            New_Line (Output_Object.File);
+            if Output_Object.End_Hang_Seen then
+               Put_Line (Output_Object.File, "@end quotation");
+            end if;
+            New_Line (Output_Object.File);
+
+         when Enumerated |
+           Small_Enumerated |
+           Nested_Enumerated |
+           Small_Nested_Enumerated =>
+
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end itemize");
+            New_Line (Output_Object.File);
+         end case;
+
+      when Index_Start =>
+         Output_Object.State := Index;
+
+         Index_Menu (Output_Object);
+
+      when Index =>
+         --  Keep index items tightly grouped.
+         Put_Line (Output_Object.File, "@*");
+
+      when Table_Header =>
+         Unexpected_State (Output_Object);
+
+      end case;
+   end End_Paragraph;
+
+   procedure Hard_Space (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Multi_Column | Table_Header =>
+         --  Can't do line breaks in columns
+         Add_To_Column_Item (Output_Object, " ");
+
+      when Title =>
+         if Output_Object.Line_Empty then
+            null;
+         else
+            Put (Output_Object.File, "@w{ }");
+         end if;
+
+      when Normal | Index_Start | Index =>
+         Put (Output_Object.File, "@w{ }");
+      end case;
+   end Hard_Space;
+
+   procedure Index_Line_Break
+     (Output_Object        : in out Texinfo_Output_Type;
+      Clear_Keep_with_Next : in     Boolean)
+   is
+      pragma Unreferenced (Clear_Keep_with_Next);
+   begin
+      Put_Line (Output_Object.File, "@*");
+   end Index_Line_Break;
+
+   procedure Index_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Index_Key     : in     Natural;
+      Clause_Number : in     String)
+   is
+      pragma Unreferenced (Clause_Number);
+      --  Text is clause_number & paragraph number (optional).
+   begin
+      Put (Output_Object.File, "@ref{" & Integer'Image (Index_Key) & ", " & Text & "}");
+   end Index_Reference;
+
+   procedure Index_Target
+     (Output_Object : in out Texinfo_Output_Type;
+      Index_Key     : in     Natural)
+   is begin
+      Put (Output_Object.File, "@anchor{" & Integer'Image (Index_Key) & "}");
+   end Index_Target;
+
+   procedure Line_Break (Output_Object : in out Texinfo_Output_Type)
+   is
+      use ARM_Output;
+   begin
+      case Output_Object.State is
+      when Title =>
+         if Output_Object.Line_Empty then
+            null;
+         else
+            Put_Line (Output_Object.File, "@*");
+            Output_Object.Line_Empty := True;
+         end if;
+
+      when Contents =>
+         null;
+
+      when Multi_Column | Table_Header =>
+         Output_Object.Current_Row := Output_Object.Current_Row + 1;
+         if Output_Object.Max_Row < Output_Object.Current_Row then
+            Output_Object.Max_Row := Output_Object.Current_Row;
+         end if;
+
+      when Index_Start =>
+         --  This doesn't happen
+         Put_Line (Output_Object.File, "FIXME: Line_Break Index_Start");
+
+      when Normal | Index =>
+         case Output_Object.Paragraph_Format is
+         when
+           Swiss_Examples | Small_Swiss_Examples |
+           Swiss_Indented_Examples | Small_Swiss_Indented_Examples |
+           Small_Syntax_Indented |
+           Nested_X2_Bulleted |
+           Small_Nested_X2_Bulleted | Indented_Nested_Bulleted |
+           Inner_Indented | Small_Inner_Indented =>
+            Put_Line
+              (Output_Object.File, "FIXME: Line_Break: "& Paragraph_Type'Image (Output_Object.Paragraph_Format));
+
+         when Normal |
+           Wide |
+           Notes |
+           Notes_Header |
+           Annotations |
+           Wide_Annotations |
+           Index |
+           Syntax_Summary |
+           Syntax_Indented |
+           Code_Indented |
+           Small_Code_Indented |
+           Indented |
+           Small_Indented |
+           Bulleted |
+           Nested_Bulleted |
+           Small_Bulleted |
+           Small_Nested_Bulleted |
+           Indented_Bulleted |
+           Code_Indented_Bulleted |
+           Code_Indented_Nested_Bulleted |
+           Syntax_Indented_Bulleted |
+           Notes_Bulleted |
+           Notes_Nested_Bulleted |
+           Hanging |
+           Small_Hanging |
+           Indented_Hanging |
+           Small_Indented_Hanging |
+           Hanging_in_Bulleted |
+           Small_Hanging_in_Bulleted |
+           Enumerated |
+           Small_Enumerated |
+           Nested_Enumerated |
+           Small_Nested_Enumerated =>
+
+            Put_Line (Output_Object.File, "@*");
+
+         when Examples |
+           Small_Examples |
+           Indented_Examples |
+           Small_Indented_Examples =>
+
+            New_Line (Output_Object.File);
+
+         end case;
+
+      end case;
+   end Line_Break;
+
+   procedure Local_Link
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Target        : in     String;
+      Clause_Number : in     String)
+   is
+      pragma Unreferenced (Target);
+      pragma Unreferenced (Clause_Number);
+   begin
+      --  These are typically references to words in the grammar
+      --  summary. Mildly useful, but the best we can do is:
+      --
+      --  "@ref{" & Target & "," & Text & "}"
+      --
+      --  makeinfo prepends 'see' and postpends '.', so it screws up
+      --  the text. For example, section 2.1 (1) ends up with "the
+      --  @ref{S0229, compilation}s." => "the see compilation: S0229."
+      --  Emacs info-mode suppresses the ': S0229', but not the 'see'
+      --  and the trailing '.'. So we just output the text.
+      Ordinary_Text (Output_Object, Text);
+   end Local_Link;
+
+   procedure Local_Link_End
+     (Output_Object : in out Texinfo_Output_Type;
+      Target        : in     String;
+      Clause_Number : in     String)
+   is begin
+      --  These work better than local links, because they are not in
+      --  the middle of plurals. First use is section 3.1 (1).
+      Put (Output_Object.File, " (@pxref{" & Target & "," & Clause_Number & "})");
+   end Local_Link_End;
+
+   procedure Local_Link_Start
+     (Output_Object : in out Texinfo_Output_Type;
+      Target        : in     String;
+      Clause_Number : in     String)
+   is
+      pragma Unreferenced (Output_Object);
+      pragma Unreferenced (Target);
+      pragma Unreferenced (Clause_Number);
+   begin
+      --  implemented in Local_Link_End
+      null;
+   end Local_Link_Start;
+
+   procedure Local_Target
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Target        : in     String)
+   is begin
+      Put (Output_Object.File, "@anchor{" & Target & "}");
+      Ordinary_Text (Output_Object, Text);
+   end Local_Target;
+
+   procedure New_Column (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      if Output_Object.Column_Count >= 4 then
+         Output_Object.Current_Column := Output_Object.Current_Column + 1;
+         Output_Object.Current_Row    := 1;
+      end if;
+   end New_Column;
+
+   procedure New_Page
+     (Output_Object : in out Texinfo_Output_Type;
+      Kind          :        ARM_Output.Page_Kind_Type := ARM_Output.Any_Page)
+   is
+      pragma Unreferenced (Kind);
+      pragma Unreferenced (Output_Object);
+   begin
+      --  No such thing in Info.
+      null;
+   end New_Page;
+
+   procedure Ordinary_Character
+     (Output_Object : in out Texinfo_Output_Type;
+      Char          : in     Character)
+   is
+      Copyright : constant String := "Copyright";
+   begin
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Multi_Column | Table_Header =>
+         Add_To_Column_Item (Output_Object, "" & Char);
+
+      when Title =>
+         --  Check for end of title page; indicated by line starting with "Copyright"
+         if Output_Object.Line_Empty then
+            if Output_Object.First_Word_Last > 0 then
+               if Copyright (Output_Object.First_Word_Last + 1) = Char then
+                  Output_Object.First_Word_Last := Output_Object.First_Word_Last + 1;
+                  Output_Object.First_Word (Output_Object.First_Word_Last) := Char;
+
+                  if Output_Object.First_Word_Last = Copyright'Last then
+                     End_Title_Page (Output_Object);
+                     Output_Object.State := Normal;
+                     Ordinary_Text (Output_Object, Output_Object.First_Word (1 .. Output_Object.First_Word_Last));
+                  end if;
+               else
+                  --  First word is not Copyright; output it
+                  Ordinary_Text (Output_Object, Output_Object.First_Word (1 .. Output_Object.First_Word_Last));
+                  Output_Object.Line_Empty := False;
+               end if;
+            else
+               --  No non-space seen yet
+               if Char = ' ' then
+                  null;
+               elsif Char = Copyright (1) then
+                  Output_Object.First_Word_Last := 1;
+                  Output_Object.First_Word (1)  := Char;
+               else
+                  Escape_Put (Output_Object, Char);
+                  Output_Object.Line_Empty := False;
+               end if;
+            end if;
+         else
+            --  Line already has stuff on it
+            Escape_Put (Output_Object, Char);
+         end if;
+
+      when Normal =>
+         Output_Object.Line_Empty := Char /= ' ';
+
+         Escape_Put (Output_Object, Char);
+
+      when Index_Start =>
+         Escape_Put (Output_Object, Char);
+         if Char = '&' then
+            --  give debugger a place to break
+            Put_Line ("first index entry");
+         end if;
+
+      when Index =>
+         case Char is
+         when ' ' | ',' | '[' | ']' =>
+            Put (Output_Object.File, Char);
+
+         when 'A' .. Last_Index_Clause =>
+            --  Index section heading
+
+            --  @node current, next, prev, up
+            case Char is
+            when 'A' =>
+               Put_Line
+                 (Output_Object.File,
+                  "@node " & Char &
+                    ", B, " & Operators_Clause &
+                    ", " & Index_Clause_Name);
+
+            when Last_Index_Clause =>
+               Put_Line
+                 (Output_Object.File,
+                  "@node " & Char &
+                    ", , " & Character'Pred (Char) &
+                    ", " & Index_Clause_Name);
+
+            when others =>
+               Put_Line
+                 (Output_Object.File,
+                  "@node " & Char &
+                    ", " & Character'Succ (Char) &
+                    ", " & Character'Pred (Char) &
+                    ", " & Index_Clause_Name);
+            end case;
+
+            --  Add non-break space so Emacs info will use big bold
+            --  font for single letter titles.
+            Put_Line (Output_Object.File, "@section " & Char & "@w{ }");
+
+         when others =>
+            Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity, "Unexpected char in Index: " & Char);
+         end case;
+      end case;
+   end Ordinary_Character;
+
+   procedure Ordinary_Text
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String)
+   is begin
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Multi_Column | Table_Header =>
+         Add_To_Column_Item (Output_Object, Text);
+
+      when Normal | Title | Index_Start | Index =>
+         Output_Object.Line_Empty := False;
+
+         Escape_Put (Output_Object, Text);
+      end case;
+   end Ordinary_Text;
+
+   procedure Picture
+     (Output_Object : in out Texinfo_Output_Type;
+      Name          : in     String;
+      Descr         : in     String;
+      Alignment     : in     ARM_Output.Picture_Alignment;
+      Height, Width : in     Natural;
+      Border        : in     ARM_Output.Border_Kind)
+   is
+      pragma Unreferenced (Border);
+      pragma Unreferenced (Width);
+      pragma Unreferenced (Height);
+      pragma Unreferenced (Alignment);
+      pragma Unreferenced (Name);
+   begin
+      Put_Line (Output_Object.File, "FIXME: Picture: " & Descr);
+   end Picture;
+
+   procedure Revised_Clause_Header
+     (Output_Object   : in out Texinfo_Output_Type;
+      New_Header_Text : in     String;
+      Old_Header_Text : in     String;
+      Level           : in     ARM_Contents.Level_Type;
+      Clause_Number   : in     String;
+      Version         : in     ARM_Contents.Change_Version_Type;
+      No_Page_Break   : in     Boolean                          := False)
+   is
+      pragma Unreferenced (Version);
+      pragma Unreferenced (Old_Header_Text);
+   begin
+      Clause_Header (Output_Object, New_Header_Text, Level, Clause_Number, No_Page_Break);
+   end Revised_Clause_Header;
+
+   procedure Section
+     (Output_Object : in out Texinfo_Output_Type;
+      Section_Title : in     String;
+      Section_Name  : in     String)
+   is
+      pragma Unreferenced (Section_Name);
+      pragma Unreferenced (Section_Title);
+      pragma Unreferenced (Output_Object);
+   begin
+      --  This is redundant with the various Clause functions
+      null;
+   end Section;
+
+   procedure Separator_Line
+     (Output_Object : in out Texinfo_Output_Type;
+      Is_Thin       :        Boolean             := True)
+   is begin
+      --  Can't be in a multi-column setting.
+      New_Line (Output_Object.File);
+      if Is_Thin then
+         Put_Line (Output_Object.File, "----------");
+      else
+         Put_Line (Output_Object.File, "==========");
+      end if;
+   end Separator_Line;
+
+   procedure Set_Columns
+     (Output_Object     : in out Texinfo_Output_Type;
+      Number_of_Columns : in     ARM_Output.Column_Count)
+   is begin
+      Check_Valid (Output_Object);
+      Check_Not_In_Paragraph (Output_Object);
+
+      --  2 and 3 column formats are displayed without any columns.
+      --  This is mainly used for the syntax cross-reference and
+      --  index, and these definitely look better without columns.
+      --
+      --  4 or more columns are output as a table. Note that we assume
+      --  such items are formated with explicit New_Column calls, and
+      --  do not contain any nested paragraph formats.
+
+      case Output_Object.State is
+      when Normal =>
+         if Number_of_Columns >= 4 then
+            Output_Object.State          := Multi_Column;
+            Output_Object.Current_Column := 1;
+            Output_Object.Current_Row    := 1;
+            Output_Object.Column_Widths  := (others => 0);
+
+            --  Accumulate all column rows in Output_Text, then output
+            --  when done, so we can set the correct column width in
+            --  the header. Each column is a linked list of allocated
+            --  Column_Text_Item_Type.
+         else
+            null;
+         end if;
+
+      when Multi_Column =>
+         if Number_of_Columns = 1 then
+            --  Finished accumulating columns, output the columns as a table.
+            Output_Column_Widths (Output_Object);
+            Output_Columns (Output_Object);
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end multitable");
+            New_Line (Output_Object.File);
+
+            Output_Object.State := Normal;
+         else
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity, "New multi-column section before end of old");
+         end if;
+
+      when Index_Start | Index =>
+         null;
+
+      when Table_Header | Contents | Title =>
+         Unexpected_State (Output_Object);
+      end case;
+
+      Output_Object.Column_Count := Number_of_Columns;
+   end Set_Columns;
+
+   procedure Soft_Hyphen_Break (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      Put (Output_Object.File, "@-");
+   end Soft_Hyphen_Break;
+
+   procedure Soft_Line_Break (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      case Output_Object.State is
+      when Contents | Title =>
+         null;
+
+      when Normal | Index_Start | Index =>
+         Put (Output_Object.File, "@-");
+
+      when Multi_Column | Table_Header =>
+         Unexpected_State (Output_Object);
+
+      end case;
+   end Soft_Line_Break;
+
+   procedure Special_Character
+     (Output_Object : in out Texinfo_Output_Type;
+      Char          : in     ARM_Output.Special_Character_Type)
+   is begin
+      --  We use Ordinary_Text, so this is output to columns when appropriate.
+      case Char is
+      when ARM_Output.EM_Dash =>
+         Ordinary_Text (Output_Object, "--");
+      when ARM_Output.EN_Dash =>
+         Ordinary_Text (Output_Object, "--");
+      when ARM_Output.GEQ =>
+         Ordinary_Text (Output_Object, ">=");
+      when ARM_Output.LEQ =>
+         Ordinary_Text (Output_Object, "<=");
+      when ARM_Output.NEQ =>
+         Ordinary_Text (Output_Object, "/=");
+      when ARM_Output.PI =>
+         Ordinary_Text (Output_Object, "PI");
+
+      when ARM_Output.Left_Ceiling =>
+         case Output_Object.State is
+         when Multi_Column | Table_Header =>
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity,
+               "Info does not support ceiling in multi-column");
+         when Contents =>
+            null;
+
+         when Normal | Index_Start | Index =>
+            Put (Output_Object.File, "@code{ceiling(");
+
+         when Title =>
+            Unexpected_State (Output_Object);
+
+         end case;
+
+      when ARM_Output.Right_Ceiling =>
+         case Output_Object.State is
+         when Multi_Column | Table_Header =>
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity,
+               "Info does not support ceiling in multi-column");
+         when Contents =>
+            null;
+
+         when Normal | Index_Start | Index =>
+            Put (Output_Object.File, ")}");
+
+         when Title =>
+            Unexpected_State (Output_Object);
+
+         end case;
+
+      when ARM_Output.Left_Floor =>
+         case Output_Object.State is
+         when Multi_Column | Table_Header =>
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity,
+               "Info does not support floor in multi-column");
+         when Contents =>
+            null;
+
+         when Normal | Index_Start | Index =>
+            Put (Output_Object.File, "@code{floor(");
+
+         when Title =>
+            Unexpected_State (Output_Object);
+
+         end case;
+
+      when ARM_Output.Right_Floor =>
+         case Output_Object.State is
+         when Multi_Column | Table_Header =>
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity,
+               "Info does not support floor in multi-column");
+         when Contents =>
+            null;
+
+         when Normal | Index_Start | Index =>
+            Put (Output_Object.File, ")}");
+
+         when Title =>
+            Unexpected_State (Output_Object);
+
+         end case;
+
+      when ARM_Output.Thin_Space =>
+         Ordinary_Text (Output_Object, " ");
+
+      when ARM_Output.Left_Quote =>
+         Ordinary_Text (Output_Object, "`");
+
+      when ARM_Output.Right_Quote =>
+         Ordinary_Text (Output_Object, "'");
+
+      when ARM_Output.Left_Double_Quote =>
+         Ordinary_Text (Output_Object, """");
+
+      when ARM_Output.Right_Double_Quote =>
+         Ordinary_Text (Output_Object, """");
+
+      when ARM_Output.Small_Dotless_I =>
+         Ordinary_Text (Output_Object, "i");
+
+      when ARM_Output.Capital_Dotted_I =>
+         Ordinary_Text (Output_Object, "I");
+      end case;
+   end Special_Character;
+
+   procedure Start_Paragraph
+     (Output_Object  : in out Texinfo_Output_Type;
+      Format         : in     ARM_Output.Paragraph_Type;
+      Number         : in     String;
+      No_Prefix      : in     Boolean                       := False;
+      Tab_Stops      : in     ARM_Output.Tab_Info           := ARM_Output.NO_TABS;
+      No_Breaks      : in     Boolean                       := False;
+      Keep_with_Next : in     Boolean                       := False;
+      Space_After    : in     ARM_Output.Space_After_Type   := ARM_Output.Normal;
+      Justification  : in     ARM_Output.Justification_Type := ARM_Output.Default)
+   is
+      pragma Unreferenced (Justification);
+      pragma Unreferenced (Space_After);
+      pragma Unreferenced (Keep_with_Next);
+      pragma Unreferenced (No_Breaks);
+      pragma Unreferenced (Tab_Stops);
+
+      use ARM_Output;
+
+   begin
+      Check_Valid (Output_Object);
+      Check_Not_In_Paragraph (Output_Object);
+
+      --  Note: makeinfo will do most of the formatting, so No_Breaks,
+      --  Keep_with_Next, Space_After, and Justification have no
+      --  effect here. In addition, info format has no support for
+      --  fonts, so the font aspects of Format is ignored as well. But
+      --  we try to respect the indentation and margin aspects.
+
+      --  TexInfo does not directly support tabs, but does use a fixed
+      --  font, so we could emulate them. But then we'd have to track
+      --  output characters; let's see if we really need it.
+
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Normal =>
+         if Number'Length > 0 then
+            Put_Line (Output_Object.File, Number & " @*");
+         end if;
+
+         Output_Object.In_Paragraph     := True;
+         Output_Object.Paragraph_Format := Format;
+
+         case Format is
+         when
+           Swiss_Examples | Small_Swiss_Examples |
+           Swiss_Indented_Examples | Small_Swiss_Indented_Examples |
+           Small_Syntax_Indented |
+           Small_Nested_X2_Bulleted |
+           Small_Inner_Indented =>
+            Put_Line (Output_Object.File, "FIXME: Start_Paragraph " & ARM_Output.Paragraph_Type'Image (Format));
+
+         when Normal |
+           Wide |
+           Index =>
+
+            null;
+
+         when Notes |
+           Syntax_Summary |
+           Syntax_Indented =>
+
+            Put_Line (Output_Object.File, "@quotation");
+
+         when Annotations |
+           Wide_Annotations |
+           Code_Indented |
+           Small_Code_Indented |
+           Indented |
+           Inner_Indented |
+           Small_Indented =>
+
+            Put_Line (Output_Object.File, "@quotation");
+            Put_Line (Output_Object.File, "@quotation");
+
+         when Examples |
+           Small_Examples =>
+
+            Put_Line (Output_Object.File, "@example");
+
+         when Indented_Examples |
+           Small_Indented_Examples =>
+
+            Put_Line (Output_Object.File, "@quotation");
+            Put_Line (Output_Object.File, "@example");
+
+         when Notes_Header =>
+            Put
+              (Output_Object.File,
+               "@w{" &
+                 String'(1 .. Indentation => ' ') &
+                 "}");
+
+         when Bulleted |
+           Small_Bulleted =>
+
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            if not No_Prefix then
+               Put (Output_Object.File, "@item ");
+            end if;
+
+         when Nested_Bulleted |
+           Small_Nested_Bulleted =>
+
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            if not No_Prefix then
+               Put (Output_Object.File, "@item ");
+            end if;
+
+         when Nested_X2_Bulleted =>
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            if not No_Prefix then
+               Put (Output_Object.File, "@item ");
+            end if;
+
+         when Indented_Bulleted |
+           Code_Indented_Bulleted |
+           Notes_Bulleted =>
+
+            Put_Line (Output_Object.File, "@quotation");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            if not No_Prefix then
+               Put (Output_Object.File, "@item ");
+            end if;
+
+         when Code_Indented_Nested_Bulleted |
+           Indented_Nested_Bulleted |
+           Notes_Nested_Bulleted =>
+
+            Put_Line (Output_Object.File, "@quotation");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            if not No_Prefix then
+               Put (Output_Object.File, "@item ");
+            end if;
+
+         when Syntax_Indented_Bulleted =>
+
+            Put_Line (Output_Object.File, "@quotation");
+            Put_Line (Output_Object.File, "@itemize @bullet");
+            if not No_Prefix then
+               Put (Output_Object.File, "@item ");
+            end if;
+
+         when Hanging |
+           Small_Hanging |
+           Indented_Hanging |
+           Small_Indented_Hanging |
+           Hanging_in_Bulleted |
+           Small_Hanging_in_Bulleted =>
+
+            if No_Prefix then
+               --  Still in hanging part
+               Put_Line (Output_Object.File, "@quotation");
+               Output_Object.End_Hang_Seen := True;
+            else
+               Output_Object.End_Hang_Seen := False;
+            end if;
+
+         when Enumerated |
+           Small_Enumerated |
+           Nested_Enumerated |
+           Small_Nested_Enumerated =>
+
+            Put_Line (Output_Object.File, "@itemize @w{}");
+            Put (Output_Object.File, "@item ");
+
+         end case;
+
+      when Index_Start | Index | Title | Multi_Column | Table_Header =>
+         if Number'Length > 0 then
+            Unexpected_State (Output_Object);
+         end if;
+
+         Output_Object.In_Paragraph     := True;
+         Output_Object.Paragraph_Format := Format;
+
+      end case;
+
+   end Start_Paragraph;
+
+   procedure Start_Table
+     (Output_Object      : in out Texinfo_Output_Type;
+      Columns            : in     ARM_Output.Column_Count;
+      First_Column_Width : in     ARM_Output.Column_Count;
+      Last_Column_Width  : in     ARM_Output.Column_Count;
+      Alignment          : in     ARM_Output.Column_Text_Alignment;
+      No_Page_Break      : in     Boolean;
+      Has_Border         : in     Boolean;
+      Small_Text_Size    : in     Boolean;
+      Header_Kind        : in     ARM_Output.Header_Kind_Type)
+   is
+      pragma Unreferenced (Small_Text_Size);
+      pragma Unreferenced (Has_Border);
+      pragma Unreferenced (No_Page_Break);
+      pragma Unreferenced (Alignment);
+      pragma Unreferenced (Last_Column_Width);
+      pragma Unreferenced (First_Column_Width);
+      use ARM_Output;
+   begin
+      Output_Object.Column_Count := Columns;
+      case Header_Kind is
+      when Both_Caption_and_Header =>
+         New_Line (Output_Object.File);
+         --  Next text output will be the caption, which we don't
+         --  format in any special way (first example is F.3.2 (19)).
+         --  Then Table_Marker (End_Caption) is called, which will
+         --  start the actual table.
+
+      when Header_Only =>
+         --  Same as Table_Marker, End_Caption.
+         case Columns is
+         when 1 =>
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity,
+               "Table with 1 column");
+
+         when 2 =>
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@table @asis");
+
+         when others =>
+            New_Line (Output_Object.File);
+            Put (Output_Object.File, "@multitable");
+            Output_Object.State          := Table_Header;
+            Output_Object.Current_Column := 1;
+            Output_Object.Current_Row    := 1;
+            Output_Object.Max_Row        := 0;
+            --  The next text output via Ordinary_Text or
+            --  Ordinary_Character is the table headers. We
+            --  capture them in Output_Object.Column_Text, and
+            --  use them to set the table column widths.
+         end case;
+
+      when No_Headers =>
+         null;
+
+      end case;
+   end Start_Table;
+
+   procedure Tab (Output_Object : in out Texinfo_Output_Type)
+   is begin
+      case Output_Object.State is
+      when Contents =>
+         null;
+
+      when Multi_Column | Table_Header =>
+         Ada.Exceptions.Raise_Exception
+           (ARM_Output.Not_Valid_Error'Identity,
+            "Tab in multi-column");
+
+      when Title =>
+         if Output_Object.Line_Empty then
+            null;
+         else
+            Put (Output_Object.File, "@w{ }");
+         end if;
+
+      when Normal | Index_Start | Index =>
+         --  Just three spaces for now, for indented trees
+         Put (Output_Object.File, "@w{   }");
+
+      end case;
+   end Tab;
+
+   procedure Table_Marker
+     (Output_Object : in out Texinfo_Output_Type;
+      Marker        : in     ARM_Output.Table_Marker_Type)
+   is begin
+      case Marker is
+      when ARM_Output.End_Caption =>
+         --  Start the actual table
+         case Output_Object.Column_Count is
+         when 1 =>
+            Ada.Exceptions.Raise_Exception
+              (ARM_Output.Not_Valid_Error'Identity,
+               "Table with 1 column");
+
+         when 2 =>
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@table @asis");
+
+         when others =>
+            New_Line (Output_Object.File);
+            Put (Output_Object.File, "@multitable");
+            Output_Object.State          := Table_Header;
+            Output_Object.Current_Column := 1;
+            Output_Object.Current_Row    := 1;
+            Output_Object.Max_Row        := 0;
+            --  The next text output via Ordinary_Text or
+            --  Ordinary_Character is the table headers. We
+            --  capture them in Output_Object.Column_Text, and
+            --  use them to set the table column widths.
+         end case;
+
+      when ARM_Output.End_Item =>
+         case Output_Object.State is
+         when Table_Header =>
+            Output_Object.Current_Column := Output_Object.Current_Column + 1;
+            Output_Object.Current_Row    := 1;
+
+         when Normal =>
+            case Output_Object.Column_Count is
+            when 2 =>
+               --  using @table
+               Put (Output_Object.File, ' ');
+
+            when others =>
+               Put (Output_Object.File, " @tab ");
+            end case;
+
+         when Multi_Column | Contents | Title | Index_Start | Index =>
+            Unexpected_State (Output_Object);
+         end case;
+
+      when ARM_Output.End_Header =>
+         case Output_Object.State is
+         when Table_Header =>
+            Output_Object.State := Normal;
+
+            for I in 1 .. Output_Object.Column_Count loop
+               Put
+                 (Output_Object.File,
+                  " {" &
+                    Output_Object.Column_Text (I).Text (1 .. Output_Object.Column_Text (I).Length) &
+                    "}");
+            end loop;
+
+            New_Line (Output_Object.File);
+
+            Put (Output_Object.File, "@item ");
+
+            Pad_Columns (Output_Object);
+            Output_Columns (Output_Object);
+            New_Line (Output_Object.File);
+            Put (Output_Object.File, "@item ");
+            Output_Object.Current_Column := 1;
+
+         when Normal =>
+            --  A two-column table; header has been output
+            null;
+
+         when Contents | Multi_Column | Title | Index_Start | Index =>
+            Unexpected_State (Output_Object);
+         end case;
+
+      when ARM_Output.End_Row | ARM_Output.End_Row_Next_Is_Last =>
+         New_Line (Output_Object.File);
+         Put (Output_Object.File, "@item ");
+         Output_Object.Current_Column := 1;
+
+      when ARM_Output.End_Table =>
+         case Output_Object.Column_Count is
+         when 2 =>
+            New_Line (Output_Object.File);
+            Put_Line (Output_Object.File, "@end table");
+
+         when others =>
+            Put_Line (Output_Object.File, "@end multitable");
+
+         end case;
+
+      end case;
+   end Table_Marker;
+
+   procedure Text_Format
+     (Output_Object : in out Texinfo_Output_Type;
+      Bold          : in     Boolean;
+      Italic        : in     Boolean;
+      Font          : in     ARM_Output.Font_Family_Type;
+      Size          : in     ARM_Output.Size_Type;
+      Change        : in     ARM_Output.Change_Type;
+      Version       : in     ARM_Contents.Change_Version_Type := '0';
+      Added_Version : in     ARM_Contents.Change_Version_Type := '0';
+      Location      : in     ARM_Output.Location_Type)
+   is
+      pragma Unreferenced (Location);
+      pragma Unreferenced (Version);
+      pragma Unreferenced (Added_Version);
+      pragma Unreferenced (Change);
+      pragma Unreferenced (Size);
+      pragma Unreferenced (Font);
+      pragma Unreferenced (Italic);
+      pragma Unreferenced (Bold);
+      pragma Unreferenced (Output_Object);
+   begin
+      --  Info does not support formats; Emacs info-mode font-lock
+      --  does some, but doesn't need any help from here.
+      null;
+   end Text_Format;
+
+   procedure TOC_Marker
+     (Output_Object : in out Texinfo_Output_Type;
+      For_Start     : in     Boolean)
+   is begin
+      --  We use menus, not @contents (since makeinfo ignores
+      --  @contents in info mode). The menus (including the top menu)
+      --  are generated from data stored in ARM_Contents during the
+      --  scan pass.
+
+      if For_Start then
+         Output_Object.State := Contents;
+         --  Ignore futher output until For_Start = False.
+      else
+         Output_Object.State := Normal;
+      end if;
+   end TOC_Marker;
+
+   procedure Unicode_Character
+     (Output_Object : in out Texinfo_Output_Type;
+      Char          : in     ARM_Output.Unicode_Type)
+   is begin
+      --  Used in section 2.3 Identifiers examples, 2.5 character
+      --  literals examples, 2.6 string literals examples, 3.3.1
+      --  Object Declarations examples, 4.4 Expressions examples
+      Put_Line (Output_Object.File, "[Unicode" & ARM_Output.Unicode_Type'Image (Char) & "]");
+   end Unicode_Character;
+
+   procedure URL_Link
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      URL           : in     String)
+   is begin
+      Put (Output_Object.File, "@uref{" & URL & "," & Text & "}");
+   end URL_Link;
+
+end ARM_Texinfo;
============================================================
--- progs/arm_texinfo.ads	266d5c69e4795f81b1e609fc0ba0be883fbd96af
+++ progs/arm_texinfo.ads	266d5c69e4795f81b1e609fc0ba0be883fbd96af
@@ -0,0 +1,258 @@
+with Ada.Text_IO;
+with Ada.Unchecked_Deallocation;
+with ARM_Output;
+with ARM_Contents;
+package ARM_Texinfo is
+
+   --
+   --  Ada reference manual formatter.
+   --
+   --  This package defines the TEXINFO output object.
+   --  Output objects are responsible for implementing the details of
+   --  a particular format.
+   --
+   -- ---------------------------------------
+   --
+   --  Copyright (C) 2003, 2007 Stephen Leake.  All Rights Reserved.
+   --  E-Mail: stephen_leake@stephe-leake.org
+   --
+   --  This library is free software; you can redistribute it and/or
+   --  modify it under terms of the GNU General Public License as
+   --  published by the Free Software Foundation; either version 2, or (at
+   --  your option) any later version. This library is distributed in the
+   --  hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+   --  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+   --  PURPOSE. See the GNU General Public License for more details. You
+   --  should have received a copy of the GNU General Public License
+   --  distributed with this program; see file COPYING. If not, write to
+   --  the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+   --  MA 02111-1307, USA.
+   --
+   --  As a special exception, if other files instantiate generics from
+   --  this unit, or you link this unit with other files to produce an
+   --  executable, this  unit  does not  by itself cause  the resulting
+   --  executable to be covered by the GNU General Public License. This
+   --  exception does not however invalidate any other reasons why the
+   --  executable file  might be covered by the  GNU Public License.
+
+   type Texinfo_Output_Type is new ARM_Output.Output_Type with private;
+
+   not overriding procedure Create
+     (Output_Object : in out Texinfo_Output_Type;
+      File_Prefix   : in     String;
+      Title         : in     String);
+   --  Create an Output_Object for a document.
+
+   overriding procedure Close (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Section
+     (Output_Object : in out Texinfo_Output_Type;
+      Section_Title : in     String;
+      Section_Name  : in     String);
+
+   overriding procedure Set_Columns
+     (Output_Object     : in out Texinfo_Output_Type;
+      Number_of_Columns : in     ARM_Output.Column_Count);
+
+   overriding procedure Start_Paragraph
+     (Output_Object  : in out Texinfo_Output_Type;
+      Format         : in     ARM_Output.Paragraph_Type;
+      Number         : in     String;
+      No_Prefix      : in     Boolean                       := False;
+      Tab_Stops      : in     ARM_Output.Tab_Info           := ARM_Output.NO_TABS;
+      No_Breaks      : in     Boolean                       := False;
+      Keep_with_Next : in     Boolean                       := False;
+      Space_After    : in     ARM_Output.Space_After_Type   := ARM_Output.Normal;
+      Justification  : in     ARM_Output.Justification_Type := ARM_Output.Default);
+
+   overriding procedure End_Paragraph (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Category_Header
+     (Output_Object : in out Texinfo_Output_Type;
+      Header_Text   :        String);
+
+   overriding procedure Clause_Header
+     (Output_Object : in out Texinfo_Output_Type;
+      Header_Text   : in     String;
+      Level         : in     ARM_Contents.Level_Type;
+      Clause_Number : in     String;
+      No_Page_Break : in     Boolean                 := False);
+
+   overriding procedure Revised_Clause_Header
+     (Output_Object   : in out Texinfo_Output_Type;
+      New_Header_Text : in     String;
+      Old_Header_Text : in     String;
+      Level           : in     ARM_Contents.Level_Type;
+      Clause_Number   : in     String;
+      Version         : in     ARM_Contents.Change_Version_Type;
+      No_Page_Break   : in     Boolean                          := False);
+
+   overriding procedure TOC_Marker (Output_Object : in out Texinfo_Output_Type;
+                         For_Start : in Boolean);
+
+   overriding procedure New_Page (Output_Object : in out Texinfo_Output_Type;
+                       Kind : ARM_Output.Page_Kind_Type := ARM_Output.Any_Page);
+
+   overriding procedure New_Column (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Separator_Line (Output_Object : in out Texinfo_Output_Type;
+                             Is_Thin : Boolean := True);
+
+   overriding procedure Start_Table
+     (Output_Object      : in out Texinfo_Output_Type;
+      Columns            : in     ARM_Output.Column_Count;
+      First_Column_Width : in     ARM_Output.Column_Count;
+      Last_Column_Width  : in     ARM_Output.Column_Count;
+      Alignment          : in     ARM_Output.Column_Text_Alignment;
+      No_Page_Break      : in     Boolean;
+      Has_Border         : in     Boolean;
+      Small_Text_Size    : in     Boolean;
+      Header_Kind        : in     ARM_Output.Header_Kind_Type);
+
+   overriding procedure Table_Marker (Output_Object : in out Texinfo_Output_Type;
+                           Marker : in ARM_Output.Table_Marker_Type);
+
+   overriding procedure Ordinary_Text (Output_Object : in out Texinfo_Output_Type;
+                            Text : in String);
+
+   overriding procedure Ordinary_Character (Output_Object : in out Texinfo_Output_Type;
+                                 Char : in Character);
+
+   overriding procedure Hard_Space (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Line_Break (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Index_Line_Break (Output_Object : in out Texinfo_Output_Type;
+                               Clear_Keep_with_Next : in Boolean);
+
+   overriding procedure Soft_Line_Break (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Soft_Hyphen_Break (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Tab (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Special_Character
+     (Output_Object : in out Texinfo_Output_Type;
+      Char          : in     ARM_Output.Special_Character_Type);
+
+   overriding procedure Unicode_Character
+     (Output_Object : in out Texinfo_Output_Type;
+      Char          : in     ARM_Output.Unicode_Type);
+
+   overriding procedure End_Hang_Item (Output_Object : in out Texinfo_Output_Type);
+
+   overriding procedure Text_Format
+     (Output_Object : in out Texinfo_Output_Type;
+      Bold          : in     Boolean;
+      Italic        : in     Boolean;
+      Font          : in     ARM_Output.Font_Family_Type;
+      Size          : in     ARM_Output.Size_Type;
+      Change        : in     ARM_Output.Change_Type;
+      Version       : in     ARM_Contents.Change_Version_Type := '0';
+      Added_Version : in     ARM_Contents.Change_Version_Type := '0';
+      Location      : in     ARM_Output.Location_Type);
+
+   overriding procedure Clause_Reference (Output_Object : in out Texinfo_Output_Type;
+                               Text : in String;
+                               Clause_Number : in String);
+
+   overriding procedure Index_Target
+     (Output_Object : in out Texinfo_Output_Type;
+      Index_Key     : in     Natural);
+
+   overriding procedure Index_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Index_Key     : in     Natural;
+      Clause_Number : in     String);
+
+   overriding procedure DR_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      DR_Number     : in     String);
+
+   overriding procedure AI_Reference
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      AI_Number     : in     String);
+
+   overriding procedure Local_Target
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Target        : in     String);
+
+   overriding procedure Local_Link
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      Target        : in     String;
+      Clause_Number : in     String);
+
+   overriding procedure Local_Link_Start
+     (Output_Object : in out Texinfo_Output_Type;
+      Target        : in     String;
+      Clause_Number : in     String);
+
+   overriding procedure Local_Link_End
+     (Output_Object : in out Texinfo_Output_Type;
+      Target        : in     String;
+      Clause_Number : in     String);
+
+   overriding procedure URL_Link
+     (Output_Object : in out Texinfo_Output_Type;
+      Text          : in     String;
+      URL           : in     String);
+
+   overriding procedure Picture
+     (Output_Object : in out Texinfo_Output_Type;
+      Name          : in     String;
+      Descr         : in     String;
+      Alignment     : in     ARM_Output.Picture_Alignment;
+      Height, Width : in     Natural;
+      Border        : in     ARM_Output.Border_Kind);
+
+private
+
+   subtype Column_Index_Type is Integer range 1 .. 5;
+   type Column_Text_Item_Type;
+   type Column_Text_Ptr is access Column_Text_Item_Type;
+   type Column_Text_Item_Type is record
+      Text     : String (1 .. 80);
+      Length   : Natural;
+      Row      : Natural; -- Which row in the column.
+      Next     : Column_Text_Ptr;
+   end record;
+   type Column_Text_Ptrs_Type is array (Column_Index_Type) of Column_Text_Ptr;
+   type Column_Widths_Type is array (Column_Index_Type) of Natural;
+
+   procedure Free is new Ada.Unchecked_Deallocation (Column_Text_Item_Type, Column_Text_Ptr);
+
+   type State_Type is (Title, Contents, Table_Header, Multi_Column, Normal, Index_Start, Index);
+
+   type Texinfo_Output_Type is new ARM_Output.Output_Type with record
+      File     : Ada.Text_IO.File_Type;
+      Is_Valid : Boolean := False;
+
+      State            : State_Type;
+      In_Paragraph     : Boolean := False; --  Sub-state within major states
+      Paragraph_Format : ARM_Output.Paragraph_Type;
+      End_Hang_Seen    : Boolean;
+
+      --  Detecting end of title page
+      Line_Empty      : Boolean := False; --  True if current line contains only whitespace.
+      First_Word      : String (1 .. 80);
+      First_Word_Last : Natural;
+
+      --  Building menus
+      Menu_Section : ARM_Contents.Section_Number_Type := 0;
+      Menu_Clause  : Natural := 0;
+
+      --  Table and Multi-Column format
+      Column_Count    : ARM_Output.Column_Count;
+      Current_Column  : Natural;
+      Current_Row     : Natural;
+      Column_Text     : Column_Text_Ptrs_Type := (others => null);
+      Column_Widths   : Column_Widths_Type;
+      Max_Row         : Natural;
+   end record;
+
+end ARM_Texinfo;
============================================================
--- progs/arm_cont.adb	6367999676bc6e64b7d6d11a401f1dac3fd1ca59
+++ progs/arm_cont.adb	d885d951af3ba9b6e41fd78e2001fcc74159a283
@@ -533,7 +533,34 @@ package body ARM_Contents is
 	raise Not_Found_Error;
     end Next_Clause;
 
+    function Parent_Clause (Clause : in String) return String is
+       Clause_Number : Clause_Number_Type;
+    begin
+	Make_Clause (Clause, Clause_Number);
 
+	if Clause_Number.Clause = 0 then
+	   -- Clause is a section; no parent
+	   return "";
+
+	elsif Clause_Number.Subclause = 0 then
+	   -- Clause is a clause; parent is Section or Annex
+	   if Clause_Number.Section >= ANNEX_START then
+	      return Make_Clause_Number (Normative_Annex, (Clause_Number.Section, 0, 0, 0));
+	   else
+	      return Make_Clause_Number (Section, (Clause_Number.Section, 0, 0, 0));
+	   end if;
+
+	elsif Clause_Number.Subsubclause = 0 then
+	   -- Clause is a subclause; clause is parent
+	   return Make_Clause_Number (ARM_Contents.Clause, (Clause_Number.Section, Clause_Number.Clause, 0, 0));
+
+	else
+	   -- Clause is a subsubclause; subclause is parent
+	   return Make_Clause_Number
+	     (Subclause, (Clause_Number.Section, Clause_Number.Clause, Clause_Number.Subclause, 0));
+	end if;
+    end Parent_Clause;
+
     procedure For_Each is
 	-- Call Operate for each title in the contents, in the order that
 	-- they were added to the contents. If the Quit parameter to Operate
============================================================
--- progs/arm_cont.ads	6596716ec97c15a811b342a248759697f3092b3a
+++ progs/arm_cont.ads	ef3ac4e688d6574b38ea3d32b4a5d015db130f15
@@ -62,7 +62,7 @@ package ARM_Contents is
 	-- Defines the change version. Version 0 is the original text.
 
     type Clause_Number_Type is record
-	Section : Section_Number_Type;
+	Section : Section_Number_Type := 0;
 	Clause : Natural := 0;
 	Subclause : Natural := 0;
 	Subsubclause : Natural := 0;
@@ -141,7 +141,15 @@ package ARM_Contents is
 	-- for the properly formatted clause string Clause.
 	-- Raises Not_Found_Error if not found.
 
-    function Next_Clause (Clause : in String) return String;
+   function Parent_Clause (Clause : in String) return String;
+        -- Returns the string of the parent clause (in the table of contents)
+        -- for the properly formatted clause string Clause.
+        --
+        -- Result is a null string if Clause is a top level clause;
+        -- Section, Unnumbered_Section, Normative_Annex,
+        -- Informative_Annex.
+
+   function Next_Clause (Clause : in String) return String;
 	-- Returns the string of the next clause (in the table of contents)
 	-- for the properly formatted clause string Clause.
 	-- Raises Not_Found_Error if not found.
============================================================
--- progs/arm_corr.adb	8c3c083def7c6c54d5ba24fd601e369af7c715dc
+++ progs/arm_corr.adb	6bacc4dc096dfb9f3fa2f901f2e9d35015356083
@@ -1,9 +1,6 @@
-with ARM_Output,
-     ARM_Contents,
-     Ada.Text_IO,
-     Ada.Exceptions,
-     Ada.Strings.Fixed,
-     Ada.Strings.Maps;
+with Ada.Exceptions;
+with Ada.Strings.Fixed;
+with Ada.Strings.Maps;
 package body ARM_Corr is
 
     --
@@ -120,7 +117,7 @@ package body ARM_Corr is
         end if;
         -- Create a new file for this section:
         Ada.Text_IO.Create (Output_Object.Output_File, Ada.Text_IO.Out_File,
-            ".\Output\" & Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right) &
+            "Output/" & Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right) &
                 "-Corr-" & Section_Name & ".TXT");
         Ada.Text_IO.New_Line (Output_Object.Output_File);
     end Section;
============================================================
--- progs/arm_db.adb	f5f60a07051b87c049b0ecbd6462b6e9bfac38c3
+++ progs/arm_db.adb	1d603365d5bb465bbb1cab92bf04dfa4fe64a7d1
@@ -1,4 +1,3 @@
-with Ada.Text_IO; -- Debug.
 with Ada.Unchecked_Deallocation,
      Ada.Strings.Fixed,
      Ada.Characters.Handling;
============================================================
--- progs/arm_file.adb	c2bc065c1412b42d956a113825f463016e816550
+++ progs/arm_file.adb	d2bfec6ddb79bb63fad90a1a6559681ecbd3bb96
@@ -1,5 +1,3 @@
-with ARM_Input,
-     Ada.Text_IO;
 package body ARM_File is
 
     --
============================================================
--- progs/arm_form.ada	b16d9b40ec87e171d579ffe166f2a9acfe2ade44
+++ progs/arm_form.ada	c00aa04da68cb1b2c21f07bbec593cca5debec1c
@@ -4,11 +4,6 @@ with ARM_Format,
      Ada.Characters.Handling,
      Ada.Command_Line;
 with ARM_Format,
-     ARM_Output,
-     ARM_Text,
-     ARM_HTML,
-     ARM_RTF,
-     ARM_Corr,
      ARM_Master,
      ARM_Contents;
 procedure ARM_Formatter is
@@ -114,7 +109,6 @@ procedure ARM_Formatter is
     Master_File : Ada.Strings.Unbounded.Unbounded_String; -- Master file for document to generate.
     Change_Kind : ARM_Format.Change_Kind; -- Changes to generate.
     Change_Version : ARM_Contents.Change_Version_Type; -- Change version.
-    Display_Index_Entries : Boolean; -- Should Index entries be displayed?
 
     procedure Get_Commands is
 	-- Process the command line for this program.
============================================================
--- progs/arm_frm.adb	88a1527623f1c61882521ef8eebbf1f50200f291
+++ progs/arm_frm.adb	81a0a13966fdbca428831a7c17c7ef957cd77654
@@ -1,15 +1,10 @@
-with ARM_Output,
-     ARM_Input,
-     ARM_File,
-     ARM_String,
-     ARM_Contents,
-     ARM_Database,
-     ARM_Syntax,
-     ARM_Index,
-     ARM_Subindex,
-     Ada.Text_IO,
-     Ada.Characters.Handling,
-     Ada.Strings.Fixed;
+with ARM_File;
+with ARM_String;
+with ARM_Syntax;
+with ARM_Index;
+with Ada.Text_IO;
+with Ada.Characters.Handling;
+with Ada.Strings.Fixed;
 package body ARM_Format is
 
     --
@@ -2920,7 +2915,7 @@ Ada.Text_IO.Put_Line ("%% No indentation
 			-- Nothing at all should be showm.
 			-- ** Warning ** If we lie here, the program will crash!
 		        Format_Object.No_Start_Paragraph := True;
-Ada.Text_IO.Put_Line("    -- No Start Paragraph (DelNoMsg)");
+--  Ada.Text_IO.Put_Line("    -- No Start Paragraph (DelNoMsg)");
 		    else
 		        ARM_Output.Start_Paragraph (Output_Object,
 					            Format => Format_Object.Format,
@@ -3245,16 +3240,16 @@ Ada.Text_IO.Put_Line("    -- No Start Pa
 		if Tabs.Stops(Tabs.Number).Stop = 0 then
 		    Tabs.Number := Tabs.Number - 1;
 		    Ada.Text_IO.Put_Line ("  ** Bad tab stop format, position" & Natural'Image(Loc) &
-			" in [" & Stops(1..Stops'Length) & "] from line " &
-		        ARM_Input.Line_String (Input_Object));
+			" in [" & Stops(Stops'First..Stops'Last) & "] from line " &
+			ARM_Input.Line_String (Input_Object));
 		    exit; -- Give up on this tabset.
 		elsif Tabs.Number < 1 and then
 			Tabs.Stops(Tabs.Number-1).Stop >=
 			Tabs.Stops(Tabs.Number).Stop then
 		    Tabs.Number := Tabs.Number - 1;
 		    Ada.Text_IO.Put_Line ("  ** Bad tab stop, less than previous, at position" & Natural'Image(Loc) &
-			" in [" & Stops(1..Stops'Length) & "] from line " &
-		        ARM_Input.Line_String (Input_Object));
+			" in [" & Stops(Stops'First..Stops'Last) & "] from line " &
+			ARM_Input.Line_String (Input_Object));
 		    exit; -- Give up on this tabset.
 		end if;
 		if Loc > Stops'Length then
@@ -3262,10 +3257,10 @@ Ada.Text_IO.Put_Line("    -- No Start Pa
 		elsif Stops(Loc) = ',' then
 		    Loc := Loc + 1;
 		    if Loc > Stops'Length then
-		        Ada.Text_IO.Put_Line ("  ** Bad tab stop set format, ends with comma in [" &
-			    Stops(1..Stops'Length) & "] from line " &
-		            ARM_Input.Line_String (Input_Object));
-		        exit; -- Give up on this tabset.
+			Ada.Text_IO.Put_Line (ASCII.HT & " ** Bad tab stop set format, ends with comma in [" &
+			    Stops(Stops'First..Stops'Last) & "] from line " &
+			    ARM_Input.Line_String (Input_Object));
+			exit; -- Give up on this tabset.
 		    end if;
 	        end if;
 		-- Skip any blanks in between.
@@ -8079,8 +8074,8 @@ Ada.Text_IO.Put_Line("    -- No Start Pa
 		    -- conditionally handle paragraph formatting (which
 		    -- otherwise would come too late).
 		    declare
-		        Which_Param : ARM_Input.Param_Num;
-		        Ch, Close_Ch : Character;
+			Which_Param : ARM_Input.Param_Num;
+			Close_Ch : Character;
 
 			NoPrefix, Noparanum, Keepnext : Boolean := False;
 			Space_After : ARM_Output.Space_After_Type := ARM_Output.Normal;
============================================================
--- progs/arm_frm.ads	e0e0bfa9ae14b868d1fb6af5d0cb3ca0bf4978cc
+++ progs/arm_frm.ads	37ae4d5c73239c0cab701e63d1f22775a11bfc44
@@ -295,8 +295,8 @@ private
         Font : ARM_Output.Font_Family_Type; -- What is the current font family?
         Size : ARM_Output.Size_Type; -- What is the current font size?
         Change : ARM_Output.Change_Type; -- What is the current kind of change?
-        Current_Change_Version : ARM_Contents.Change_Version_Type; -- What is the current version of change?
-        Current_Old_Change_Version : ARM_Contents.Change_Version_Type; -- What is the current old version of change? (Only used if Change is Both).
+	Current_Change_Version : ARM_Contents.Change_Version_Type := '0'; -- What is the current version of change?
+	Current_Old_Change_Version : ARM_Contents.Change_Version_Type := '0'; -- What is the current old version of change? (Only used if Change is Both).
         Location : ARM_Output.Location_Type; -- What is the current (vertical) location?
         Format : ARM_Output.Paragraph_Type; -- What is the current paragraph type?
         In_Paragraph : Boolean; -- Are we currently in a paragraph?
@@ -356,7 +356,7 @@ private
         Glossary_Term_Len : Natural := 0; -- processing [Chg]ToGlossary[Also] commands.
         Glossary_Change_Kind : ARM_Database.Paragraph_Change_Kind_Type;
                         -- The change kind of the ToGlossary.
-        Glossary_Version : ARM_Contents.Change_Version_Type;
+        Glossary_Version : ARM_Contents.Change_Version_Type := '0';
                         -- If the kind is not "None", this is the version
                         -- number of the changed paragraph.
         Add_to_Glossary : Boolean;
============================================================
--- progs/arm_html.adb	f7485cae94631499305b48e073365eaf9a79bec1
+++ progs/arm_html.adb	e2c8043f3f7cc70a7995d79701ac030ed4af6ee1
@@ -1,10 +1,7 @@
-with ARM_Output,
-     ARM_Contents,
-     Ada.Text_IO,
-     Ada.Exceptions,
-     Ada.Strings.Maps.Constants,
-     Ada.Strings.Fixed,
-     Ada.Unchecked_Deallocation;
+with Ada.Exceptions;
+with Ada.Strings.Maps.Constants;
+with Ada.Strings.Fixed;
+with Ada.Unchecked_Deallocation;
 package body ARM_HTML is
 
     --
@@ -1329,11 +1326,11 @@ package body ARM_HTML is
     begin
         if Output_Object.HTML_Kind > HTML_3 then
             Ada.Text_IO.Create (Output_Object.Output_File, Ada.Text_IO.Out_File,
-                ".\Output\" & File_Name & ".$$$");
+                "Output/" & File_Name & ".$$$");
 --Ada.Text_IO.Put_Line ("--Creating " & File_Name & ".html");
         else
             Ada.Text_IO.Create (Output_Object.Output_File, Ada.Text_IO.Out_File,
-                ".\Output\" & File_Name & ".html");
+                "Output/" & File_Name & ".html");
         end if;
         -- Save the current clause:
         Output_Object.Current_Clause :=
============================================================
--- progs/arm_indx.adb	85d524ffcd0687f48142f51f0568b4f187cde0f4
+++ progs/arm_indx.adb	4d4895df38d72351deed15d7549ea31d95376788
@@ -1,11 +1,10 @@
-with ARM_Output,
-     ARM_Contents,
-     Ada.Exceptions,
-     Ada.Characters.Handling,
-     Ada.Strings.Fixed,
-     Ada.Text_IO,
-     Ada.Calendar,
-     Ada.Unchecked_Deallocation;
+with ARM_Contents;
+with Ada.Exceptions;
+with Ada.Characters.Handling;
+with Ada.Strings.Fixed;
+with Ada.Text_IO;
+with Ada.Calendar;
+with Ada.Unchecked_Deallocation;
 package body ARM_Index is
 
     --
============================================================
--- progs/arm_mast.adb	bf1cc6c25a197650141a6c295fffe9bbb2fcccd9
+++ progs/arm_mast.adb	f07fb577134c87b82d27244f684fc01f34f075f3
@@ -1,17 +1,15 @@
-with Ada.Text_IO,
-     Ada.Characters.Handling,
-     Ada.Strings.Fixed,
-     Ada.Strings.Unbounded;
-with ARM_Input,
-     ARM_File,
-     ARM_Format,
-     ARM_Output,
-     ARM_Text,
-     ARM_HTML,
-     ARM_RTF,
-     ARM_Corr,
-     ARM_Master,
-     ARM_Contents;
+with Ada.Text_IO;
+with Ada.Characters.Handling;
+with Ada.Strings.Fixed;
+with Ada.Strings.Unbounded;
+with ARM_Input;
+with ARM_File;
+with ARM_Output;
+with ARM_TexInfo;
+with ARM_Text;
+with ARM_HTML;
+with ARM_RTF;
+with ARM_Corr;
 package body ARM_Master is
 
     --
@@ -297,7 +295,6 @@ package body ARM_Master is
 
 	    function Get_Single_String return String is
 		-- Returns the (single) parameter of a command.
-		Ch : Character;
 	        Item : String(1..2000);
 	        ILen : Natural := 0;
 	    begin
@@ -1284,14 +1281,16 @@ package body ARM_Master is
 		    ARM_Corr.Close (Output);
 	        end;
 	    when Info =>
-	        null; -- Future use.
-	        --declare
-	        --	Output : ARM_Info.Info_Output_Type;
-	        --begin
-		--      Create (Output, Use_Large_Files => False); -- The latter is not used.
-	        --	Generate_Sources (Output);
-	        --	ARM_Info.Close (Output);
-	        --end;
+                declare
+                    Output : ARM_TexInfo.Texinfo_Output_Type;
+                begin
+                   ARM_TexInfo.Create
+                     (Output,
+                      File_Prefix => +Output_File_Prefix,
+                      Title       => Get_Versioned_Item(Document_Title,Change_Version));
+                    Generate_Sources (Output);
+                    ARM_TexInfo.Close (Output);
+                end;
         end case;
 
     end Read_and_Process_Master_File;
============================================================
--- progs/arm_rtf.adb	dfa82e8697545d64775c89297cceeaa93d9101da
+++ progs/arm_rtf.adb	77f0fffb0bd7a4d0b6293fad50388b82ec52827d
@@ -1,12 +1,10 @@
-with ARM_Output,
-     ARM_Contents,
-     Ada.Text_IO,
-     Ada.Exceptions,
-     Ada.Streams.Stream_IO,
-     Ada.Strings.Maps,
-     Ada.Strings.Fixed,
-     Ada.Characters.Handling,
-     Ada.Calendar;
+with Ada.Calendar;
+with Ada.Characters.Handling;
+with Ada.Exceptions;
+with Ada.Streams.Stream_IO;
+with Ada.Strings.Fixed;
+with Ada.Strings.Maps;
+with Ada.Unchecked_Conversion;
 package body ARM_RTF is
 
     --
@@ -258,7 +256,8 @@ package body ARM_RTF is
 
     procedure Write_Headers (Output_Object : in out RTF_Output_Type) is
 	-- Write the page headers for this object into the current file.
-	Junk : Natural;
+       Junk : Natural;
+       pragma Unreferenced (Junk);
     begin
         -- Default header/footer:
         Ada.Text_IO.Put (Output_Object.Output_File, "{\headerl ");
@@ -2711,7 +2710,8 @@ package body ARM_RTF is
 	-- (Note: We did not use a enumeration here to insure that these
 	-- headers are spelled the same in all output versions).
 	-- Raises Not_Valid_Error if in a paragraph.
-	Count : Natural; -- Not used after being set.
+       Count : Natural; -- Not used after being set.
+       pragma Unreferenced (Count);
     begin
 	if not Output_Object.Is_Valid then
 	    Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
============================================================
--- progs/arm_str.adb	d12ec9e024dd28b7c7f83e8c281f6eb6ab35ba8e
+++ progs/arm_str.adb	d05b795fb41d724d03e24c6adba1d4249da2bef2
@@ -1,5 +1,4 @@
-with ARM_Input,
-     Ada.Text_IO;
+with Ada.Text_IO;
 package body ARM_String is
 
     --
============================================================
--- progs/arm_sub.adb	b585f4a75f9394d7cc2126667c6543165b9dbf12
+++ progs/arm_sub.adb	66564154cc0e70e30db4e5dbc92431ecbf341590
@@ -1,9 +1,7 @@
-with ARM_Output;
-with ARM_Index;
 with ARM_Contents;
 with Ada.Characters.Handling;
 with Ada.Strings.Fixed;
-with Ada.Text_IO; -- ** Temp.
+with Ada.Unchecked_Deallocation;
 package body ARM_Subindex is
 
     --
@@ -166,8 +164,6 @@ package body ARM_Subindex is
 
 	function To_Lower (A : in String) return String renames
 	    Ada.Characters.Handling.To_Lower;
-	function To_Lower (A : in Character) return Character renames
-	    Ada.Characters.Handling.To_Lower;
 
 
         function "<" (Left, Right : Item_List) return Boolean is
============================================================
--- progs/arm_syn.adb	b849027bd8ca131c1d0762ff315aa4f9c3709aa9
+++ progs/arm_syn.adb	d0031269276536bcbd8ae0b8844d12b5a881460e
@@ -102,8 +102,6 @@ package body ARM_Syntax is
     NT_Count : Natural := 0;
 
     procedure Free is new Ada.Unchecked_Deallocation (Rule_Type, Rule_Ptr);
-    procedure Free is new Ada.Unchecked_Deallocation (XRef_Type, XRef_Ptr);
-    procedure Free is new Ada.Unchecked_Deallocation (NT_Type, NT_Ptr);
     procedure Free is new Ada.Unchecked_Deallocation (String, String_Ptr);
 
     procedure Create is
============================================================
--- progs/arm_text.adb	0210659138fa315cfd969149fd13110072c9b906
+++ progs/arm_text.adb	468b32811dce385ab7244ed4385ca746034c0e33
@@ -1,8 +1,5 @@
-with ARM_Output,
-     ARM_Contents,
-     Ada.Text_IO,
-     Ada.Exceptions,
-     Ada.Strings.Fixed;
+with Ada.Exceptions;
+with Ada.Strings.Fixed;
 package body ARM_Text is
 
     --
@@ -173,7 +170,7 @@ package body ARM_Text is
         end if;
         -- Create a new file for this section:
         Ada.Text_IO.Create (Output_Object.Output_File, Ada.Text_IO.Out_File,
-            ".\Output\" & Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right) &
+            "Output/" & Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right) &
                 "-" & Section_Name & ".TXT");
         Ada.Text_IO.New_Line (Output_Object.Output_File);
     end Section;
============================================================
# source_2005/AARM.MSM is binary
============================================================
# source_2005/RM.MSM is binary
