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

⟦c0622dab0⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Player_Dictionary, seg_048dc5

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 Structure_Des_Variables, Text_Io;
use Structure_Des_Variables;  -- necessaire pour reconnaitre "sans_type"

package body Player_Dictionary is

    -- Enumeres utilises pour la verification de la syntaxe de l'instruction.
    type Command_Typ is (Verbe, Complement, Preposition, No_More,
                         Preposition_Or_Complement, Without_Type);


-- Fonction permettant de verifier si deux type sont egaux.
    function Equal (A, B : Interface_Structure.Type_Of_Var) return Boolean
        renames Structure_Des_Variables.Equal;

------------------------------------------------------------------------------

    function Player_Sens (A_Word_Of_The_Command : Mots.Word; Pos : Natural)
                         return Boolean is

    begin
        if Pos = 2 then
            return True;
        else
            return not Equal (Interface_Structure.Get_Type
                                 (A_Word_Of_The_Command),
                              Interface_Structure.Type_Of_Var (Sans_Type));
        end if;
    exception
        when others =>
            Text_Io.Put_Line ("erreur player_sens);");
    end Player_Sens;

------------------------------------------------------------------------------
    function Player_Syntax (Player_Table_Of_Word : in Mots.T_Tab_Commande;
                            Number : Natural) return Boolean is

        Next_Command : Command_Typ := Without_Type;
        Ok : Boolean := False;

        function Equal (A, B : Command_Typ) return Boolean is
        begin
            return (A = B);
        end Equal;

    begin
        for Row_Syntax in 1 .. Number loop
            Ok := False;
            case Interface_Structure.Get_Type
                    (Player_Table_Of_Word (Row_Syntax)) is
                when Verbe =>  
                    if ((Row_Syntax = 1) and then
                        Equal (Next_Command, Without_Type)) then
                        Ok := True;
                        Next_Command := Complement;
                    else
                        Ok := False;
                        exit;
                    end if;  
                when Preposition =>  
                    if ((Row_Syntax = 3) and then
                        Equal (Next_Command, Preposition_Or_Complement)) then
                        Ok := True;
                        Next_Command := Complement;
                    else
                        Ok := False;
                        exit;
                    end if;
                when Communication | Compteur | Lieu | Objet | Personnage =>
                    if ((Row_Syntax = 2) and then
                        Equal (Next_Command, Complement)) then
                        Ok := True;  
                        Next_Command := Preposition_Or_Complement;
                    elsif ((Row_Syntax = 3) and then
                           Equal (Next_Command, Preposition_Or_Complement)) then
                        Ok := True;
                        if Equal (Interface_Structure.Get_Type
                                     (Player_Table_Of_Word (Row_Syntax)),
                                  Preposition) then
                            Next_Command := Complement;
                        else
                            Next_Command := No_More;
                        end if;
                    elsif ((Row_Syntax = 4) and then
                           Equal (Next_Command, Complement)) then
                        Ok := True;
                        Next_Command := No_More;
                    else
                        Ok := False;
                        exit;
                    end if;
                when others =>
                    if ((Row_Syntax = 2) and then
                        Equal (Next_Command, Complement)) then
                        Ok := True;
                        Next_Command := No_More;
                    else
                        Ok := False;
                        exit;
                    end if;
            end case;
        end loop;
        return Ok;
    end Player_Syntax;

------------------------------------------------------------------------------

end Player_Dictionary;

E3 Meta Data

    nblk1=7
    nid=3
    hdr6=a
        [0x00] rec0=1b rec1=00 rec2=01 rec3=03e
        [0x01] rec0=1b rec1=00 rec2=06 rec3=004
        [0x02] rec0=15 rec1=00 rec2=07 rec3=05a
        [0x03] rec0=15 rec1=00 rec2=02 rec3=050
        [0x04] rec0=0d rec1=00 rec2=04 rec3=000
        [0x05] rec0=0d rec1=00 rec2=04 rec3=000
        [0x06] rec0=eb rec1=b0 rec2=00 rec3=026
    tail 0x215461b2e865a877ae548 0x42a00088462060003
Free Block Chain:
  0x3: 0000  00 05 00 3c 80 34 20 20 20 20 20 20 20 20 20 20  ┆   < 4          ┆
  0x5: 0000  00 00 00 f6 80 18 20 7c 20 4f 62 6a 65 74 20 7c  ┆       | Objet |┆