|
|
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: 3635 (0xe33)
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 Io;
with Directory_Tools;
with Table_Formatter;
with Unit_Stats;
with Line_Utilities;
procedure Count_Lines (In_Units : String := "") is
package Object renames Directory_Tools.Object;
package Naming renames Directory_Tools.Naming;
package Traversal renames Directory_Tools.Traversal;
package Ada_Object renames Directory_Tools.Ada_Object;
package Format is new Table_Formatter (5);
All_Units : Object.Iterator := Naming.Resolution (In_Units);
Unit : Object.Handle;
Stats : Unit_Stats.Statistics;
Total_Lines : Integer := 0;
Total_Comments : Integer := 0;
Total_Blanks : Integer := 0;
Total_Semis : Integer := 0;
function Image (I : Integer) return String is
Imag : constant String := Integer'Image (I);
begin
if I = 0 then
return " 0";
elsif I < 10 then
return "0000" & Imag (Imag'First + 1 .. Imag'Last);
elsif I < 100 then
return "000" & Imag (Imag'First + 1 .. Imag'Last);
elsif I < 1000 then
return "00" & Imag (Imag'First + 1 .. Imag'Last);
elsif I < 10000 then
return "0" & Imag (Imag'First + 1 .. Imag'Last);
else
return Imag (Imag'First + 1 .. Imag'Last);
end if;
end Image;
begin
Format.Header ("Total Lines");
Format.Header ("Comment Lines");
Format.Header ("Blank Line");
Format.Header ("Semicolons");
Format.Header ("Unit Name");
while not Object.Done (All_Units) loop
Unit := Object.Value (All_Units);
Stats := Unit_Stats.Evaluate (Naming.Unique_Full_Name (Unit));
Total_Lines := Total_Lines + Unit_Stats.Total_Lines (Stats);
Total_Comments :=
Total_Comments + Unit_Stats.Count
(Line_Utilities.Comment_Line, Stats);
Total_Blanks := Total_Blanks + Unit_Stats.Count
(Line_Utilities.Blank_Line, Stats);
Total_Semis := Total_Semis + Unit_Stats.Count
(Line_Utilities.Contains_Semi, Stats);
Format.Item (Image (Unit_Stats.Total_Lines (Stats)));
Format.Item (Image (Unit_Stats.Count
(Line_Utilities.Comment_Line, Stats)));
Format.Item (Image (Unit_Stats.Count
(Line_Utilities.Blank_Line, Stats)));
Format.Item (Image (Unit_Stats.Count
(Line_Utilities.Contains_Semi, Stats)));
if Ada_Object.Is_Visible_Part (Unit) then
Format.Item (Naming.Simple_Name (Unit) & "'SPEC");
elsif Ada_Object.Is_Subunit (Unit) then
Format.Item (Naming.Simple_Name (Unit));
else
Format.Item (Naming.Simple_Name (Unit) & "'BODY");
end if;
Object.Next (All_Units);
end loop;
Io.Put_Line (Io.Current_Output, " Sorted by Unit Name");
Io.New_Line (Io.Current_Output);
Format.Sort (5);
Format.Display (Io.Current_Output);
Io.New_Line (Io.Current_Output, 3);
Format.Sort (1);
Format.Item ("-----");
Format.Item ("-----");
Format.Item ("-----");
Format.Item ("-----");
Format.Item (" ");
Format.Item (Image (Total_Lines));
Format.Item (Image (Total_Comments));
Format.Item (Image (Total_Blanks));
Format.Item (Image (Total_Semis));
Format.Item ("TOTALS");
Io.Put_Line (Io.Current_Output,
" Sorted by Total Line Count");
Io.New_Line (Io.Current_Output);
Format.Display (Io.Current_Output);
end Count_Lines;