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

⟦cc6248a53⟧ Ada Source

    Length: 5120 (0x1400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Dictionnary, seg_04732a

Derivation

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

E3 Source Code



with Generic_Binary_Tree, Unbounded_String, Error;


package body Dictionnary is

    package Unlimited_String is new Unbounded_String (10);

    function "<" (C1, C2 : Unlimited_String.Variable_String) return Boolean;
    function Are_Equal
                (C1, C2 : Unlimited_String.Variable_String) return Boolean;  
    procedure Copy (Source : in Unlimited_String.Variable_String;
                    Target : in out Unlimited_String.Variable_String);

    package Word_Tree is new Generic_Binary_Tree
                                (Unlimited_String.Variable_String,
                                 "<", Are_Equal, Copy);

    Verbs_Dictionnary : Word_Tree.Object;
    Complements_Dictionnary : Word_Tree.Object;

    Storage_Kind : Kind_Of_Storage;

    function "<" (C1, C2 : Unlimited_String.Variable_String) return Boolean is
    begin
        return (Unlimited_String.Image (C1) < Unlimited_String.Image (C2));
    end "<";

    function Are_Equal
                (C1, C2 : Unlimited_String.Variable_String) return Boolean is
    begin
        return (Unlimited_String.Image (C1) = Unlimited_String.Image (C2));
    end Are_Equal;

    procedure Copy (Source : in Unlimited_String.Variable_String;
                    Target : in out Unlimited_String.Variable_String) is
    begin
        Unlimited_String.Copy (Target, Source);
    end Copy;

    procedure Set_Kind_Of_Storage (Kind : Kind_Of_Storage) is
    begin
        Storage_Kind := Kind;
    end Set_Kind_Of_Storage;

    procedure Insert (S : String) is
    begin  
        if Is_Verb (S) then
            Error.Set_Type_Error (Error.This_Word_Is_Already_A_Verb);
            raise Error.Excep_Semantic_Error;
        elsif Is_Complement (S) then
            Error.Set_Type_Error (Error.This_Word_Is_Already_A_Complement);
            raise Error.Excep_Semantic_Error;
        end if;  
        case Storage_Kind is
            when Verb =>
                Word_Tree.Insert (Verbs_Dictionnary,
                                  Unlimited_String.Value (S));  
            when Complement =>
                Word_Tree.Insert (Complements_Dictionnary,
                                  Unlimited_String.Value (S));  
        end case;
    end Insert;

    function Is_Verb (S : String) return Boolean is
    begin
        return Word_Tree.Exists (Verbs_Dictionnary, Unlimited_String.Value (S));
    end Is_Verb;

    function Is_Complement (S : String) return Boolean is
    begin  
        return Word_Tree.Exists (Complements_Dictionnary,
                                 Unlimited_String.Value (S));
    end Is_Complement;

end Dictionnary;

E3 Meta Data

    nblk1=4
    nid=2
    hdr6=6
        [0x00] rec0=1d rec1=00 rec2=01 rec3=02c
        [0x01] rec0=1c rec1=00 rec2=03 rec3=016
        [0x02] rec0=14 rec1=00 rec2=04 rec3=000
        [0x03] rec0=03 rec1=6e rec2=d1 rec3=742
    tail 0x21544249686536ebf66d4 0x42a00088462060003
Free Block Chain:
  0x2: 0000  00 00 02 da 80 27 20 20 20 57 6f 72 64 5f 54 72  ┆     '   Word_Tr┆