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

⟦55190cdf6⟧ Ada Source

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

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 Text_Io;
with Lex;
with Object;
with Error_Broadcaster;
with Statements;
with Arguments;
with Bloc_Class;  
with String_Utilities;
with Bounded_String;
package body Bloc is

    type Node_Structure is
        record
            Rule : Natural range 0 .. 1 := 0;
            Arg : Arguments.Node := Arguments.Empty_Node;
            State : Statements.Node := Statements.Empty_Node;
        end record;

    procedure Open (N : in out Node) is
    begin  
        Bloc_Class.Set (N);
    end Open;
    procedure Parse (N : in out Node; Error : out Boolean) is
        Failed : Boolean := False;

    begin
        N := new Node_Structure;
        if Lex.Token'Pos (Lex.Get_Token) = Lex.Token'Pos (Lex.Open_Bracket) then
            Open (N);
            N.Rule := 1;  
            Lex.Next_Token;
            Arguments.Parse (N.Arg, Failed);
            if not Failed then
                Statements.Parse (N.State, Failed);
                if not Failed then
                    if Lex.Token'Pos (Lex.Get_Token) =
                       Lex.Token'Pos (Lex.Close_Bracket) then
                        Bloc_Class.Close;
                        Lex.Next_Token;
                    else
                        raise Error_Broadcaster.Brackect_Is_Missing;
                    end if;
                end if;

            end if;
        end if;
        Error := Failed;

    end Parse;

    procedure Unparse (N : in out Node) is
    begin
        case N.Rule is
            when 0 =>
                null;
            when 1 =>
                Text_Io.Put ("{");
                Arguments.Unparse (N.Arg);
                Statements.Unparse (N.State);
                Text_Io.Put_Line ("}");
        end case;
    end Unparse;

    function Is_First (T : Lex.Token) return Boolean is
    begin
        return (Lex.Token'Pos (T) = Lex.Token'Pos (Lex.Open_Bracket));
    end Is_First;
    procedure Interpret (N : Node;
                         The_Argument : in out Object.Parameters.List;
                         Result : in out Object.Reference) is

    begin

        case N.Rule is
            when 0 =>
                Result := Statements.Interpret (N.State, Result);
            when 1 =>
                Arguments.Set (N.Arg, The_Argument);
                Result := Statements.Interpret (N.State, Result);
        end case;

    end Interpret;  
    function Interpret (N : Node; The_Argument : Object.Message)
                       return Object.Reference is

    begin

        if String_Utilities.Equal
              ("valeur", Bounded_String.Image (The_Argument), True) then
            return (Statements.Interpret (N.State));
        else
            raise Error_Broadcaster.Unknown_Unary_Message;
        end if;
    end Interpret;
end Bloc;

E3 Meta Data

    nblk1=4
    nid=4
    hdr6=6
        [0x00] rec0=24 rec1=00 rec2=01 rec3=022
        [0x01] rec0=21 rec1=00 rec2=03 rec3=018
        [0x02] rec0=1d rec1=00 rec2=02 rec3=000
        [0x03] rec0=07 rec1=00 rec2=04 rec3=000
    tail 0x21530e08484e54a0bc751 0x42a00088462060003
Free Block Chain:
  0x4: 0000  00 00 00 76 00 0c 20 20 20 20 20 20 20 20 65 6c  ┆   v          el┆