DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦b8bd8164e⟧ Ada Source

    Length: 10240 (0x2800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Test_Synonym_Sort_Array, seg_0403d7

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Text_Io, Synonym, Generic_String_Sort_Array;  
use Text_Io;
procedure Test_Synonym_Sort_Array is

    package Synonym_Array is new Generic_String_Sort_Array
                                    (Element => Synonym.Object,
                                     Max_Element_Number => 200,
                                     Get_Key => Synonym.Name);

    V1, V2, V3, V4, V5, V6, V7, V8 : Synonym.Object;

    Found : Boolean;

    An_Array : Synonym_Array.Object;
    An_Iterator : Synonym_Array.Iterator;
    Index : Synonym_Array.Element_Index;

begin

    Synonym.Initialize (V1, "marcher", 1);
    Synonym.Initialize (V2, "aller", 1);
    Synonym.Initialize (V3, "poser", 2);
    Synonym.Initialize (V4, "jeter", 2);
    Synonym.Initialize (V5, "lancer", 2);
    Synonym.Initialize (V6, "courir", 1);
    Synonym.Initialize (V7, "sauter", 1);
    Synonym.Initialize (V8, "deposer", 2);
    -- Put_Line ("s : " & synonym.name (V1) & " v : " & positive'image(synonym.number (V1)));
    -- Put_Line ("s : " & synonym.name (V2) & " v : " & positive'image(synonym.number (V2)));
    -- Put_Line ("s : " & synonym.name (V3) & " v : " & positive'image(synonym.number (V3)));
    -- Put_Line ("s : " & synonym.name (V4) & " v : " & positive'image(synonym.number (V4)));
    -- Put_Line ("s : " & synonym.name (V5) & " v : " & positive'image(synonym.number (V5)));
    -- Put_Line ("s : " & synonym.name (V6) & " v : " & positive'image(synonym.number (V6)));
    -- Put_Line ("s : " & synonym.name (V7) & " v : " & positive'image(synonym.number (V7)));
    -- Put_Line ("s : " & synonym.name (V8) & " v : " & positive'image(synonym.number (V8)));

    Put_Line ("-- Is_Empty --");

    if Synonym_Array.Is_Empty (An_Array) then
        Put_Line ("Le tableau est vide");
    end if;

    Put_Line ("-- Iterateur sur tableau vide --");

    Synonym_Array.Create (An_Array, An_Iterator);
    while not Synonym_Array.Is_At_End (An_Iterator) loop
        V1 := Synonym_Array.Value (An_Iterator);
        Put_Line ("s : " & Synonym.Name (V1) & " v : " &
                  Positive'Image (Synonym.Number (V1)));
        Synonym_Array.Next (An_Iterator);
    end loop;


    Put_Line ("-- Synonym_Array.Put avec found --");

    Synonym_Array.Put (An_Array, V1, Found);
    if Found then
        Put_Line ("L'element est deja insere !");
    end if;

    Synonym_Array.Put (An_Array, V1, Found);
    if Found then
        Put_Line ("L'element est deja insere !");
    end if;

    Synonym_Array.Put (An_Array, V2, Found);
    Synonym_Array.Put (An_Array, V3, Found);
    Synonym_Array.Put (An_Array, V4, Found);
    Synonym_Array.Put (An_Array, V5, Found);
    Synonym_Array.Put (An_Array, V6, Found);
    Synonym_Array.Put (An_Array, V7, Found);
    Synonym_Array.Put (An_Array, V8, Found);
    Synonym_Array.Create (An_Array, An_Iterator);

    Put_Line ("-- Iterateur sur tableau plein --");

    Synonym_Array.Create (An_Array, An_Iterator);   while not Synonym_Array.Is_At_End (An_Iterator) loop
        V1 := Synonym_Array.Value (An_Iterator);
        Put_Line ("s : " & Synonym.Name (V1) & " v : " &
                  Positive'Image (Synonym.Number (V1)));
        Synonym_Array.Next (An_Iterator);
    end loop;

    Put_Line ("-- Avant Synonym.New_number --");
    Put_Line ("s : " & Synonym.Name (V1) & " v : " &
              Positive'Image (Synonym.Number (V1)));

    Put_Line ("-- Apres Synonym.New_number --");
    Synonym.New_Number (V1, 2);
    Put_Line ("s : " & Synonym.Name (V1) & " v : " &
              Positive'Image (Synonym.Number (V1)));

    Put_Line ("-- Put sans found --");

    Synonym_Array.Put (An_Array, V1);

    Synonym_Array.Create (An_Array, An_Iterator);
    while not Synonym_Array.Is_At_End (An_Iterator) loop
        V1 := Synonym_Array.Value (An_Iterator);
        Put_Line ("s : " & Synonym.Name (V1) & " v : " &
                  Positive'Image (Synonym.Number (V1)));
        Synonym_Array.Next (An_Iterator);
    end loop;

--  PENSER A FAIRE UN LOWER CASE AVANT LEX.GET_VALUE

    Put_Line ("-- Get avec string --");

    Synonym_Array.Get (An_Array, V1, "lancer", Found);
    if Found then
        Put_Line ("s : " & Synonym.Name (V1) & " v : " &
                  Positive'Image (Synonym.Number (V1)));
    else
        Put_Line ("Element pas trouve !");
    end if;

    Synonym_Array.Get (An_Array, V1, "lance", Found);
    if Found then
        Put_Line ("s : " & Synonym.Name (V1) & " v : " &
                  Positive'Image (Synonym.Number (V1)));
    else
        Put_Line ("Element pas trouve !");
    end if;

    Synonym_Array.Get (An_Array, V1, "courir", Found);
    if Found then
        Put_Line ("s : " & Synonym.Name (V1) & " v : " &
                  Positive'Image (Synonym.Number (V1)));
    else
        Put_Line ("Element pas trouve !");
    end if;

    Synonym_Array.Get (An_Array, V1, "sauter", Found);
    if Found then
        Put_Line ("s : " & Synonym.Name (V1) & " v : " &
                  Positive'Image (Synonym.Number (V1)));
    else
        Put_Line ("Element pas trouve !");
    end if;

    Put_Line ("-- Get avec Element_Index --");

    Synonym_Array.Get (An_Array, V1, 1, Found);
    if Found then
        Put_Line ("s : " & Synonym.Name (V1) & " v : " &
                  Positive'Image (Synonym.Number (V1)));
    else
        Put_Line ("Element pas trouve !");
    end if;

    Synonym_Array.Get (An_Array, V1, 9, Found);
    if Found then
        Put_Line ("s : " & Synonym.Name (V1) & " v : " &
                  Positive'Image (Synonym.Number (V1)));
    else
        Put_Line ("Element pas trouve !");
    end if;

    Synonym_Array.Get (An_Array, V1, 8, Found);
    if Found then
        Put_Line ("s : " & Synonym.Name (V1) & " v : " &
                  Positive'Image (Synonym.Number (V1)));
    else
        Put_Line ("Element pas trouve !");
    end if;

    Put_Line ("-- Index --");

    Index := Synonym_Array.Index (An_Array, "pose");
    if Index /= 0 then
        Synonym_Array.Get (An_Array, V1, Index, Found);
        Put_Line ("s : " & Synonym.Name (V1) & " v : " &
                  Positive'Image (Synonym.Number (V1)));
    else
        Put_Line ("Pose pas trouve");
    end if;

    Index := Synonym_Array.Index (An_Array, "poser");
    if Index /= 0 then
        Synonym_Array.Get (An_Array, V1, Index, Found);
        Put_Line ("s : " & Synonym.Name (V1) & " v : " &
                  Positive'Image (Synonym.Number (V1)));
    else
        Put_Line ("Poser pas trouve !");
    end if;

end Test_Synonym_Sort_Array;



E3 Meta Data

    nblk1=9
    nid=0
    hdr6=12
        [0x00] rec0=1d rec1=00 rec2=01 rec3=086
        [0x01] rec0=12 rec1=00 rec2=04 rec3=070
        [0x02] rec0=1f rec1=00 rec2=09 rec3=016
        [0x03] rec0=01 rec1=00 rec2=07 rec3=002
        [0x04] rec0=18 rec1=00 rec2=06 rec3=070
        [0x05] rec0=20 rec1=00 rec2=05 rec3=060
        [0x06] rec0=02 rec1=00 rec2=02 rec3=01e
        [0x07] rec0=20 rec1=00 rec2=03 rec3=00c
        [0x08] rec0=18 rec1=00 rec2=08 rec3=000
    tail 0x217405e10860e471d025c 0x42a00088462060003