Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,6 +0,0 @@
|
|||
package Synchronous_Concurrent is
|
||||
task Printer is
|
||||
entry Put(Item : in String);
|
||||
entry Get_Count(Count : out Natural);
|
||||
end Printer;
|
||||
end Synchronous_Concurrent;
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
with Ada.Text_Io; use Ada.Text_Io;
|
||||
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
|
||||
|
||||
package body Synchronous_Concurrent is
|
||||
|
||||
task body Printer is
|
||||
Num_Iter : Natural := 0;
|
||||
Line : Unbounded_String;
|
||||
begin
|
||||
loop
|
||||
select
|
||||
accept Put(Item : in String) do
|
||||
Line := To_Unbounded_String(Item);
|
||||
end Put;
|
||||
Put_Line(To_String(Line));
|
||||
Num_Iter := Num_Iter + 1;
|
||||
or
|
||||
accept Get_Count(Count : out Natural) do
|
||||
Count := Num_Iter;
|
||||
end Get_Count;
|
||||
or terminate;
|
||||
end select;
|
||||
end loop;
|
||||
end Printer;
|
||||
|
||||
end Synchronous_Concurrent;
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
with Synchronous_Concurrent; use Synchronous_Concurrent;
|
||||
with Ada.Text_Io; use Ada.Text_Io;
|
||||
|
||||
procedure Synchronous_Concurrent_Main is
|
||||
Num_Strings : Natural;
|
||||
The_File : File_Type;
|
||||
Line : String(1..255);
|
||||
Length : Natural;
|
||||
begin
|
||||
Open(File => The_File, Mode => In_File, Name => "input.txt");
|
||||
while not End_Of_File(The_File) loop
|
||||
Get_Line(File => The_File, Item => Line, Last => Length);
|
||||
Printer.Put(Line(1..Length));
|
||||
end loop;
|
||||
Close(The_File);
|
||||
Printer.Get_Count(Num_Strings);
|
||||
New_Line;
|
||||
Put_Line("The task wrote" & Natural'Image(Num_Strings) & " strings.");
|
||||
end Synchronous_Concurrent_Main;
|
||||
Loading…
Add table
Add a link
Reference in a new issue