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

⟦8053190ab⟧ Ada Source

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

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 Bounded_String;
with Error_Broadcaster;
with Lex;
with Object;
with Value;  
with Bloc_Class;
with Text_Io;
package body Expression is
    type Node_Structure is
        record
            Rule : Natural range 0 .. 1 := 0;
            Val : Value.Node := Value.Empty_Node;
            Ident : Object.Message;
        end record;

    procedure Parse (N : in out Node; Error : out Boolean) is
        Failed : Boolean := False;
        Ident_Error : Object.Message;
    begin
        N := new Node_Structure;
        Bounded_String.Copy (Ident_Error, Lex.Get_Value);
        if Value.Is_First (Lex.Get_Token) then
            N.Rule := 0;
            Value.Parse (N.Val, Failed);
        else  
            case Lex.Get_Token is
                when Lex.Pour =>  
                    N.Rule := 1;
                    Lex.Next_Token;
                    case Lex.Get_Token is
                        when Lex.Identifier =>  
                            Bounded_String.Copy (N.Ident, Lex.Get_Value);
                            Bloc_Class.Put (N.Ident);
                            Lex.Next_Token;
                            case Lex.Get_Token is
                                when Lex.Prendre =>  
                                    Lex.Next_Token;
                                    if Value.Is_First (Lex.Get_Token) then
                                        Value.Parse (N.Val, Failed);  
                                    else
                                        raise Error_Broadcaster.
                                                 Unexpected_Token;  
                                    end if;
                                when others =>
                                    raise Error_Broadcaster.Prendre_Is_Missing;
                            end case;
                        when others =>
                            Failed := True;
                            raise Error_Broadcaster.Identifier_Is_Missing;
                    end case;
                when others =>
                    Failed := True;
                    Error_Broadcaster.Unexpectedtoken (Lex.Get_Line);
                    raise Error_Broadcaster.Expression_Is_Missing;
            end case;
        end if;
        Error := Failed;
    exception
        when Error_Broadcaster.Pour_Is_Missing =>
            Error_Broadcaster.Pour_Missing (Lex.Get_Line);
            N.Rule := 1;
            Bounded_String.Copy (N.Ident, Ident_Error);
            Bloc_Class.Put (N.Ident);
            Lex.Next_Token;
            Value.Parse (N.Val, Failed);
            Error := Failed;
        when Error_Broadcaster.Prendre_Is_Missing =>  
            Error_Broadcaster.Prendre_Missing (Lex.Get_Line);
            Value.Parse (N.Val, Failed);
            Error := Failed;  
    end Parse;











    function Is_First (T : Lex.Token) return Boolean is
        use Lex;
    begin
        return T = Lex.Pour or else Value.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 := Value.Interpret (N.Val);
            when 1 =>
                Result := Value.Interpret (N.Val);
                Bloc_Class.Set (N.Ident, Result);
        end case;
        return Result;
    end Interpret;
end Expression;

E3 Meta Data

    nblk1=5
    nid=4
    hdr6=8
        [0x00] rec0=21 rec1=00 rec2=01 rec3=030
        [0x01] rec0=11 rec1=00 rec2=05 rec3=084
        [0x02] rec0=24 rec1=00 rec2=03 rec3=012
        [0x03] rec0=15 rec1=00 rec2=02 rec3=000
        [0x04] rec0=10 rec1=00 rec2=03 rec3=000
    tail 0x2152fb64084de6b921b31 0x42a00088462060003
Free Block Chain:
  0x4: 0000  00 00 02 89 80 0b 20 20 20 75 73 65 20 4c 65 78  ┆         use Lex┆