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

⟦5e20bb1cb⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Definitions, seg_043339, seg_043684

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 Lexical, Token_List, Erreur, Definitions_Simples, Noms_Enumeres;
with Models, Symbols, Fields, Bounded_String;

use Lexical, Token_List, Bounded_String;

package body Definitions is

    Definition_First : Token_List.Object := Make ((Structure, Enumere));

    procedure Definition (Tdm : in out Models.Object;
                          Tds : in out Symbols.Object) is

        A_Models_Name : Variable_String (Models.Max_Model_String);
        A_Models_Type : Variable_String (Models.Max_Model_String);
        A_Models_Fields : Fields.Object;

    begin
        Free (A_Models_Name);
        Free (A_Models_Type);

        case Lexical.Get_Token is

            when Structure =>
                Bounded_String.Copy (A_Models_Type, Lexical.Get_Value);
                Lexical.Next;
                if Lexical.Get_Token = Id then
                    if not Models.Has_Model (Tdm, Lexical.Get_Value) then
                        Bounded_String.Copy (A_Models_Name, Lexical.Get_Value);
                        Lexical.Next;
                        if Lexical.Get_Token = Parnto then
                            Lexical.Next;
                            Fields.Create (A_Models_Fields);
                            Definitions_Simples.Parse (Tdm, A_Models_Fields);
                            if Lexical.Get_Token = Parntf then
                                Models.Store_Model
                                   (Tdm, Image (A_Models_Name),
                                    Image (A_Models_Type), A_Models_Fields);
                                Fields.Dispose_Object (A_Models_Fields);
                                Lexical.Next;
                            else
                                Erreur.Syntaxe ("Manque )");
                            end if;
                        else
                            Erreur.Syntaxe ("Manque (");
                        end if;
                    else
                        Erreur.Modele ("Redefinition de type STRUCTURE");
                    end if;
                else
                    Erreur.Syntaxe ("Manque Nom de structure");
                end if;

            when Enumere =>
                Bounded_String.Copy (A_Models_Type, Lexical.Get_Value);
                Lexical.Next;
                if Lexical.Get_Token = Id then
                    if not Models.Has_Model (Tdm, Lexical.Get_Value) then
                        Bounded_String.Copy (A_Models_Name, Lexical.Get_Value);
                        Lexical.Next;
                        if Lexical.Get_Token = Parnto then
                            Lexical.Next;
                            Fields.Create (A_Models_Fields);

                            Noms_Enumeres.Parse
                               (Tds, Image (A_Models_Name), A_Models_Fields);
                            if Lexical.Get_Token = Parntf then
                                Models.Store_Model
                                   (Tdm, Image (A_Models_Name),
                                    Image (A_Models_Type), A_Models_Fields);
                                Fields.Dispose_Object (A_Models_Fields);
                                Lexical.Next;
                            else
                                Erreur.Syntaxe ("Manque )");
                            end if;
                        else
                            Erreur.Syntaxe ("Manque (");
                        end if;
                    else
                        Erreur.Modele ("Redefinition de type ENUMERE");
                    end if;
                else
                    Erreur.Syntaxe ("Manque Nom de enumere");
                end if;

            when others =>
                Erreur.Syntaxe ("Manque Enumere/Structure");

        end case;

    end Definition;

    procedure Parse (Tdm : in out Models.Object; Tds : in out Symbols.Object) is
    begin

        Definition (Tdm, Tds);
        while Is_In (Lexical.Get_Token, Definition_First) loop
            Definition (Tdm, Tds);
        end loop;

    end Parse;

end Definitions;


E3 Meta Data

    nblk1=5
    nid=0
    hdr6=a
        [0x00] rec0=1d rec1=00 rec2=01 rec3=064
        [0x01] rec0=13 rec1=00 rec2=02 rec3=030
        [0x02] rec0=15 rec1=00 rec2=03 rec3=01e
        [0x03] rec0=1b rec1=00 rec2=04 rec3=020
        [0x04] rec0=09 rec1=00 rec2=05 rec3=001
    tail 0x217440a1c86356cd098fa 0x42a00088462060003