| 1 |
package ARM_Syntax is |
| 2 |
|
| 3 |
-- |
| 4 |
-- Ada reference manual formatter (ARM_Form). |
| 5 |
-- |
| 6 |
-- This package contains the database to collect the syntax summary and |
| 7 |
-- cross-reference. |
| 8 |
-- |
| 9 |
-- --------------------------------------- |
| 10 |
-- Copyright 2000, 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 |
-- |
| 38 |
-- Edit History: |
| 39 |
-- |
| 40 |
-- 5/17/00 - RLB - Created package. |
| 41 |
-- 5/26/00 - RLB - Added a Tabset parameter. |
| 42 |
-- 6/22/06 - RLB - Added additional information to improve the links |
| 43 |
-- and to be able to use the Ada 83 format for the |
| 44 |
-- cross-reference table. |
| 45 |
-- 10/13/06 - RLB - Added Defined flag to cross-references to eliminate |
| 46 |
-- junk errors from not-quite-non-terminals. |
| 47 |
-- 10/18/11 - RLB - Changed to GPLv3 license. |
| 48 |
|
| 49 |
procedure Create; |
| 50 |
-- Initialize the syntax database. |
| 51 |
|
| 52 |
procedure Destroy; |
| 53 |
-- Destroy the syntax database. |
| 54 |
|
| 55 |
procedure Insert_Rule ( |
| 56 |
For_Clause : in String; |
| 57 |
Rule : in String; |
| 58 |
Tabset : in String := ""); |
| 59 |
-- Add a rule for the syntax summary. The rule appears in For_Clause. |
| 60 |
-- Tabset provides any needed tab settings. |
| 61 |
|
| 62 |
subtype Target_Type is String (1..5); |
| 63 |
|
| 64 |
procedure Add_Non_Terminal ( |
| 65 |
NT_Name : in String; |
| 66 |
For_Clause : in String; |
| 67 |
Link_Target : out ARM_Syntax.Target_Type); |
| 68 |
-- Add a non-terminal to the syntax list. Returns a new Link_Target |
| 69 |
-- for the Non-Terminal. |
| 70 |
|
| 71 |
procedure Add_Xref ( |
| 72 |
Name : in String; |
| 73 |
Used_In : in String; |
| 74 |
Clause : in String; |
| 75 |
Defined : in Boolean); |
| 76 |
-- Add a cross-reference entry. |
| 77 |
-- The item referenced is Name, and it is referenced in the production |
| 78 |
-- for Used_In, in Clause. It is a defined non-terminal if Defined |
| 79 |
-- is True (thus it can be linked). |
| 80 |
|
| 81 |
function Non_Terminal_Clause (NT_Name : in String) return String; |
| 82 |
-- Return the clause where NT_Name is declared. |
| 83 |
-- Returns "" if NT_Name is not a declared Non_Terminal. |
| 84 |
|
| 85 |
function Non_Terminal_Link_Target (NT_Name : in String) return Target_Type; |
| 86 |
-- Return the link target for NT_Name. |
| 87 |
-- Returns " " if NT_Name is not a declared Non_Terminal. |
| 88 |
|
| 89 |
generic |
| 90 |
with procedure Format_Text (Text : in String; |
| 91 |
Text_Name : in String); |
| 92 |
procedure Report; |
| 93 |
-- Output the fully formatted syntax summary to the |
| 94 |
-- "Format_Text" routine. "Format_Text" allows all commands |
| 95 |
-- for the full formatter. (Text_Name is an identifying name |
| 96 |
-- for error messages). |
| 97 |
|
| 98 |
generic |
| 99 |
with procedure Format_Text (Text : in String; |
| 100 |
Text_Name : in String); |
| 101 |
procedure XRef; |
| 102 |
-- Output the fully formatted syntax cross-reference to the |
| 103 |
-- "Format_Text" routine. "Format_Text" allows all commands |
| 104 |
-- for the full formatter. (Text_Name is an identifying name |
| 105 |
-- for error messages). |
| 106 |
|
| 107 |
end ARM_Syntax; |
| 108 |
|
| 109 |
|