|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 4820 (0x12d4)
Types: TextFile
Names: »B«
└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
└─⟦5cb1d1d7f⟧ »DATA«
└─⟦3b1ee7bd8⟧
└─⟦this⟧
with Log;
with Names;
with Syntax;
with Profile;
with Pathnames;
with Directory_Tools;
package body Structure_Utilities is
subtype Section is Structure.Section;
subtype Item is Structure.Item;
function "=" (This_Section_Kind : in Syntax.Section_Kinds;
That_Section_Kind : in Syntax.Section_Kinds)
return Boolean renames Syntax."=";
function "=" (This_Item_Kind : in Syntax.Item_Kinds;
That_Item_Kind : in Syntax.Item_Kinds) return Boolean
renames Syntax."=";
function Catalog_For (This_Version : in Full_Name) return Catalog is
begin
return (Structure.Catalog_From
(Pathnames.Data_File_For (This_Version)));
end Catalog_For;
function Dont_Want (This_Section : in Section) return Boolean is
begin
return (Structure.Kind_Of (This_Section) = Syntax.Text);
end Dont_Want;
function Dont_Want (This_Item : in Item) return Boolean is
begin
return (Structure.Kind_Of (This_Item) = Syntax.Environment);
end Dont_Want;
function Filtered is new Structure.Filtered_Version_Of (Dont_Want,
Dont_Want);
function Filtered_Catalog_From (This_Catalog : in Catalog) return Catalog is
--
The_Filtered_Catalog : Structure.Catalog := Filtered (This_Catalog);
--
begin
Structure.Assert_Is_Good (The_Filtered_Catalog);
return (The_Filtered_Catalog);
end Filtered_Catalog_From;
procedure Display_Diagnostic
(For_Catalog : in out Catalog;
Response : in String;
Display_Progress_Messages : in Boolean := False;
Display_Warning_Messages : in Boolean := False;
Display_Error_Messages : in Boolean := True) is
--
Old_Response_Profile : Profile.Response_Profile := Profile.Get;
New_Response_Profile : Profile.Response_Profile :=
Profile.Value (Response);
--
The_Diagnostic : Structure.Diagnostic :=
Structure.Diagnostic_For (For_Catalog);
--
begin
Profile.Set (New_Response_Profile);
Structure.Reset (The_Diagnostic);
while (not Structure.Done (The_Diagnostic)) loop
case Structure.Kind_Of
(Structure.Current_Message (The_Diagnostic)) is
when Structure.Progress =>
if (Display_Progress_Messages) then
Log.Put_Line (Structure.Contents_Of
(Structure.Current_Message
(The_Diagnostic)),
Profile.Positive_Msg);
end if;
when Structure.Warning =>
if (Display_Warning_Messages) then
Log.Put_Line (Structure.Contents_Of
(Structure.Current_Message
(The_Diagnostic)),
Profile.Warning_Msg);
end if;
when Structure.Error =>
if (Display_Error_Messages) then
Log.Put_Line (Structure.Contents_Of
(Structure.Current_Message
(The_Diagnostic)),
Profile.Error_Msg);
end if;
end case;
Structure.Next (The_Diagnostic);
end loop;
Profile.Set (Old_Response_Profile);
--
exception
when others =>
Profile.Set (Old_Response_Profile);
raise;
--
end Display_Diagnostic;
procedure Verify (This_Catalog : in out Structure.Catalog;
Response : in String) is
--
The_Temporary_Data_File : constant String :=
Names.Unique_Temporary_File_Name;
--
The_Test_Catalog : Structure.Catalog;
--
begin
Structure.Save (This_Catalog, The_Temporary_Data_File);
The_Test_Catalog := Structure.Catalog_From (The_Temporary_Data_File);
Structure.Assert_Is_Good (The_Test_Catalog);
--
exception
when Structure.Io_Failure =>
Log.Put_Line ("Problem encountered with temporary file",
Profile.Error_Msg);
raise;
--
when Structure.Bad_Element =>
Display_Diagnostic (The_Test_Catalog,
Response => Response,
Display_Warning_Messages => True);
raise;
--
end Verify;
end Structure_Utilities;