|
|
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: 5120 (0x1400)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Get_Verb_And_Complements, seg_0468c4
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
with Text_Io;
package body Get_Verb_And_Complements is
function Isalpha (C : in Character) return Boolean is
begin
return ((C in 'a' .. 'z') or (C in 'A' .. 'Z') or (C = '_'));
end Isalpha;
function Word_Count (Source : Variable_String) return Natural is
Debut : Boolean;
Nw : Natural := 0;
begin
Debut := False;
for I in 1 .. Infinite_String.Length (Source) loop
if (Isalpha (Char_At (Source, I))) then
if (Debut = False) then
Debut := True;
Nw := Nw + 1;
else
null;
end if;
else
Debut := False;
end if;
end loop;
return Nw;
end Word_Count;
procedure Get_Word (Source : in Variable_String;
Dest : in out Variable_String;
Index : in out Natural;
Error : in out Boolean) is
First : Natural := 1;
Car : Character;
begin
Error := False;
First := Index;
while ((First <= Infinite_String.Length (Source)) and
(not Isalpha (Char_At (Source, First)))) loop
First := First + 1;
end loop;
while ((First <= Infinite_String.Length (Source)) and
(Isalpha (Char_At (Source, First)))) loop
Infinite_String.Append (Dest, Char_At (Source, First));
First := First + 1;
end loop;
if (First = Infinite_String.Length (Source)) then
Error := True;
end if;
Index := First;
end Get_Word;
procedure Print_Prompt is
Prompt_Character : constant Character := '>';
begin
Text_Io.Put (Prompt_Character);
end Print_Prompt;
procedure Get_Verb_And_Complement
(Dest1, Dest2, Dest3 : in out Variable_String) is
Word_Counter, Long : Natural := 0;
Position : Positive := 1;
Error : Boolean := False;
Source : String (1 .. 50);
Source2 : Variable_String;
begin
Free (Dest1);
Free (Dest2);
Free (Dest3);
loop
Error := false;
Print_Prompt;
Print_Prompt;
-- vider chaine Source !!!!!!!
Text_Io.Get_Line (Source, Long);
Source2 := Infinite_String.Value (Source);
Word_Counter := Word_Count (Source2);
Text_Io.Put_Line (Positive'Image (Word_Counter));
if (Word_Counter > 3) then
Text_Io.Put_Line (" il faut rentrer 3 mots au maximum!!!!");
Text_Io.Put_Line (" Un verbe et au plus deux Complements ");
Word_Counter := 0;
Error := True;
end if;
exit when Error := false; end loop;
Get_Word (Source2, Dest1, Position, Error);
if (not Error) then
Get_Word (Source2, Dest2, Position, Error);
end if;
if (not Error) then
Get_Word (Source2, Dest3, Position, Error);
end if;
end Get_Verb_And_Complement;
end Get_Verb_And_Complements;
nblk1=4
nid=0
hdr6=8
[0x00] rec0=23 rec1=00 rec2=01 rec3=05e
[0x01] rec0=21 rec1=00 rec2=02 rec3=048
[0x02] rec0=1d rec1=00 rec2=04 rec3=002
[0x03] rec0=0e rec1=00 rec2=03 rec3=000
tail 0x215433ce886515cb4a673 0x42a00088462060003