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

⟦8be94c167⟧ Ada Source

    Length: 4096 (0x1000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Verbs_Dictionary, seg_040f78

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 Binary_Trees_Pkg, Bounded_String, Text_Io;
use Bounded_String;

package body Verbs_Dictionary is

    Lower : constant Integer := -1;
    Equal : constant Integer := 0;
    Upper : constant Integer := 1;

    Current_Verb : Verb;

-- ----------------------------------------------------
-- Definition des fonctions pour le paquetage generique
-- ----------------------------------------------------

    function Compare (A, B : Verb) return Integer is
    begin
        if Image (A.Name) < Image (B.Name) then
            return Lower;
        else
            if Image (A.Name) = Image (B.Name) then
                return Equal;
            else
                return Upper;
            end if;
        end if;
    end Compare;


    procedure Write (Scr : Verb) is
    begin
        Text_Io.Put_Line ("Name -> " & Image (Scr.Name) &
                          " / Source ->" & Image (Scr.Source));
    end Write;


    procedure Show is new Verbs_Tree.Visit (Write);


-- -------------------------------------------
-- Definition des fontions de Verbs_Dictionary
-- -------------------------------------------


    function Affect_Verb (Name, Source : String) return Verb is
        Tmp_Verb : Verb;
    begin
        Bounded_String.Free (Tmp_Verb.Name);
        Bounded_String.Free (Tmp_Verb.Source);
        Bounded_String.Copy (Tmp_Verb.Name, Name);
        Bounded_String.Copy (Tmp_Verb.Source, Source);
        return Tmp_Verb;
    end Affect_Verb;


    procedure Create (Dict : in out Object) is
    begin
        Dict.Root := Verbs_Tree.Create;
    end Create;


    procedure Destroy (Dict : in out Object) is
    begin
        Verbs_Tree.Destroy (Dict.Root);
    end Destroy;


    procedure Add_New (New_Verb : String; Dict : Object) is
    begin
        Current_Verb := Affect_Verb (New_Verb, New_Verb);
        Verbs_Tree.Insert (Affect_Verb (New_Verb, New_Verb), Dict.Root);

    exception
        when Verbs_Tree.Duplicate_Value =>
            raise Duplicate_Value;
    end Add_New;


    procedure Add_Synonym (New_Syn : String; Dict : Object) is
    begin
        Verbs_Tree.Insert
           (Affect_Verb (New_Syn, Image (Current_Verb.Source)), Dict.Root);

    exception
        when Verbs_Tree.Duplicate_Value =>
            raise Duplicate_Value;
    end Add_Synonym;


    function Exist (Scan_Verb : String; Dict : Object) return Boolean is
    begin
        return Verbs_Tree.Is_Found
                  (Affect_Verb (Scan_Verb, Scan_Verb), Dict.Root);
    end Exist;


    procedure Dump (Dict : Object) is
    begin
        Show (Dict.Root, Verbs_Tree.Inorder);
    end Dump;


end Verbs_Dictionary;

E3 Meta Data

    nblk1=3
    nid=0
    hdr6=6
        [0x00] rec0=26 rec1=00 rec2=01 rec3=024
        [0x01] rec0=22 rec1=00 rec2=02 rec3=082
        [0x02] rec0=21 rec1=00 rec2=03 rec3=001
    tail 0x21741318886126e1c4295 0x42a00088462060003