DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦0227b4d2f⟧ TextFile

    Length: 4015 (0xfaf)
    Types: TextFile
    Names: »B«

Derivation

└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Text_Io;
with Lex;
with Object;
with Bounded_String;
with String_Utilities;
with Bloc_Class;
with Error_Broadcaster;
package body More2_List is
    type Node_Structure is
        record
            Rule : Natural range 0 .. 1 := 0;
            Ident : Object.Message;
            Keyword : Object.Message;
            More2 : More2_List.Node := More2_List.Empty_Node;
        end record;

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

    begin
        N := new Node_Structure;
        case Lex.Get_Token is

            when Lex.Key_Word =>
                Bounded_String.Copy (N.Keyword, Lex.Get_Value);
                Lex.Next_Token;
                if Lex.Token'Pos (Lex.Get_Token) /=
                   Lex.Token'Pos (Lex.Identifier) then
                    Error := Failed;
                else
                    Bounded_String.Copy (N.Ident, Lex.Get_Value);
                    Bloc_Class.Local_Put (N.Ident);
                    Lex.Next_Token;
                end if;
                if not Failed and Lex.Token'Pos (Lex.Get_Token) =
                                     Lex.Token'Pos (Lex.Key_Word) then  
                    N.Rule := 1;
                    More2_List.Parse (N.More2, Failed);
                end if;
            when others =>
                null;
        end case;
        Error := Failed;
    end Parse;
    function Is_First (T : Lex.Token) return Boolean is
        use Lex;
    begin
        return T = Lex.Key_Word;
    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 := Inherited;
                Result := More2_List.Interpret (N.More2, Result);
        end case;
        return Result;

    end Interpret;


    procedure Make_Selector (N : Node;
                             Selector : in out Object.Message;
                             Cardinality : in out Natural) is

    begin
        case N.Rule is
            when 0 =>
                Bounded_String.Append (Selector, N.Keyword);
                Cardinality := Cardinality + 1;
            when 1 =>
                Bounded_String.Append (Selector, N.Keyword);
                Cardinality := Cardinality + 1;
                Make_Selector (N.More2, Selector, Cardinality);
        end case;
    end Make_Selector;
    procedure Set_More (N : Node;
                        The_Argument : in out Object.Parameters.List) is
        Obj : Object.Reference;
    begin
        case N.Rule is
            when 0 =>  
                Object.Parameters.Get (The_Argument, Obj);
                Bloc_Class.Set (N.Ident, Obj);
            when 1 =>
                Object.Parameters.Get (The_Argument, Obj);
                Bloc_Class.Set (N.Ident, Obj);
                Set_More (N.More2, The_Argument);
        end case;
    end Set_More;

    procedure Set (N : Node; The_Argument : in out Object.Parameters.List) is
        Obj : Object.Reference;
        Selector : Object.Message;
        Cardinality : Integer := 0;
    begin
        Make_Selector (N, Selector, Cardinality);
        if String_Utilities.Equal
              (Bounded_String.Image (Object.Parameters.Selector (The_Argument)),
               Bounded_String.Image (Selector), True) then

            case N.Rule is
                when 0 =>  
                    Object.Parameters.Get (The_Argument, Obj);
                    Bloc_Class.Set (N.Ident, Obj);
                when 1 =>
                    Object.Parameters.Get (The_Argument, Obj);
                    Bloc_Class.Set (N.Ident, Obj);
                    Set_More (N.More2, The_Argument);
            end case;
        else  
            raise Error_Broadcaster.Unknown_Keyword_Message;
        end if;  
    end Set;
end More2_List;