text stringlengths 0 234 |
|---|
use type AdaM.Identifier; |
begin |
return L.the_Exception.Name < R.the_Exception.Name; |
end "<"; |
overriding function "=" (L, R : in exception_Usage) return Boolean |
is |
use type AdaM.Identifier; |
begin |
return L.the_Exception.Name = R.the_Exception.Name; |
end "="; |
package exception_Usage_Sets is new ada.Containers.Ordered_Sets (exception_Usage); |
the_usage_Stats : exception_Usage_Sets.Set; |
-- procedure register_Usage (the_Exception : in adam.Text) |
-- is |
-- use exception_Usage_Sets; |
-- |
-- the_exception_Usage : exception_Usage := (the_Exception, others => <>); |
-- Current : constant exception_Usage_Sets.Cursor := the_usage_Stats.find (the_exception_Usage); |
-- begin |
-- if Current /= No_Element |
-- then |
-- the_exception_Usage.Count := Element (Current).Count + 1; |
-- the_usage_Stats.replace_Element (Current, the_exception_Usage); |
-- else |
-- the_exception_Usage.Count := 1; |
-- the_usage_Stats.insert (the_exception_Usage); |
-- end if; |
-- end register_Usage; |
procedure register_Usage (the_Exception : in AdaM.Declaration.of_exception.view) |
is |
use exception_Usage_Sets; |
use type AdaM.Declaration.of_exception.view; |
the_exception_Usage : exception_Usage := (the_Exception, others => <>); |
Current : constant exception_Usage_Sets.Cursor := the_usage_Stats.find (the_exception_Usage); |
begin |
if the_Exception = null |
then |
raise program_Error with "NULLLLLLLL exception !!!"; |
else |
put_Line ("ALL FINEEEEEEEEEEEEEEEEEEEEEE"); |
end if; |
if Current /= No_Element |
then |
the_exception_Usage.Count := Element (Current).Count + 1; |
the_usage_Stats.replace_Element (Current, the_exception_Usage); |
else |
the_exception_Usage.Count := 1; |
the_usage_Stats.insert (the_exception_Usage); |
end if; |
end register_Usage; |
function fetch return AdaM.Declaration.of_exception.vector |
is |
use exception_Usage_Sets, |
ada.Containers; |
-- the_Lines : AdaM.text_Lines; |
the_Exceptions : AdaM.Declaration.of_exception.vector; |
package type_Usage_Vectors is new ada.Containers.Vectors (Positive, exception_Usage); |
use type_Usage_Vectors; |
the_usage_List : type_Usage_Vectors.Vector; |
begin |
declare |
Cursor : exception_Usage_Sets.Cursor := the_usage_Stats.First; |
begin |
while has_Element (Cursor) |
loop |
if Element (Cursor).Count > 0 then |
the_usage_List.append (Element (Cursor)); |
end if; |
exit when the_Exceptions.Length = 25; -- Limit results to 25 entries. |
next (Cursor); |
end loop; |
Function Definition: procedure choice_is (Self : in out Item; --Now : in String; |
Function Body: -- package_Name : in String; |
the_Exception : in AdaM.Declaration.of_exception.view) |
is |
use AdaM, |
AdaM.Assist; |
-- full_Name : constant String := package_Name & "." & Now; |
full_Name : constant String := String (the_Exception.full_Name); |
begin |
-- recent_Exceptions.register_Usage (+full_Name); |
recent_Exceptions.register_Usage (the_Exception); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.