|
|
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: 13312 (0x3400)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Ada_Constructs, seg_0043f1
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
with Io;
with String_Utilities;
with More_String_Utilities;
with Table_Formatter;
package body Ada_Constructs is
function "+" (Left, Right : Construct_Counts) return Construct_Counts is
Result : Construct_Counts;
begin
for I in Ada.Element_Kinds loop
Result.Majors (I) := Left.Majors (I) + Right.Majors (I);
end loop;
for I in Decls.Declaration_Kinds loop
Result.Decls (I) := Left.Decls (I) + Right.Decls (I);
end loop;
for I in Ada.Id_Kinds loop
Result.Ids (I) := Left.Ids (I) + Right.Ids (I);
end loop;
for I in Decls.Subprogram_Parameter_Kinds loop
Result.Param_Modes (I) :=
Left.Param_Modes (I) + Right.Param_Modes (I);
end loop;
for I in Decls.Generic_Parameter_Kinds loop
Result.Generic_Params (I) :=
Left.Generic_Params (I) + Right.Generic_Params (I);
end loop;
for I in Representation_Clauses.Representation_Clause_Kinds loop
Result.Reps (I) := Left.Reps (I) + Right.Reps (I);
end loop;
for I in Representation_Clauses.Length_Clause_Attribute_Kinds loop
Result.Length_Clauses (I) :=
Left.Length_Clauses (I) + Right.Length_Clauses (I);
end loop;
for I in Comp_Units.Context_Clause_Kinds loop
Result.Contexts (I) := Left.Contexts (I) + Right.Contexts (I);
end loop;
for I in Stmts.Statement_Kinds loop
Result.Statements (I) := Left.Statements (I) + Right.Statements (I);
end loop;
for I in Stmts.Loop_Kinds loop
Result.Loops (I) := Left.Loops (I) + Right.Loops (I);
end loop;
for I in Stmts.Select_Alternative_Kinds loop
Result.Select_Alternatives (I) :=
Left.Select_Alternatives (I) + Right.Select_Alternatives (I);
end loop;
for I in Exprs.Expression_Kinds loop
Result.Expressions (I) :=
Left.Expressions (I) + Right.Expressions (I);
end loop;
for I in Types.Type_Definition_Kinds loop
Result.Types (I) := Left.Types (I) + Right.Types (I);
end loop;
Result.Pragmas.Unknown := Left.Pragmas.Unknown + Right.Pragmas.Unknown;
for I in Predefined_Pragmas loop
Result.Pragmas.Predefined (I) :=
Left.Pragmas.Predefined (I) + Right.Pragmas.Predefined (I);
end loop;
for I in Implementation_Dependent_Pragmas loop
Result.Pragmas.Implementation_Dependent (I) :=
Left.Pragmas.Implementation_Dependent (I) +
Right.Pragmas.Implementation_Dependent (I);
end loop;
Result.Comp_Units.Unit_Count :=
Left.Comp_Units.Unit_Count + Right.Comp_Units.Unit_Count;
Result.Comp_Units.Subunit_Count :=
Left.Comp_Units.Subunit_Count + Right.Comp_Units.Subunit_Count;
Result.Comp_Units.Main_Count :=
Left.Comp_Units.Main_Count + Right.Comp_Units.Main_Count;
return Result;
end "+";
procedure Comp_Unit_Kind (Element : in Ada.Element;
Counts : in out Construct_Counts) is
Comp_Unit_Decl : Ada.Element;
begin
Counts.Comp_Units.Unit_Count := Counts.Comp_Units.Unit_Count + 1;
if Comp_Units.Is_Subunit (Element) then
Counts.Comp_Units.Subunit_Count :=
Counts.Comp_Units.Subunit_Count + 1;
end if;
Comp_Unit_Decl := Comp_Units.Unit_Declaration (Element);
case Decls.Kind (Comp_Unit_Decl) is
when Decls.A_Function_Declaration | Decls.A_Procedure_Declaration =>
if Comp_Units.Is_Main_Program (Element) then
Counts.Comp_Units.Main_Count :=
Counts.Comp_Units.Main_Count + 1;
end if;
when others =>
null;
end case;
end Comp_Unit_Kind;
procedure Minor_Kind (Element : in Ada.Element;
Counts : in out Construct_Counts) is
begin
Counts.Ids (Ada.Id_Kind (Element)) :=
Counts.Ids (Ada.Id_Kind (Element)) + 1;
Counts.Expressions (Exprs.Kind (Element)) :=
Counts.Expressions (Exprs.Kind (Element)) + 1;
Counts.Types (Types.Kind (Element)) :=
Counts.Types (Types.Kind (Element)) + 1;
end Minor_Kind;
procedure Analyze (Element : in Ada.Element;
Counts : in out Construct_Counts) is
Element_Kind : Ada.Element_Kinds := Ada.Kind (Element);
Pragma_Kind : Pragmas.Pragma_Kinds;
Decl_Kind : Decls.Declaration_Kinds;
Stmt_Kind : Stmts.Statement_Kinds;
Rep_Kind : Rep_Specs.Representation_Clause_Kinds;
begin
Counts.Majors (Element_Kind) := Counts.Majors (Element_Kind) + 1;
case Element_Kind is
when Ada.A_Compilation_Unit =>
Comp_Unit_Kind (Element, Counts);
when Ada.A_Context_Clause =>
Counts.Contexts (Comp_Units.Context_Clause_Kind (Element)) :=
Counts.Contexts (Comp_Units.Context_Clause_Kind (Element)) +
1;
when Ada.A_Declaration =>
Decl_Kind := Decls.Kind (Element);
Counts.Decls (Decl_Kind) := Counts.Decls (Decl_Kind) + 1;
case Decl_Kind is
when Decls.A_Subprogram_Formal_Parameter =>
Counts.Param_Modes
(Decls.Subprogram_Parameter_Kind (Element)) :=
Counts.Param_Modes
(Decls.Subprogram_Parameter_Kind (Element)) + 1;
when Decls.A_Generic_Formal_Parameter =>
Counts.Generic_Params
(Decls.Generic_Parameter_Kind (Element)) :=
Counts.Generic_Params
(Decls.Generic_Parameter_Kind (Element)) + 1;
when others =>
null;
end case;
when Ada.A_Statement =>
Stmt_Kind := Stmts.Kind (Element);
Counts.Statements (Stmt_Kind) :=
Counts.Statements (Stmt_Kind) + 1;
case Stmt_Kind is
when Stmts.A_Loop_Statement =>
Counts.Loops (Stmts.Loop_Kind (Element)) :=
Counts.Loops (Stmts.Loop_Kind (Element)) + 1;
when Stmts.A_Select_Statement =>
Counts.Select_Alternatives
(Stmts.Select_Alternative_Kind (Element)) :=
Counts.Select_Alternatives
(Stmts.Select_Alternative_Kind (Element)) + 1;
when others =>
null;
end case;
when Ada.A_Pragma =>
Pragma_Kind := Pragmas.Kind (Element);
case Pragma_Kind is
when Predefined_Pragmas =>
Counts.Pragmas.Predefined (Pragma_Kind) :=
Counts.Pragmas.Predefined (Pragma_Kind) + 1;
when Implementation_Dependent_Pragmas =>
Counts.Pragmas.Implementation_Dependent (Pragma_Kind) :=
Counts.Pragmas.Implementation_Dependent
(Pragma_Kind) + 1;
when others =>
Counts.Pragmas.Unknown := Counts.Pragmas.Unknown + 1;
end case;
when Ada.A_Representation_Clause =>
Rep_Kind := Rep_Specs.Kind (Element);
Counts.Reps (Rep_Kind) := Counts.Reps (Rep_Kind) + 1;
case Rep_Kind is
when Rep_Specs.A_Length_Clause =>
Counts.Length_Clauses
(Rep_Specs.Attribute_Kind (Element)) :=
Counts.Length_Clauses
(Rep_Specs.Attribute_Kind (Element)) + 1;
when others =>
null;
end case;
when Ada.Not_A_Major_Element =>
Minor_Kind (Element, Counts);
end case;
end Analyze;
procedure Pre_Op (Program_Element : Ada.Element;
State : in out Construct_Counts;
Control : in out Ada.Traversal_Control) is
begin
Analyze (Program_Element, State);
Control := Ada.Continue;
end Pre_Op;
procedure Post_Op (Program_Element : Ada.Element;
State : in out Construct_Counts;
Control : in out Ada.Traversal_Control) is
begin
Control := Ada.Continue;
end Post_Op;
procedure Traverse is new Ada.Depth_First_Traversal
(State_Record => Construct_Counts,
Pre_Operation => Pre_Op,
Post_Operation => Post_Op);
procedure Analyze (Comp_Unit : Ada.Compilation_Unit;
Major_Elements_Only : Boolean := False;
Counts : in out Construct_Counts) is
begin
Traverse (Root_Element => Comp_Unit,
State => Counts,
Major_Elements_Only => Major_Elements_Only);
end Analyze;
end Ada_Constructs;
nblk1=c
nid=0
hdr6=18
[0x00] rec0=1f rec1=00 rec2=01 rec3=01c
[0x01] rec0=1a rec1=00 rec2=02 rec3=016
[0x02] rec0=1b rec1=00 rec2=03 rec3=040
[0x03] rec0=17 rec1=00 rec2=04 rec3=02a
[0x04] rec0=1b rec1=00 rec2=05 rec3=042
[0x05] rec0=00 rec1=00 rec2=0c rec3=016
[0x06] rec0=16 rec1=00 rec2=06 rec3=008
[0x07] rec0=00 rec1=00 rec2=0b rec3=01e
[0x08] rec0=16 rec1=00 rec2=07 rec3=006
[0x09] rec0=15 rec1=00 rec2=08 rec3=058
[0x0a] rec0=19 rec1=00 rec2=09 rec3=040
[0x0b] rec0=1a rec1=00 rec2=0a rec3=000
tail 0x21500321a815c635d6729 0x42a00088462061e03