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

⟦7ff702189⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Statements, seg_038f15, seg_038f6c

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 Error_Broadcaster;
with Text_Io;
with Lex;
with Bounded_String;
with Object;
with Expression;
with More_Statements;
with Unparser;
package body Statements is
    type Node_Structure is
        record
            Rule : Natural range 0 .. 2 := 0;
            Expr : Expression.Node := Expression.Empty_Node;
            More : More_Statements.Node := More_Statements.Empty_Node;
        end record;

    procedure Parse (N : in out Node; Error : out Boolean) is
        Failed : Boolean := False;

    begin

        N := new Node_Structure;

        if Expression.Is_First (Lex.Get_Token) then
            N.Rule := 1;
            Expression.Parse (N.Expr, Failed);
            if not Failed then
                More_Statements.Parse (N.More, Failed);
            end if;
        else  
            case Lex.Get_Token is
                when Lex.Renvoyer =>
                    N.Rule := 2;
                    Lex.Next_Token;
                    Expression.Parse (N.Expr, Failed);
                when Lex.L_End | Lex.Close_Bracket =>
                    null;
                when others =>
                    raise Error_Broadcaster.Expression_Is_Missing;
            end case;
        end if;

        Error := Failed;

    exception
        when Error_Broadcaster.Expression_Is_Missing =>
            Error_Broadcaster.Expression_Missing (Lex.Get_Line);
            Error_Broadcaster.Unexpectedtoken (Lex.Get_Line);
            while Lex.Token'Pos (Lex.Get_Token) /= Lex.Token'Pos (Lex.Dot) loop
                Text_Io.Put (Bounded_String.Image (Lex.Get_Value));
                Lex.Next_Token;
            end loop;
            Text_Io.Put_Line ("");
            More_Statements.Parse (N.More, Failed);
            Failed := True;
            Error := Failed;
        when Error_Broadcaster.Brackect_Is_Missing =>
            Error_Broadcaster.Brackect_Missing (Lex.Get_Line);
            Failed := True;
            Error := Failed;
        when Error_Broadcaster.Parenthesis_Is_Missing =>
            Error_Broadcaster.Parenthesis_Missing (Lex.Get_Line);
            Failed := True;
            Error := Failed;
        when Error_Broadcaster.Unexpected_Token =>
            Error_Broadcaster.Unexpectedtoken (Lex.Get_Line);
            Failed := True;
            Error := Failed;
        when Error_Broadcaster.Identifier_Is_Missing =>
            Error_Broadcaster.Identifier_Missing (Lex.Get_Line);
            Failed := True;
            Error := Failed;
        when Error_Broadcaster.Dot_Is_Missing =>
            Error_Broadcaster.Dot_Missing (Lex.Get_Line);
            Failed := True;
            Error := Failed;
    end Parse;

    procedure Unparse (N : in out Node) is  
    begin
        case N.Rule is
            when 0 =>
                null;
            when 1 =>
                Expression.Unparse (N.Expr);
                Unparser.Put ("");
                More_Statements.Unparse (N.More);

            when 2 =>
                Unparser.Put ("renvoyer");
                Expression.Unparse (N.Expr);

        end case;
    end Unparse;

    function Interpret (N : Node;
                        Inherited : Object.Reference := Object.Void_Reference)
                       return Object.Reference is
        Result : Object.Reference;
    begin
        case N.Rule is
            when 0 =>
                Result := Inherited;
            when 1 =>
                Result := Expression.Interpret (N.Expr);
                Result := More_Statements.Interpret (N.More, Result);
            when 2 =>
                Result := Expression.Interpret (N.Expr);
        end case;
        return Result;
    end Interpret;
end Statements;

E3 Meta Data

    nblk1=6
    nid=5
    hdr6=a
        [0x00] rec0=24 rec1=00 rec2=01 rec3=01a
        [0x01] rec0=00 rec1=00 rec2=06 rec3=022
        [0x02] rec0=19 rec1=00 rec2=04 rec3=016
        [0x03] rec0=1b rec1=00 rec2=02 rec3=014
        [0x04] rec0=1a rec1=00 rec2=03 rec3=000
        [0x05] rec0=20 rec1=00 rec2=03 rec3=000
    tail 0x21531f9d684e874a5ba53 0x42a00088462060003
Free Block Chain:
  0x5: 0000  00 00 00 21 80 03 20 20 20 03 a4 0b 5b 73 74 61  ┆   !        [sta┆