| 1 |
with ARM_Output; |
| 2 |
with ARM_Index; |
| 3 |
package ARM_Subindex is |
| 4 |
|
| 5 |
-- |
| 6 |
-- Ada reference manual formatter (ARM_Form). |
| 7 |
-- |
| 8 |
-- This package contains the database to store subindex items for |
| 9 |
-- non-normative appendixes. |
| 10 |
-- |
| 11 |
-- --------------------------------------- |
| 12 |
-- Copyright 2005, 2011 |
| 13 |
-- AXE Consultants. All rights reserved. |
| 14 |
-- P.O. Box 1512, Madison WI 53701 |
| 15 |
-- E-Mail: [email protected] |
| 16 |
-- |
| 17 |
-- ARM_Form is free software: you can redistribute it and/or modify |
| 18 |
-- it under the terms of the GNU General Public License version 3 |
| 19 |
-- as published by the Free Software Foundation. |
| 20 |
-- |
| 21 |
-- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS" |
| 22 |
-- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY, |
| 23 |
-- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL. |
| 24 |
-- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL, |
| 25 |
-- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES, |
| 26 |
-- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
| 27 |
-- DAMAGES. |
| 28 |
-- |
| 29 |
-- A copy of the GNU General Public License is available in the file |
| 30 |
-- gpl-3-0.txt in the standard distribution of the ARM_Form tool. |
| 31 |
-- Otherwise, see <http://www.gnu.org/licenses/>. |
| 32 |
-- |
| 33 |
-- If the GPLv3 license is not satisfactory for your needs, a commercial |
| 34 |
-- use license is available for this tool. Contact Randy at AXE Consultants |
| 35 |
-- for more information. |
| 36 |
-- |
| 37 |
-- --------------------------------------- |
| 38 |
-- |
| 39 |
-- Edit History: |
| 40 |
-- |
| 41 |
-- 10/28/05 - RLB - Created package. |
| 42 |
-- 10/18/11 - RLB - Changed to GPLv3 license. |
| 43 |
|
| 44 |
type Subindex_Type is tagged limited private; |
| 45 |
|
| 46 |
Not_Valid_Error : exception; |
| 47 |
|
| 48 |
procedure Create (Subindex_Object : in out Subindex_Type); |
| 49 |
-- Initialize a Subindex object. |
| 50 |
|
| 51 |
procedure Destroy (Subindex_Object : in out Subindex_Type); |
| 52 |
-- Destroy a Subindex object, freeing any resources used. |
| 53 |
|
| 54 |
type Subindex_Item_Kind_Type is (Top_Level, In_Unit, |
| 55 |
Child_of_Parent, Subtype_In_Unit, |
| 56 |
Description_In_Unit, Raised_Belonging_to_Unit); |
| 57 |
|
| 58 |
procedure Insert (Subindex_Object : in out Subindex_Type; |
| 59 |
Entity : in String; |
| 60 |
From_Unit : in String := ""; |
| 61 |
Kind : in Subindex_Item_Kind_Type := Top_Level; |
| 62 |
Clause : in String := ""; |
| 63 |
Paragraph : in String := ""; |
| 64 |
Key : in ARM_Index.Index_Key); |
| 65 |
-- Insert an item into the Subindex object. |
| 66 |
-- The Key must be one returned by ARM_Index.Add or ARM_Index.Get_Key. |
| 67 |
-- Raises Not_Valid_Error if In_Unit, Clause, or Paragraph is not |
| 68 |
-- empty when the kind does not use it. |
| 69 |
|
| 70 |
procedure Write_Subindex ( |
| 71 |
Subindex_Object : in out Subindex_Type; |
| 72 |
Output_Object : in out ARM_Output.Output_Type'Class; |
| 73 |
Use_Paragraphs : in Boolean := True; |
| 74 |
Minimize_Lines : in Boolean := False); |
| 75 |
-- Generate the given subindex to Output_Object. |
| 76 |
-- References include paragraph numbers if Use_Paragraphs is true. |
| 77 |
-- Try to minimize lines if Minimize_Lines is True. |
| 78 |
|
| 79 |
private |
| 80 |
|
| 81 |
type Item; |
| 82 |
type Item_List is access all Item; |
| 83 |
type Subindex_Type is tagged limited record |
| 84 |
Is_Valid : Boolean := False; |
| 85 |
List : Item_List; |
| 86 |
Item_Count : Natural; |
| 87 |
end record; |
| 88 |
|
| 89 |
end ARM_Subindex; |
| 90 |
|
| 91 |
|