text stringlengths 0 234 |
|---|
ATI.Put("Word? "); |
Word := ASU.To_Unbounded_String(ATI.Get_Line); |
WL.Delete_Word (List, Word); |
ATI.New_Line; |
ATI.Put("|" & ASU.To_String(Word) & "| " |
& "deleted"); |
ATI.New_Line; |
-- Busca una palabra en la lista |
when 3 => |
ATI.Put("Word? "); |
Word := ASU.To_Unbounded_String(ATI.Get_Line); |
WL.Search_Word(List, Word, Count); |
ATI.New_Line; |
ATI.Put("|" & ASU.To_String(Word) & "| - " ); |
ATI.Put_Line(Integer'Image(Count)); |
-- Imprime la lista |
when 4 => |
WL.Print_All(List); |
-- Imprime la palabra que más aparece y sale del bucle |
when 5 => |
WL.Max_Word(List, Word, Count); |
ATI.Put("The most frequent word: "); |
ATI.Put("|" & ASU.To_String(Word) & "| -" ); |
ATI.Put_Line(Integer'Image(Count)); |
ATI.New_Line; |
ATI.New_Line; |
when others => |
ATI.Put_Line("Not implemented"); |
end case; |
exception |
when Constraint_Error => |
ATI.Put_Line("Incorrect Option"); |
Function Definition: procedure Close is |
Function Body: begin |
GNAT.Sockets.Close_Socket(Sender_Socket); |
end Close; |
procedure Send_Vram(Vram : in Emulator_8080.Processor.Vram_Type) is |
use Ada.Streams; |
Data : Ada.Streams.Stream_Element_Array(1 .. Vram'Length); |
Counter : Ada.Streams.Stream_Element_Offset := Data'First; |
Last : Ada.Streams.Stream_Element_Offset; |
begin |
for I in Vram'Range loop |
Data(Counter) := Ada.Streams.Stream_Element(Vram(I)); |
Counter := Counter + 1; |
end loop; |
Gnat.Sockets.Send_Socket (Sender_Socket, Data, Last, Address); |
Function Definition: procedure Finish (Data : in out Snapshot_Type) is |
Function Body: begin |
Data.Offset := Data.Offset + Data.Count; |
end Finish; |
-- ------------------------------ |
-- Set the value in the snapshot. |
-- ------------------------------ |
procedure Set_Value (Into : in out Snapshot_Type; |
Def : in Schemas.Definition_Type_Access; |
Value : in Uint64) is |
begin |
if Def /= null and then Def.Index > 0 then |
Into.Values (Def.Index + Into.Offset) := Value; |
end if; |
end Set_Value; |
-- ------------------------------ |
-- Iterate over the values in the snapshot and collected for the definition node. |
-- ------------------------------ |
procedure Iterate (Data : in Helios.Datas.Snapshot_Type; |
Node : in Helios.Schemas.Definition_Type_Access; |
Process : not null access procedure (Value : in Uint64)) is |
Count : constant Helios.Datas.Value_Array_Index := Data.Count; |
Pos : Helios.Datas.Value_Array_Index := Node.Index; |
begin |
Log.Debug ("Iterate {0} from {1} to {2} step {3}", Node.Name, |
Value_Array_Index'Image (Count), |
Value_Array_Index'Image (Pos)); |
while Pos < Data.Offset loop |
Process (Data.Values (Pos)); |
Pos := Pos + Count; |
end loop; |
end Iterate; |
-- ------------------------------ |
-- Iterate over the values in the snapshot and collected for the definition node. |
-- ------------------------------ |
procedure Iterate (Data : in Helios.Datas.Snapshot_Type; |
Node : in Helios.Schemas.Definition_Type_Access; |
Process_Snapshot : not null access |
procedure (D : in Snapshot_Type; |
N : in Definition_Type_Access); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.