Skip to content

Commit

Permalink
Various updates for FDIS 2.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrukardt authored and reznikmm committed Sep 24, 2022
1 parent ff3db3c commit 0e95e91
Show file tree
Hide file tree
Showing 23 changed files with 5,221 additions and 1,605 deletions.
95 changes: 92 additions & 3 deletions progs/arm_cont.adb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package body ARM_Contents is
-- references.
--
-- ---------------------------------------
-- Copyright 2000, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
-- Copyright 2000, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012, 2022
-- AXE Consultants. All rights reserved.
-- P.O. Box 1512, Madison WI 53701
-- E-Mail: [email protected]
Expand Down Expand Up @@ -56,6 +56,8 @@ package body ARM_Contents is
-- 10/19/11 - RLB - Added Parent_Clause from Stephen Leake's version.
-- 10/25/11 - RLB - Added version to Old name strings.
-- 8/30/12 - RLB - Added traps if we're reading Section = UNKNOWN.
-- 1/28/22 - RLB - Added Note_Info to better support ISO 2004 notes.
-- 9/15/22 - RLB - Added Examples_Info to better support ISO 2021 examples.

function "<" (Left, Right : Clause_Number_Type) return Boolean is
-- True if Left comes before Right in the collating order.
Expand Down Expand Up @@ -110,6 +112,8 @@ package body ARM_Contents is
Level : Level_Type;
Clause_Number : Clause_Number_Type;
Version : ARM_Contents.Change_Version_Type := '0';
Note_Info : Group_Info_Type := No_Items;
Example_Info : Group_Info_Type := No_Items;
end record;

