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

⟦2972d36f7⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Statements, seg_036585

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;
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;



    function Is_First (T : Lex.Token) return Boolean is
        use Lex;
    begin
        return T = Lex.Renvoyer or else Expression.Is_First (T);
    end Is_First;

    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=5
    nid=5
    hdr6=8
        [0x00] rec0=23 rec1=00 rec2=01 rec3=03c
        [0x01] rec0=19 rec1=00 rec2=04 rec3=012
        [0x02] rec0=1c rec1=00 rec2=02 rec3=03c
        [0x03] rec0=10 rec1=00 rec2=03 rec3=000
        [0x04] rec0=0f rec1=00 rec2=05 rec3=000
    tail 0x2152fc81e84de7f661ce3 0x42a00088462060003
Free Block Chain:
  0x5: 0000  00 00 01 ce 00 22 20 20 20 20 20 20 20 20 52 65  ┆     "        Re┆