| 1 |
with ARM_Output; |
| 2 |
package ARM_Index is |
| 3 |
|
| 4 |
-- |
| 5 |
-- Ada reference manual formatter (ARM_Form). |
| 6 |
-- |
| 7 |
-- This package contains the routines to manage and generate the index. |
| 8 |
-- |
| 9 |
-- --------------------------------------- |
| 10 |
-- Copyright 2000, 2005, 2006, 2011 |
| 11 |
-- AXE Consultants. All rights reserved. |
| 12 |
-- P.O. Box 1512, Madison WI 53701 |
| 13 |
-- E-Mail: [email protected] |
| 14 |
-- |
| 15 |
-- ARM_Form is free software: you can redistribute it and/or modify |
| 16 |
-- it under the terms of the GNU General Public License version 3 |
| 17 |
-- as published by the Free Software Foundation. |
| 18 |
-- |
| 19 |
-- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS" |
| 20 |
-- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY, |
| 21 |
-- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL. |
| 22 |
-- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL, |
| 23 |
-- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES, |
| 24 |
-- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH |
| 25 |
-- DAMAGES. |
| 26 |
-- |
| 27 |
-- A copy of the GNU General Public License is available in the file |
| 28 |
-- gpl-3-0.txt in the standard distribution of the ARM_Form tool. |
| 29 |
-- Otherwise, see <http://www.gnu.org/licenses/>. |
| 30 |
-- |
| 31 |
-- If the GPLv3 license is not satisfactory for your needs, a commercial |
| 32 |
-- use license is available for this tool. Contact Randy at AXE Consultants |
| 33 |
-- for more information. |
| 34 |
-- |
| 35 |
-- --------------------------------------- |
| 36 |
-- |
| 37 |
-- Edit History: |
| 38 |
-- |
| 39 |
-- 5/28/00 - RLB - Created package. |
| 40 |
-- 8/11/00 - RLB - Made Clean visible. |
| 41 |
-- 10/28/05 - RLB - Added key reuse. |
| 42 |
-- 10/30/05 - RLB - Added subtype declaration. |
| 43 |
-- 2/17/06 - RLB - Added Remove_Soft_Hyphens flag to Clean (for output). |
| 44 |
-- 10/18/11 - RLB - Changed to GPLv3 license. |
| 45 |
|
| 46 |
Not_Valid_Error : exception; |
| 47 |
|
| 48 |
subtype Index_Key is Natural range 0 .. 20000; |
| 49 |
|
| 50 |
procedure Create; |
| 51 |
-- Initialize this package. |
| 52 |
|
| 53 |
procedure Destroy; |
| 54 |
-- Finalize this package; make sure the index is empty. |
| 55 |
|
| 56 |
type Index_Item_Kind_Type is ( |
| 57 |
Primary_Term, -- A primary index term. |
| 58 |
Partial_Term, -- A partial index term. |
| 59 |
Primary_Term_and_Subterm, -- A primary index term with a subterm. |
| 60 |
Partial_Term_with_Subterm, -- A partial index term with a subterm. |
| 61 |
Syntax_NT_Used, -- A non-terminal, with a subterm of "Used". |
| 62 |
Child_Unit_Parent, -- A child unit, with a subterm of "child of <subterm>". |
| 63 |
Declaration_in_Package, -- A declaration, with a subterm of "in <package>". |
| 64 |
SubDeclaration_in_Package, -- A term, with a subterm of "<item> in <package>". |
| 65 |
Subtype_Declaration_in_Package, -- A term (of the form "<item> subtype of <item2>, with a subterm of "in <package>". |
| 66 |
See_Term, -- A "see <subterm>" with reference. |
| 67 |
See_Also_Term, -- A "see also <subterm>" with reference. |
| 68 |
See_Other_Term, -- A "see <subterm>" without reference. |
| 69 |
See_Also_Other_Term); -- A "see also <subterm>" without reference. |
| 70 |
-- Note: These are declared in the sorting order. |
| 71 |
|
| 72 |
function Get_Key return Index_Key; |
| 73 |
-- Returns a Key value to refer to one or more index entries |
| 74 |
-- (for a single entity). |
| 75 |
|
| 76 |
procedure Add (Term : in String; |
| 77 |
Subterm : in String := ""; |
| 78 |
Kind : in Index_Item_Kind_Type := Primary_Term; |
| 79 |
Clause : in String := ""; |
| 80 |
Paragraph : in String := ""; |
| 81 |
Key : out Index_Key); |
| 82 |
-- Add an index reference to the index. Returns a Key value to |
| 83 |
-- refer to this index entry. |
| 84 |
-- Raises Not_Valid_Error if Subterm, Clause, or Paragraph is not |
| 85 |
-- empty when the kind does not use it. |
| 86 |
|
| 87 |
procedure Add_Reusing_Key (Term : in String; |
| 88 |
Subterm : in String := ""; |
| 89 |
Kind : in Index_Item_Kind_Type := Primary_Term; |
| 90 |
Clause : in String := ""; |
| 91 |
Paragraph : in String := ""; |
| 92 |
Key : in Index_Key); |
| 93 |
-- Add an index reference to the index, (re)using the specified Key |
| 94 |
-- to refer to this index entry. Key must have previously |
| 95 |
-- returned by Add or Get_Key. |
| 96 |
-- Raises Not_Valid_Error if Subterm, Clause, or Paragraph is not |
| 97 |
-- empty when the kind does not use it. |
| 98 |
|
| 99 |
function Clean (Item : in String; |
| 100 |
Remove_Soft_Hyphens : in Boolean) return String; |
| 101 |
-- Remove any commands from Item. (Except for soft hyphens |
| 102 |
-- if Remove_Soft_Hyphens is False.) |
| 103 |
|
| 104 |
procedure Generate_Index_Body (Output_Object : in out ARM_Output.Output_Type'Class; |
| 105 |
Use_Paragraphs : in Boolean := True); |
| 106 |
-- Generate the index body. (The section header has already been |
| 107 |
-- generated). References include paragraph numbers if Use_Paragraphs |
| 108 |
-- is true. |
| 109 |
|
| 110 |
end ARM_Index; |