|
|
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: 11264 (0x2c00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Find_Others_Clauses, seg_004409
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
with Log;
with Profile;
with Common;
with Add_Hyper_Table;
with Create_Null_Document;
with Lrm_Renames;
use Lrm_Renames;
with Directory_Renames;
use Directory_Renames;
with Errors;
with Simple_Status;
package body Find_Others_Clauses is
-- function Get_Others_Clause
-- (Of_This_Elem : Ada.Element) return Ada.Element is
-- Iter : Ada.Element_Iterator;
-- begin
-- case stmts.Kind (Of_This_Elem) is
-- when stmts.A_Case_Statement =>
-- Iter := stmts.Case_Arms_List (Of_This_Elem);
-- while not Ada.Done (Iter) loop
-- if stmts.Is_When_Others (Ada.Value (Iter)) then
-- return Ada.Value (Iter);
-- end if;
-- Ada.Next (Iter);
-- end loop;
-- return Ada.Nil_Element;
-- when stmts.A_Block_Statement =>
-- Iter := stmts.Block_Exception_Handler_Arms (Of_This_Elem);
-- while not Ada.Done (Iter) loop
-- declare
-- Choices_Iter : Ada.Element_Iterator :=
-- stmts.Exception_Choices (Ada.Value (Iter));
-- begin
-- while not Ada.Done (Choices_Iter) loop
-- if Types.Choice_Kind (Ada.Value (Choices_Iter)) =
-- Types.Others_Choice then
-- return Ada.Value (Choices_Iter);
-- end if;
-- Ada.Next (Choices_Iter);
-- end loop;
-- end;
-- Ada.Next (Iter);
-- end loop;
-- return Ada.Nil_Element;
-- when others =>
-- null;
-- end case;
-- end Get_Others_Clause;
procedure Add (Units : String := "";
To_Document : in out Abstract_Document.Handle;
Response : String := "<PROFILE>") is
Units_Iter : Object.Iterator := Naming.Resolution (Units);
type Columns is (Pgm_Unit, Others_Type, Line_Number, Values);
function Is_Integer_Column (C : Columns) return Boolean is
begin
case C is
when Line_Number =>
return True;
when others =>
return False;
end case;
end Is_Integer_Column;
function Is_Included (Elem : Ada.Element) return Boolean is
begin
return Types.Choice_Kind (Elem) = Types.Others_Choice;
end Is_Included;
function Column_Image (C : Columns; Elem : Ada.Element) return String is
begin
case C is
when Pgm_Unit =>
return Decls.Name
(Comp_Units.Unit_Declaration
(Comp_Units.Parent_Compilation_Unit (Elem)));
when Others_Type =>
case Ada.Kind (Ada.Parent (Elem)) is
when Ada.A_Statement =>
case Stmts.Kind (Ada.Parent (Elem)) is
when Stmts.A_Case_Statement =>
return Stmts.Statement_Kinds'Image
(Stmts.Kind (Ada.Parent (Elem)));
when Stmts.A_Block_Statement =>
return ("A Exception Handler");
when others =>
return "";
end case;
when Ada.A_Declaration =>
case Decls.Kind (Ada.Parent (Elem)) is
when Decls.A_Function_Body_Declaration |
Decls.A_Procedure_Body_Declaration |
Decls.A_Package_Body_Declaration =>
return ("A Exception Handler");
when Decls.A_Constant_Declaration |
Decls.A_Variable_Declaration |
Decls.A_Type_Declaration |
Decls.A_Subtype_Declaration =>
return ("aggregate");
when others =>
return Decls.Declaration_Kinds'Image
(Decls.Kind (Ada.Parent (Elem)));
end case;
when others =>
return "";
end case;
return (Ada.Image (Elem));
when Line_Number =>
return Natural'Image (Ada.Line_Number (Elem));
when Values =>
return "";
end case;
end Column_Image;
function Explanation (C : Columns; Elem : Ada.Element) return String is
begin
case C is
when Pgm_Unit =>
return "Parent unit containing the others clause";
when Others_Type =>
return "Where others clause is used";
when Line_Number =>
return "line number of the Others Clause";
when Values =>
return "Values which drive the Others Clause";
end case;
end Explanation;
procedure Linkage (C : Columns;
Elem : Ada.Element;
Linkage_Element : out Ada.Element;
Linkage_Elements : out Ada.Element_List) is
begin
-- default values changed within the case statement as necessary
Linkage_Element := Ada.Nil_Element;
Linkage_Elements := Ada.Nil_List;
case C is
when Pgm_Unit =>
Linkage_Element :=
Comp_Units.Parent_Compilation_Unit (Elem);
when Others_Type =>
Linkage_Element := Ada.Parent (Elem);
when Line_Number =>
Linkage_Element := Elem;
when Values =>
Linkage_Element := Ada.Nil_Element;
end case;
end Linkage;
procedure Add_Hyper_Table_To_Doc is
new Add_Hyper_Table (Is_Included,
Columns,
Is_Integer_Column,
Column_Image,
Explanation,
Linkage,
Table_Title => "Other Clause Info");
begin
if Object.Is_Bad (Units_Iter) then
Log.Put_Line (Units & " is not a valid pathname",
Profile.Error_Msg);
else
Add_Hyper_Table_To_Doc (Units_Iter, To_Document, Response);
end if;
end Add;
procedure Display (Units : String := "";
To_Preview_Object : String := "Other_Clause_Info";
Response : String := "<PROFILE>") is
Document : Abstract_Document.Handle;
Condition : Errors.Condition;
begin
Create_Null_Document (Named => To_Preview_Object,
Error_Info => Condition,
Document_Handle => Document);
case Errors.Severity (Condition) is
when Simple_Status.Problem | Simple_Status.Fatal =>
Log.Put_Line ("Problem creating object " & To_Preview_Object &
". " & Errors.Info (Condition),
Profile.Error_Msg);
when others =>
Add (Units, Document, Response);
Abstract_Document.Close (Document);
Common.Definition (To_Preview_Object);
end case;
end Display;
end Find_Others_Clauses;
nblk1=a
nid=0
hdr6=14
[0x00] rec0=1f rec1=00 rec2=01 rec3=054
[0x01] rec0=17 rec1=00 rec2=02 rec3=03e
[0x02] rec0=1c rec1=00 rec2=03 rec3=014
[0x03] rec0=10 rec1=00 rec2=04 rec3=066
[0x04] rec0=11 rec1=00 rec2=05 rec3=036
[0x05] rec0=19 rec1=00 rec2=06 rec3=046
[0x06] rec0=18 rec1=00 rec2=07 rec3=05a
[0x07] rec0=00 rec1=00 rec2=0a rec3=002
[0x08] rec0=18 rec1=00 rec2=08 rec3=06e
[0x09] rec0=0f rec1=00 rec2=09 rec3=000
tail 0x2170016d0815c639114dd 0x42a00088462061e03