|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 38912 (0x9800)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package Abstract_Document, pragma Module_Name 4 3590, pragma Segmented_Heap Handle, pragma Segmented_Heap Node, pragma Subsystem Design_Facility, seg_001c5d
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
with Errors;
with Heap_Strings;
with Mapping;
package Abstract_Document is
subtype Astring is Heap_Strings.Astring;
subtype Pathname is String;
subtype Pathnames is String; -- NAMING.NAME format.
subtype Text is String;
subtype Title_Text is String;
Point : constant := 1.0 / 72;
type Inches is digits 5 range 0.0 .. 100.0; -- For Graphic sizes
Default_Size : constant Inches := 0.0;
type Percentage is digits 5 range 0.0 .. 100.0; -- For Table column sizes
Default_Percentage : constant Percentage := 1.0;
type Position is (Left,
Right,
Center,
Fill); -- For Cover_Item & column-header
type Linkage_Info (Valid : Boolean := False) is private;
Nil_Linkage : constant Linkage_Info;
function Is_Nil (For_Linkage : Linkage_Info) return Boolean;
subtype Font_Families is Text;
Default_Font_Family : constant Font_Families := "";
subtype Font_Styles is Text;
Default_Font_Style : constant Font_Styles := "";
type Point_Sizes is new Natural range 0 .. 255;
Default_Point_Size : constant Point_Sizes := 0;
Default_User_Info : constant Text := "";
type Format_Info (Valid : Boolean := False) is private;
Nil_Format : constant Format_Info;
function Is_Nil (For_Format : Format_Info) return Boolean;
type Handle is private;
type Access_Mode is (Read,
Write,
Read_Write);
procedure Open (The_Document : in out Handle;
Name : Pathname;
Status : in out Errors.Condition;
Mode : Access_Mode := Read;
Check_Obsolescence : Boolean := True);
procedure Create (The_Document : in out Handle;
Name : Pathname;
Status : in out Errors.Condition;
Mode : Access_Mode := Write;
Check_Obsolescence : Boolean := True);
procedure Close (The_Document : in out Handle);
-- If an interface operation raises FAILED, a status condition
-- can be extracted from the handle associated with that operation,
-- and an error message can be written.
Failed : exception;
Uninitialized_Handle : exception;
procedure Get_Status (From_Handle : Handle;
Result : in out Errors.Condition);
pragma Page;
-- Documents are organized as trees with nodes having a kind.
-- Documents may be traversed by asking for Parent, Brother,
-- and children starting at the Root node.
-- Kind-dependent operations may be performed on nodes
-- to extract interesting information about them.
type Node_Kinds is (Nil,
Root,
Cover,
Cover_Item,
Paragraph,
Appendix,
Text_Block,
File,
Graphic,
List,
List_Item,
Table,
Table_Row,
Table_Column,
Table_Entry,
White_Space,
User_Defined,
Future_Node_1,
Future_Node_2,
Future_Node_3,
Future_Node_4);
type Node is private;
Nil_Node : constant Node;
function Is_Nil (For_Node : Node) return Boolean;
function Kind (Of_Node : Node) return Node_Kinds;
function Is_Root (A_Node : Node) return Boolean;
function Root_Node (Of_Document : Handle) return Node;
--------------------------------------------------------
-- This generic VISITs the nodes in the document in --
-- the order appropriate for printing a document. --
-- NOTE : This generic generates garbage and thus --
-- should only be instantiated within a procedure --
-- or in a non-permanent job. --
--------------------------------------------------------
type Visit_Status is (Ok,
Abandon_Children,
Abandon_Brothers,
Complete);
generic
with procedure Operation (On_Node : Node; Status : out Visit_Status);
procedure Visit_Nodes (Start_Node : Node);
pragma Page;
------------------------------
-- DOCUMENT ENTRY INTERFACE --
------------------------------
package Specify is
----------------------------------------------------------------
-- Every document must start with a COVER,
-- and every Cover must contain at least one Cover_Item.
-- A COVER_ITEM can only be inserted within a Cover, but a Cover
-- can also contain File, Graphic, or White_Space nodes.
-- The Cover is done when the first PARAGRAPH call is made.
----------------------------------------------------------------
procedure Cover (Document : Handle;
User_Info : Text;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
procedure Cover_Item (Document : Handle;
Item : Title_Text;
Line_Positions : Position := Center;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
-----------------------------------------------------------------------
-- Sectioning operations.
-----------------------------------------------------------------------
--
-- PARAGRAPH causes the section level to be reset to 1 and sets the
-- level-1 section number (the current paragraph number) to NUMBERED.
-- Every document must have at least one Paragraph, and
-- Paragraph numbers (NUMBERED) must be in increasing order.
-- A Paragraph is composed of a sequence of Text_Block, File, Graphic,
-- List, Table, White_Space, User_Defined and/or sub-Paragraph nodes.
-- NEW_LEVEL increments to the next section level and sets that
-- level's section number to 0. Nothing is output to the document.
-- NEXT_SUB_PARAGRAPH causes the current level's (rightmost) section
-- number to be incremented.
-- NEW_SUB_PARAGRAPH is equivalent to NEW_LEVEL followed by
-- NEXT_SUB_PARAGRAPH, i.e., it increments to the next
-- section level and sets that level's section number to 1.
-- END_LEVEL decrements the section level.
-- xxx_LEVEL operations are used for setting up a loop which uses
-- NEXT_SUB_PARAGRAPH to generate nested sections.
-- APPENDIX is like PARAGRAPH except for the numbering format
-- (Roman numerals or letters).
-- Appendix numbers (NUMBERED) must be in increasing order.
-- A PARAGRAPH cannot follow an APPENDIX.
-----------------------------------------------------------------------
procedure Paragraph (Document : Handle;
Numbered : Positive;
Title : Title_Text;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
procedure Appendix (Document : Handle;
Numbered : Positive;
Title : Title_Text;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
procedure New_Sub_Paragraph (Document : Handle;
Title : Title_Text;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
procedure Next_Sub_Paragraph (Document : Handle;
Title : Title_Text;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
procedure New_Level (Document : Handle);
procedure End_Level (Document : Handle);
-----------------------------------------------------------------
-- The TEXT_BLOCK procedure causes a block of text to be inserted
-- in the body of the document (within a Paragraph or Appendix)
-- or in the body of a List_Item.
-----------------------------------------------------------------
procedure Text_Block (Document : Handle;
T : Text;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
-----------------------------------------------------------------------
-- Operations to insert text FILE or GRAPHIC objects into the DOCUMENT.
-- They can go into the Cover, a Paragraph/Appendix, or a List_Item.
-- For GRAPHIC objects, the FROM_PATHNAMES parameter may resolve to
-- multiple objects. These objects map to device-dependent graphic
-- files to be included in the generated markup language.
-----------------------------------------------------------------------
procedure File (Document : Handle;
From_Pathnames : Pathnames;
Explain : Text := "";
Format : Format_Info := Nil_Format);
procedure Graphic (Document : Handle;
From_Pathnames : Pathnames;
Title : Title_Text;
Preface : Text;
Size : Inches := Default_Size;
Perform_Scaling : Boolean := False;
Explain : Text := "";
Format : Format_Info := Nil_Format);
--------------------------------------------------------------------
-- List description operations.
--------------------------------------------------------------------
--
-- A List is composed of one or more List_Items, each of which has a
-- header, and a body composed of a sequence of Text_Block, File,
-- Graphic, List, Table, White_Space, and/or User_Defined nodes.
-- If Linkage and/or Format is not included in a List node when
-- it is constructed (by a START_LIST), it can be inserted by
-- the corresponding END_LIST.
--------------------------------------------------------------------
procedure Start_List (Document : Handle;
Title : Title_Text;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
procedure List_Item (Document : Handle;
Header_Text : Text;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
procedure End_List (Document : Handle;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
----------------------------------------------------------------------
-- Table description operations.
----------------------------------------------------------------------
--
-- COLUMN_INFORMATION is used to define a table's columns.
-- The column information is done when the first TABLE_ENTRY
-- call is made. If COLUMNS is defaulted to 0, the actual number
-- of columns supplied will be used, but otherwise the number
-- supplied must match COLUMNS. All rows of a Table must be filled,
-- so if there are 3 columns, the total number of Table_Entrys
-- must be a multiple of 3. A Table must have at least one entry
-- (at least one column and one row).
-- If Linkage and/or Format is not included in a Table node when
-- it is constructed (by a START_TABLE), it can be inserted by
-- the corresponding END_TABLE.
----------------------------------------------------------------------
procedure Start_Table (Document : Handle;
Name : Title_Text;
Preface : Text;
Columns : Natural := 0;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
procedure Column_Information
(Document : Handle;
Title : Title_Text;
Entry_Justification : Position := Center;
Percentage_Size : Percentage := Default_Percentage;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
procedure Table_Entry (Document : Handle;
Item_Text : Title_Text;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
procedure End_Table (Document : Handle;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
----------------------------------------------------------------
-- Miscellaneous
----------------------------------------------------------------
--
-- These 'White-Space' nodes can appear in a Cover, Paragraph,
-- Appendix, or List, but not in a Table.
----------------------------------------------------------------
procedure New_Page (Document : Handle; Count : Positive := 1);
procedure Blank_Line (Document : Handle; Count : Positive := 1);
-----------------------------------------------------------------------
-- A USER_DEFINED node is similar to a TEXT_BLOCK but has an additional
-- user-defined data that will not be presented in the PREVIEW OE.
-- USER_DEFINED nodes can appear anywhere in a document.
-----------------------------------------------------------------------
procedure User_Defined (Document : Handle;
T : Text;
User_Data : Text;
Linkage : Linkage_Info := Nil_Linkage;
Format : Format_Info := Nil_Format);
-----------------------------------------------
-- Routines for generating Linkages.
-- Storage is allocated in the document's heap.
-----------------------------------------------
function Gen_Linkage (Document : Handle;
Explain : Text := "";
Definition : Mapping.Target_Info :=
Mapping.Nil_Target_Info;
Usage : Mapping.Target_Info :=
Mapping.Nil_Target_Info;
Derivation : Mapping.Target_Info :=
Mapping.Nil_Target_Info) return Linkage_Info;
-----------------------------------------------
-- Construction operation for Format data.
-- Storage is allocated in the document's heap.
-----------------------------------------------
function Gen_Format
(Document : Handle;
Font_Family : Font_Families := Default_Font_Family;
Font_Style : Font_Styles := Default_Font_Style;
Point_Size : Point_Sizes := Default_Point_Size;
User_Info : Text := Default_User_Info) return Format_Info;
end Specify;
pragma Page;
--------------------------
-- EXTRACTION INTERFACE --
--------------------------
package Extract is
---------------------------------
-- Node-independent operations --
---------------------------------
function Parent (Of_Node : Node) return Node;
function Brother (Of_Node : Node) return Node;
function Linkage (Of_Node : Node) return Linkage_Info;
function Format (Of_Node : Node) return Format_Info;
function Image (Of_Node : Node) return String;
function Image (Of_Handle : Handle) return String;
-- The following provide debugger Image functions --
-- for Abstract_Document's private types --
function Debug_Image (Of_Linkage : Linkage_Info;
Level : Natural;
Prefix : String;
Expand_Pointers : Boolean) return String;
function Debug_Image (Of_Format : Format_Info;
Level : Natural;
Prefix : String;
Expand_Pointers : Boolean) return String;
function Debug_Image (Of_Handle : Handle;
Level : Natural;
Prefix : String;
Expand_Pointers : Boolean) return String;
function Debug_Image (Of_Node : Node;
Level : Natural;
Prefix : String;
Expand_Pointers : Boolean) return String;
-- ROOT --
function Cover (Root_Node : Node) return Node;
function First_Paragraph (Root_Node : Node) return Node;
-- COVER --
function First_Cover_Item (Cover_Node : Node) return Node;
function Cover_Info (Cover_Node : Node) return String;
function Cover_Item_Text (Cover_Item_Node : Node) return String;
function Cover_Item_Justification
(Cover_Item_Node : Node) return Position;
-- PARAGRAPHs and APPENDIXs - composed of NUMBER and TITLE --
function Paragraph_Number
(Paragraph_Or_Appendix_Node : Node) return String;
-- eg : "3.4.5".
function Para_Depth (Paragraph_Or_Appendix_Node : Node) return Natural;
function Para_Index (Paragraph_Or_Appendix_Node : Node) return Natural;
function Paragraph_Title
(Paragraph_Or_Appendix_Node : Node) return String;
function First_Contents (Paragraph_Or_Appendix_Node : Node) return Node;
-- TEXT_BLOCKs and USER_DEFINED --
-- Use IMAGE, LINKAGE, and FORMAT to get info about these --
function User_Data (User_Defined_Node : Node) return String;
-- GRAPHICs and FILEs - composed of FILE_NAME and optional scaling info
function File_Name (Graphic_Or_File_Node : Node) return String;
function Graphic_Title (Graphic_Node : Node) return String;
function Graphic_Preface (Graphic_Node : Node) return String;
function Graphic_Size (Graphic_Node : Node) return Inches;
function Perform_Scaling (Graphic_Node : Node) return Boolean;
-- LISTs - composed of LIST_ITEMs, each with a header. --
-- Use BROTHER on a LIST_ITEM node to get the next item. --
function List_Count (List_Node : Node) return Natural;
function List_Title (List_Node : Node) return String;
function First_List_Item (List_Node : Node) return Node;
function Header_Text (List_Item_Node : Node) return String;
function First_List_Contents (List_Item_Node : Node) return Node;
-- TABLEs - composed of column information and rows of TABLE_ENTRYs --
function Table_Title (Table_Node : Node) return String;
function Table_Preface (Table_Node : Node) return String;
function Column_Count (Table_Node : Node) return Natural;
function Row_Count (Table_Node : Node) return Natural;
function First_Column (Table_Node : Node) return Node;
function First_Row (Table_Node : Node) return Node;
function Column_Title (Table_Column_Node : Node) return String;
function Column_Justification
(Table_Column_Node : Node) return Position;
function Column_Percentage_Size
(Table_Column_Node : Node) return Percentage;
function First_Table_Entry (Table_Row_Node : Node) return Node;
-- COLUMNs may have LINKAGE/FORMAT info; so may TABLE_ENTRYs. --
-- Use IMAGE, LINKAGE, and FORMAT to get info about TABLE_ENTRYs. --
-- Use BROTHER to get next for ROWs, COLUMNs, and TABLE_ENTRYs. --
-- WHITE_SPACE - composed of an image of the requested spacing --
-- (use IMAGE). ASCII.LFs indicate new lines, ASCII.FFs new pages. --
-- LINKAGE --
function Explain_Text (For_Linkage : Linkage_Info) return String;
function Definition (For_Linkage : Linkage_Info)
return Mapping.Target_Info;
function Usage (For_Linkage : Linkage_Info) return Mapping.Target_Info;
function Derivation (For_Linkage : Linkage_Info)
return Mapping.Target_Info;
function Image (Of_Linkage : Linkage_Info) return String;
-- The following produce string representations of the items LINKed to
function Definition (For_Linkage : Linkage_Info) return String;
function Usage (For_Linkage : Linkage_Info) return String;
function Derivation (For_Linkage : Linkage_Info) return String;
-- FORMAT --
function Font_Family (For_Format : Format_Info) return Font_Families;
function Font_Style (For_Format : Format_Info) return Font_Styles;
function Point_Size (For_Format : Format_Info) return Point_Sizes;
function User_Info (For_Format : Format_Info) return String;
function Image (Of_Format : Format_Info) return String;
-- Raise this exception if anything is wrong with the node --
Bad_Node : exception;
-- Raise this exception if DEFINITION, USAGE or DERIVATION
-- have resolution problems. Use the STATUS call to get the
-- error status associated with the resolution problem.
Bad_Linkage : exception;
function Status return Errors.Condition;
end Extract;
pragma Subsystem (Design_Facility, Closed);
pragma Module_Name (4, 3590);
pragma Bias_Key (109);
private
type Handle_Object;
type Handle is access Handle_Object;
pragma Segmented_Heap (Handle);
type Node_Data (Kind : Node_Kinds := Nil;
Has_Linkage : Boolean := False;
Has_Format : Boolean := False);
type Node is access Node_Data;
pragma Segmented_Heap (Node);
Nil_Node : constant Node := null;
type String_Table_Index is new Natural range 0 .. 2 ** 16 - 1;
type Linkage_Entry (Valid : Boolean := False) is
record
case Valid is
when True =>
Explain : String_Table_Index;
Definition : String_Table_Index;
Usage : String_Table_Index;
Derivation : String_Table_Index;
when False =>
null;
end case;
end record;
-- This structure is used to pass along linkage information.
type Linkage_Info (Valid : Boolean := False) is
record
The_Entry : Linkage_Entry (Valid => Valid);
case Valid is
when True =>
Assoc_Node : Node;
when False =>
null;
end case;
end record;
Nil_Linkage : constant Linkage_Info :=
Linkage_Info'(Valid => False,
The_Entry => Linkage_Entry'(Valid => False));
type Format_Entry (Valid : Boolean := False) is
record
case Valid is
when True =>
Font_Family : String_Table_Index;
Font_Style : String_Table_Index;
Point_Size : Point_Sizes;
User_Info : String_Table_Index;
when False =>
null;
end case;
end record;
-- This structure is used to pass along format information.
type Format_Info (Valid : Boolean := False) is
record
The_Entry : Format_Entry (Valid => Valid);
case Valid is
when True =>
Assoc_Node : Node;
when False =>
null;
end case;
end record;
Nil_Format : constant Format_Info :=
Format_Info'(Valid => False, The_Entry => Format_Entry'(Valid => False));
-- The following limits are enforced for an Abstract Document:
--
-- Maximum paragraph number = 65535
-- Maximum number of paragraph levels = 65535
-- Maximum paragraph nesting level = 15
-- Maximum number of items in a list = 65535
-- Maximum nesting level for lists = 15
-- Maximum number of columns in a table = 255
-- Maximum number of rows in a table = 65535
end Abstract_Document;
nblk1=25
nid=0
hdr6=4a
[0x00] rec0=23 rec1=00 rec2=01 rec3=00a
[0x01] rec0=00 rec1=00 rec2=25 rec3=012
[0x02] rec0=1e rec1=00 rec2=02 rec3=06c
[0x03] rec0=1a rec1=00 rec2=03 rec3=05e
[0x04] rec0=00 rec1=00 rec2=24 rec3=016
[0x05] rec0=1e rec1=00 rec2=04 rec3=022
[0x06] rec0=1c rec1=00 rec2=05 rec3=034
[0x07] rec0=15 rec1=00 rec2=06 rec3=032
[0x08] rec0=10 rec1=00 rec2=07 rec3=062
[0x09] rec0=11 rec1=00 rec2=08 rec3=07c
[0x0a] rec0=15 rec1=00 rec2=09 rec3=024
[0x0b] rec0=12 rec1=00 rec2=0a rec3=06a
[0x0c] rec0=12 rec1=00 rec2=0b rec3=098
[0x0d] rec0=12 rec1=00 rec2=0c rec3=028
[0x0e] rec0=12 rec1=00 rec2=0d rec3=02e
[0x0f] rec0=11 rec1=00 rec2=0e rec3=058
[0x10] rec0=14 rec1=00 rec2=0f rec3=05c
[0x11] rec0=14 rec1=00 rec2=10 rec3=024
[0x12] rec0=13 rec1=00 rec2=11 rec3=012
[0x13] rec0=1e rec1=00 rec2=12 rec3=062
[0x14] rec0=00 rec1=00 rec2=23 rec3=008
[0x15] rec0=14 rec1=00 rec2=13 rec3=080
[0x16] rec0=18 rec1=00 rec2=14 rec3=084
[0x17] rec0=01 rec1=00 rec2=22 rec3=02c
[0x18] rec0=14 rec1=00 rec2=15 rec3=084
[0x19] rec0=01 rec1=00 rec2=21 rec3=01a
[0x1a] rec0=13 rec1=00 rec2=16 rec3=000
[0x1b] rec0=01 rec1=00 rec2=20 rec3=04a
[0x1c] rec0=19 rec1=00 rec2=17 rec3=084
[0x1d] rec0=19 rec1=00 rec2=18 rec3=01e
[0x1e] rec0=00 rec1=00 rec2=1f rec3=008
[0x1f] rec0=1f rec1=00 rec2=19 rec3=014
[0x20] rec0=00 rec1=00 rec2=1e rec3=010
[0x21] rec0=1f rec1=00 rec2=1a rec3=010
[0x22] rec0=00 rec1=00 rec2=1d rec3=008
[0x23] rec0=1c rec1=00 rec2=1b rec3=052
[0x24] rec0=05 rec1=00 rec2=1c rec3=001
tail 0x20100f6807da18db15dd3 0x42a00088462065003