Title_List : array (1 .. 900) of Title_Record;
Expand Down Expand Up @@ -151,7 +155,9 @@ package body ARM_Contents is
Search_Title => Ada.Characters.Handling.To_Lower (Title),
Level => Level,
Clause_Number => Clause_Number,
Version => Version);
Version => Version,
Note_Info => No_Items,
Example_Info => No_Items);
--Ada.Text_IO.Put_Line (" Add " & Title &
-- " Index=" & Natural'Image(Last_Title) & " Level=" & Level_Type'Image(Level));
--Ada.Text_IO.Put_Line (" Section" & Section_Number_Type'Image(Clause_Number.Section) &
Expand Down Expand Up @@ -187,7 +193,9 @@ package body ARM_Contents is
Search_Title => Ada.Characters.Handling.To_Lower (Old_Title),
Level => Level,
Clause_Number => Clause_Number,
Version => Version);
Version => Version,
Note_Info => No_Items,
Example_Info => No_Items);
--Ada.Text_IO.Put_Line (" Add_Old " & Old_Title &
-- " Index=" & Natural'Image(Last_Old_Title) & " Level=" & Level_Type'Image(Level));
--Ada.Text_IO.Put_Line (" Section" & Section_Number_Type'Image(Section_Number) &
Expand Down Expand Up @@ -666,4 +674,85 @@ package body ARM_Contents is
end loop;
end For_Each;


function Lookup_Note_Info (Level : in Level_Type;
Clause_Number : in Clause_Number_Type) return Group_Info_Type is
-- Given the level and clause numbers, return the note information.
-- Raises Not_Found_Error if not found.
begin
if Clause_Number.Section = UNKNOWN then
raise Bad_Clause_Error with "unknown section number";
-- else not unknown
end if;
for I in 1 .. Last_Title loop
if Title_List(I).Level = Level and then
Title_List(I).Clause_Number = Clause_Number then
return Title_List(I).Note_Info;
end if;
end loop;
raise Not_Found_Error;
end Lookup_Note_Info;


procedure Update_Note_Info (Level : in Level_Type;
Clause_Number : in Clause_Number_Type;
New_Note_Info : in Group_Info_Type) is
-- Given the level and clause numbers, update the note information to
-- the provided value. Raises Not_Found_Error if not found.
begin
if Clause_Number.Section = UNKNOWN then
raise Bad_Clause_Error with "unknown section number";
-- else not unknown
end if;
for I in 1 .. Last_Title loop
if Title_List(I).Level = Level and then
Title_List(I).Clause_Number = Clause_Number then
Title_List(I).Note_Info := New_Note_Info;
return;
end if;
end loop;
raise Not_Found_Error;
end Update_Note_Info;


function Lookup_Example_Info (Level : in Level_Type;
Clause_Number : in Clause_Number_Type) return Group_Info_Type is
-- Given the level and clause numbers, return the example information.
-- Raises Not_Found_Error if not found.
begin
if Clause_Number.Section = UNKNOWN then
raise Bad_Clause_Error with "unknown section number";
-- else not unknown
end if;
for I in 1 .. Last_Title loop
if Title_List(I).Level = Level and then
Title_List(I).Clause_Number = Clause_Number then
return Title_List(I).Example_Info;
end if;
end loop;
raise Not_Found_Error;
end Lookup_Example_Info;


procedure Update_Example_Info (Level : in Level_Type;
Clause_Number : in Clause_Number_Type;
New_Example_Info : in Group_Info_Type) is
-- Given the level and clause numbers, update the example information to
-- the provided value. Raises Not_Found_Error if not found.
begin
if Clause_Number.Section = UNKNOWN then
raise Bad_Clause_Error with "unknown section number";
-- else not unknown
end if;
for I in 1 .. Last_Title loop
if Title_List(I).Level = Level and then
Title_List(I).Clause_Number = Clause_Number then
Title_List(I).Example_Info := New_Example_Info;
return;
end if;
end loop;
raise Not_Found_Error;
end Update_Example_Info;


end ARM_Contents;
32 changes: 31 additions & 1 deletion progs/arm_cont.ads
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package ARM_Contents is
-- references.
--
-- ---------------------------------------
-- Copyright 2000, 2004, 2006, 2007, 2009, 2011, 2012
-- Copyright 2000, 2004, 2006, 2007, 2009, 2011, 2012, 2022
-- AXE Consultants. All rights reserved.
-- P.O. Box 1512, Madison WI 53701
-- E-Mail: [email protected]
Expand Down Expand Up @@ -55,6 +55,8 @@ package ARM_Contents is
-- 10/25/11 - RLB - Added version to Old name strings.
-- 8/30/12 - RLB - Added initialization of Section to UNKNOWN to
-- detect bugs earlier.
-- 1/28/22 - RLB - Added Note_Info to better support ISO 2004 notes.
-- 9/15/22 - RLB - Added Examples_Info to better support ISO 2021 examples.

subtype Title_Type is String (1 .. 80);
-- The type of a title.
Expand Down Expand Up @@ -183,5 +185,33 @@ package ARM_Contents 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
-- is True when Operate returns, the iteration is abandoned.

-- Note and examples group information:
type Group_Info_Type is (No_Items, One_Item, Many_Items);
-- Determine if there is more than one item of an interesting group
-- in this clause. We use this to determine whether to display a number
-- preceding a note or example.

function Lookup_Note_Info (Level : in Level_Type;
Clause_Number : in Clause_Number_Type) return Group_Info_Type;
-- Given the level and clause numbers, return the note information.
-- Raises Not_Found_Error if not found.

procedure Update_Note_Info (Level : in Level_Type;
Clause_Number : in Clause_Number_Type;
New_Note_Info : in Group_Info_Type);
-- Given the level and clause numbers, update the note information to
-- the provided value. Raises Not_Found_Error if not found.

function Lookup_Example_Info (Level : in Level_Type;
Clause_Number : in Clause_Number_Type) return Group_Info_Type;
-- Given the level and clause numbers, return the example information.
-- Raises Not_Found_Error if not found.

procedure Update_Example_Info (Level : in Level_Type;
Clause_Number : in Clause_Number_Type;
New_Example_Info : in Group_Info_Type);
-- Given the level and clause numbers, update the example information to
-- the provided value. Raises Not_Found_Error if not found.

end ARM_Contents;
12 changes: 8 additions & 4 deletions progs/arm_corr.adb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package body ARM_Corr is
-- a particular format.
--
-- ---------------------------------------
-- Copyright 2000, 2002, 2004, 2005, 2006, 2007, 2011, 2012
-- Copyright 2000, 2002, 2004, 2005, 2006, 2007, 2011, 2012, 2022
-- AXE Consultants. All rights reserved.
-- P.O. Box 1512, Madison WI 53701
-- E-Mail: [email protected]
Expand Down Expand Up @@ -67,6 +67,7 @@ package body ARM_Corr is
-- 10/18/12 - RLB - Added additional hanging styles.
-- 11/26/12 - RLB - Added subdivision names to Clause_Header and
-- Revised_Clause_Header.
-- 8/22/22 - RLB - Added All_Formats parameter to URL_Link.

LINE_LENGTH : constant := 78;
-- Maximum intended line length.
Expand Down Expand Up @@ -1684,11 +1685,14 @@ package body ARM_Corr is

procedure URL_Link (Output_Object : in out Corr_Output_Type;
Text : in String;
URL : in String) is
URL : in String;
All_Formats : in Boolean) is
-- Generate a link to the URL given.
-- Text is the text of the link.
-- For hyperlinked formats, this should generate a link;
-- for other formats, only the text is generated.
-- If All_Formats is True, then the link is generated in any format that
-- can support a link. Otherwise, a link is only generated in formats
-- that are primarily hyperlinked (such as HTML). If no link is
-- generated, the text still should be generated.
begin
Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
end URL_Link;
Expand Down
12 changes: 8 additions & 4 deletions progs/arm_corr.ads
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package ARM_Corr is
-- a particular format.
--
-- ---------------------------------------
-- Copyright 2000, 2002, 2004, 2005, 2006, 2007, 2011, 2012
-- Copyright 2000, 2002, 2004, 2005, 2006, 2007, 2011, 2012, 2022
-- AXE Consultants. All rights reserved.
-- P.O. Box 1512, Madison WI 53701
-- E-Mail: [email protected]
Expand Down Expand Up @@ -60,6 +60,7 @@ package ARM_Corr is
-- 8/31/12 - RLB - Added Output_Path.
-- 11/26/12 - RLB - Added subdivision names to Clause_Header and
-- Revised_Clause_Header.
-- 8/22/22 - RLB - Added All_Formats parameter to URL_Link.

type Corr_Output_Type is new ARM_Output.Output_Type with private;

Expand Down Expand Up @@ -366,11 +367,14 @@ package ARM_Corr is

procedure URL_Link (Output_Object : in out Corr_Output_Type;
Text : in String;
URL : in String);
URL : in String;
All_Formats : in Boolean);
-- Generate a link to the URL given.
-- Text is the text of the link.
-- For hyperlinked formats, this should generate a link;
-- for other formats, only the text is generated.
-- If All_Formats is True, then the link is generated in any format that
-- can support a link. Otherwise, a link is only generated in formats
-- that are primarily hyperlinked (such as HTML). If no link is
-- generated, the text still should be generated.

procedure Picture (Output_Object : in out Corr_Output_Type;
Name : in String;
Expand Down
Loading

0 comments on commit 0e95e91

Please sign in to comment.