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

⟦685a069d7⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Translator, seg_04961e

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 Lex_Inter, Our_List, Verbs, Variables;

package body Translator is
    Index1 : Natural;
    Command_Tab : Command_Tab_Type;

    procedure Init is

    begin
        Lex_Inter.Init;
        Index1 := Command_Tab'First - 1;
        for I in Command_Tab'Range loop
            Our_String.Free (Command_Tab (I));

        end loop;
    end Init;

    function Get_Command return Integer is

    begin

        Init;
        Lex_Inter.Prompt;
        while not Lex_Inter.Is_At_End loop
            if (Index1 >= Command_Tab'Last) then
                return 2;
            else
                Lex_Inter.Next;
                case Lex_Inter.Get_Token is
                    when Lex_Inter.Identifier =>
                        Index1 := Index1 + 1;
                        Our_String.Free (Command_Tab (Index1));
                        Command_Tab (Index1) :=
                           Our_String.Value (Lex_Inter.Get_Value);

                    when Lex_Inter.Unknown =>
                        return 1;
                    when Lex_Inter.Unuseful =>
                        null;
                    when others =>
                        return 1;
                end case;

            end if;
        end loop;
        return 0;
    end Get_Command;

    function Get_Modified_Command return Integer is
        Tmp_String : Our_String.Variable_String;
    begin


        case Get_Command is
            when 0 =>

                if Our_List.Isinlist (Verbs.Get_List_Of_Verbs,
                                      Our_String.Image (Command_Tab (1))) then
                    Our_String.Copy (Tmp_String,
                                     Verbs.Get_Base_Of_The_Verb
                                        (Our_String.Image (Command_Tab (1))));
                    Our_String.Free (Command_Tab (1));
                    Our_String.Copy (Command_Tab (1), Tmp_String);
                else
                    Text_Io.Put_Line ("Verb not declared : " &
                                      Our_String.Image (Command_Tab (1)));
                    return 1;
                end if;
                for I in (Command_Tab'First) + 1 .. Command_Tab'Last loop
                    Our_String.Copy (Tmp_String, Command_Tab (I));
                    if Our_String.Image (Tmp_String) /= "" then


                        if not Our_List.Isinlist
                                  (Variables.Get_List_Of_Variables,
                                   Our_String.Image (Tmp_String)) then
                            Text_Io.Put_Line ("unknown variable : " &
                                              Our_String.Image (Tmp_String));
                            return 1;
                        end if;
                    end if;  
                end loop;
                Text_Io.Put_Line (" ");
            when 1 =>
                Text_Io.Put_Line ("Unknown word");
                return 1;
            when 2 =>
                Text_Io.Put_Line ("Maximum 3 significative words");
                return 1;
            when others =>
                Text_Io.Put_Line ("Error");
                return 1;

        end case;  
        return 0;

    end Get_Modified_Command;

    function Prompt return Command_Tab_Type is
        C : Command_Tab_Type;
    begin

        if Get_Modified_Command = 0 then
            return Command_Tab;
        else
            for I in C'Range loop
                Our_String.Copy (C (I), "");

            end loop;
            return C;
        end if;


    end Prompt;
end Translator;

E3 Meta Data

    nblk1=6
    nid=4
    hdr6=a
        [0x00] rec0=25 rec1=00 rec2=01 rec3=01a
        [0x01] rec0=1c rec1=00 rec2=03 rec3=028
        [0x02] rec0=01 rec1=00 rec2=06 rec3=046
        [0x03] rec0=16 rec1=00 rec2=02 rec3=010
        [0x04] rec0=1d rec1=00 rec2=05 rec3=000
        [0x05] rec0=43 rec1=18 rec2=3e rec3=70e
    tail 0x21546be5c865e5b248b92 0x42a00088462060003
Free Block Chain:
  0x4: 0000  00 00 00 04 80 01 43 01 20 20 20 20 20 20 20 20  ┆      C         ┆