-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
5,221 additions
and
1,605 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|
@@ -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. | ||
|
@@ -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; | ||
|
@@ -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) & | ||
|
@@ -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) & | ||
|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|
@@ -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. | ||
|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|
@@ -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. | ||
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|
@@ -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; | ||
|
||
|
@@ -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; | ||
|
Oops, something went wrong.