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

⟦72767e5a0⟧ Ada Source

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

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Message;
with Message_Defs;
with Message_Interchange;
with Message_Transport;
with Notice;
with Parameter;
with Parameter_Parser;
with Set;
with Text_Io;
package body Message_Client_Test is

    function Note_Image is new Notice.Image (Message_Interchange.Separator);

    type Option_Id is (Nil, Class, Status, Result, Params);
    type Param_Id is (Nil, Param, Kind, Data);

    package Message_Parser is
       new Parameter_Parser
              (Option_Id => Option_Id,
               Option_Kinds => "class => string, status => string" &
                                  "result =>integer" & "params => string",
               Default_Values => "");


    package Argument_Parser is
       new Parameter_Parser
              (Option_Id => Param_Id,
               Option_Kinds => "param=>string,kind=>string,data=>string");

    S : Message_Transport.Status_Code;
    Mes : Message.Object;

    use Text_Io;


    procedure Start is  
        M_Iter : Message_Parser.Iterator;
        A_Iter : Argument_Parser.Iterator;
    begin
        M_Iter :=
           Message_Parser.Parse
              ("Class => hello, status => good,result => 123, params => ( param => filename,kind=>string,data=>45, param=>acl, kind=>string,data=>45)");

        if not Message_Parser.Is_Successful (M_Iter) then
            Put_Line (Message_Parser.Diagnosis (M_Iter));
        else
            Put_Line ("message parser is successful");
        end if;

        Put_Line ("Class => " & Message_Parser.Get_Image
                                   (Iter => M_Iter, Name => Class));
        Put_Line ("Status => " & Message_Parser.Get_Image
                                    (Iter => M_Iter, Name => Status));
        Put_Line ("Result => " & Message_Parser.Get_Image
                                    (Iter => M_Iter, Name => Result));
        Put_Line ("Params => " & Message_Parser.Get_Image
                                    (Iter => M_Iter, Name => Params));

        A_Iter := Argument_Parser.Parse (Message_Parser.Get_Image
                                            (Iter => M_Iter, Name => Params));

        if not Argument_Parser.Is_Successful (A_Iter) then
            Put_Line (Argument_Parser.Diagnosis (A_Iter));
        else
            Put_Line ("argument parser is successful");
        end if;

        while not Argument_Parser.Done (A_Iter) loop
            Put_Line (Param_Id'Image (Argument_Parser.Name (A_Iter)));
            Argument_Parser.Next (A_Iter);
        end loop;



    end Start;


end Message_Client_Test;

E3 Meta Data

    nblk1=4
    nid=2
    hdr6=6
        [0x00] rec0=25 rec1=00 rec2=01 rec3=02e
        [0x01] rec0=15 rec1=00 rec2=04 rec3=03e
        [0x02] rec0=16 rec1=00 rec2=03 rec3=000
        [0x03] rec0=16 rec1=00 rec2=02 rec3=000
    tail 0x21722f26883ce80360bf3 0x42a00088462060003
Free Block Chain:
  0x2: 0000  00 00 02 72 00 00 00 00 41 20 20 20 20 20 20 20  ┆   r    A       ┆