|
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 - download
Length: 13312 (0x3400) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Verb_table, seg_041255
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
with Verb, Text_Io; use Text_Io; package body Verb_table is type Object_table is table (Index_Type range <>) of Verb.Object; type table_Type (Length : Index_Type := 0) is record Inner : Object_table (1 .. Length); end record; table : table_Type; Iterator_Index : Index_Type; function Is_Empty return Boolean is begin return table.Length = 0; end Is_Empty; procedure Put (Item : in Verb.Object; Found : out Boolean) is Index : Index_Type := 1; Temporary_table : Object_table (1 .. table.Inner'Last + 1); begin if Is_Empty then Found := False; table := (1, Inner => (others => Item)); else while Index in table.Inner'Range and then Verb.Synonyme (table.Inner (Index)) < Verb.Synonyme (Item) loop Index := Index + 1; end loop; Put_Line ("put 1 index : " & Index_Type'Image (Index) & " inner'last : " & Index_Type'Image (table.Inner'Last) & " length : " & Index_Type'Image (table.Length)); if Index not in table.Inner'Range then Put_Line ("put 2"); Found := False; Temporary_table := table.Inner & Item; table := (table.Length + 1, Temporary_table); elsif Verb.Synonyme (table.Inner (Index)) /= Verb.Synonyme (Item) then Put_Line ("put 3"); Found := False; Temporary_table := table.Inner (1 .. Index - 1) & Item & table.Inner (Index .. table.Inner'Last); table := (table.Length + 1, Temporary_table); else Put_Line ("put 4"); Found := True; end if; end if; end Put; procedure Get2 (Key : String; Item : in out Verb.Object; Found : out Boolean) is Index : Index_Type := 1; begin if Is_Empty then Found := False; else while Index in table.Inner'Range and then Verb.Synonyme (table.Inner (Index)) /= Key loop Index := Index + 1; end loop; if Index not in table.Inner'Range then Found := False; else Found := True; Item := table.Inner (Index); end if; end if; end Get2; procedure Get (Key : String; Item : in out Verb.Object; Found : out Boolean) is Low, Mid, High : Index_Type; Item_Found : Boolean := False; begin if Is_Empty then Found := False; else Low := 1; High := table.Inner'Last; while Low <= High and not Item_Found loop Mid := (Low + High) / 2; if Verb.Synonyme (table.Inner (Mid)) < Key then Low := Mid + 1; elsif Verb.Synonyme (table.Inner (Mid)) > Key then High := Mid - 1; else Item_Found := True; end if; end loop; if Item_Found then Found := True; Item := table.Inner (Mid); else Found := False; end if; end if; end Get; procedure Get (Key : Index_Type; Item : in out Verb.Object; Found : out Boolean) is begin if Key not in table.Inner'Range then Found := False; else Found := True; Item := table.Inner (Key); end if; end Get; procedure Show is begin if Is_Empty then Put_Line ("table is empty !"); else for Index in table.Inner'Range loop Put_Line ("item nunber : " & Index_Type'Image (Index) & " s : " & Verb.Synonyme (table.Inner (Index)) & " v : " & Verb.Verbe (table.Inner (Index))); end loop; end if; end Show; procedure Create_Iterator is begin Iterator_Index := 1; end Create_Iterator; function Iterator_Is_At_End return Boolean is begin if Is_Empty then return True; else return Iterator_Index = table.Length + 1; end if; end Iterator_Is_At_End; function Item_Value return Verb.Object is begin return table.Inner (Iterator_Index); end Item_Value; procedure Next_Item is begin Iterator_Index := Iterator_Index + 1; end Next_Item; end Verb_table;
nblk1=c nid=c hdr6=c [0x00] rec0=24 rec1=00 rec2=01 rec3=02a [0x01] rec0=16 rec1=00 rec2=03 rec3=000 [0x02] rec0=24 rec1=00 rec2=04 rec3=002 [0x03] rec0=1e rec1=00 rec2=0a rec3=01e [0x04] rec0=2a rec1=00 rec2=02 rec3=00c [0x05] rec0=05 rec1=00 rec2=0b rec3=000 [0x06] rec0=08 rec1=00 rec2=02 rec3=001 [0x07] rec0=68 rec1=60 rec2=a3 rec3=60a [0x08] rec0=8b rec1=74 rec2=00 rec3=006 [0x09] rec0=2d rec1=0c rec2=14 rec3=3c1 [0x0a] rec0=50 rec1=e7 rec2=b0 rec3=000 [0x0b] rec0=c5 rec1=80 rec2=00 rec3=000 tail 0x217416ce4861352c98031 0x42a00088462060003 Free Block Chain: 0xc: 0000 00 09 03 f9 80 23 20 20 20 20 20 20 20 20 20 20 ┆ # ┆ 0x9: 0000 00 08 03 fc 80 39 72 69 6e 67 3b 69 6e 20 69 74 ┆ 9ring;in it┆ 0x8: 0000 00 07 03 fc 80 13 6f 6c 6c 65 63 74 69 6f 6e 2e ┆ ollection.┆ 0x7: 0000 00 06 03 fc 80 3c 20 20 20 20 20 20 20 20 20 20 ┆ < ┆ 0x6: 0000 00 05 03 fc 80 17 75 6e 64 20 3a 20 62 6f 6f 6c ┆ und : bool┆ 0x5: 0000 00 00 03 fc 80 17 20 20 20 20 20 20 20 66 6f 75 ┆ fou┆