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

⟦22915691b⟧ TextFile

    Length: 11291 (0x2c1b)
    Types: TextFile
    Notes: R1k Text-file segment

Derivation

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

TextFile

with text_io;
use text_io;
procedure test_node1 is

type kind_type is (a,b,c);

type inst(kind : kind_type := a);

type object is access inst;

type inst(kind : kind_type := a) is record
new_inst : object;
case kind is
when a =>
aa : integer;
when b =>
bb => character;
when c =>
cc : string[12];
end case;
end record;

i1,i2 : object;

begin

i2:=new object'(new_inst=>null,kind=>a,aa=>5);
i1:=new object'(new_inst=>i2,kind=>b,b=>'r');
put_line(i1.b & " " & integer.image(i2.bb));
end;

with text_io;
use text_io;
procedure test_node2 is

type kind_type is (a,b,c);

type node;

type object is access node;

type inst(kind : kind_type := a) is record
case kind is
when a =>
aa : integer;
when b =>
bb => character;
when c =>
cc : string[12];
end case;
end record;

type node is record

new_node : object;
in : inst;
end record;

i1,i2 : inst;
o1,o2 : object
begin

i2:=(kind=>a,aa=>5);
i1:=(kind=>b,bb=>'r');
o2:=new object'(new_node=>null,in=>i2);
o1:=new object'(new_node=>o2,in=>i1);

put_line(o1.in.bb & " " & integer'image(o2.in.aa));

end;

-- test order --

with text_io,order,identifier,moving_string_array,group_array,complement_identifier_array;
use text_io,order;
procedure test_order is

o : object;
ia,ia2 : index_array;
id : identifier.object;
ok : boolean;

begin
complement_identifier_array.put(identifier.from_string("courir"),ok);
complement_identifier_array.put(identifier.from_string("chambre"),ok);
complement_identifier_array.put(identifier.from_string("salon"),ok);
complement_identifier_array.put(identifier.from_string("aller"),ok);
complement_identifier_array.put(identifier.from_string("de"),ok);
complement_identifier_array.put(identifier.from_string("nord"),ok);
complement_identifier_array.show;

identifier.put(id,"salle");
group_array.put(id,complement_identifier_array.index("chambre"),ok);
group_array.put(id,complement_identifier_array.index("salon"),ok);
group_array.put(id,complement_identifier_array.index("cuisine"),ok);
group_array.show

put_line("show vide");
show(o);

put_line("put complement");
put_complement(o,moving_string.from_string("cuisine"),moving_string.from_string_string("aller"),
moving_string.from_string("nord"),
moving_string.from_string("de"),
moving_string.from_string("salle");

put_line("put redirection");
ia:=(1,3,4,5,2);
put_redirection(o,ia);

put_line("show plein");
show(o);

put_line("image " & image(o));

put_line("redirection ");
ia2:=redirection(o);
put_line("image de ia2 : "index'image(ia2(1)) & " " & 
index'image(ia2(2)) & " " &
index'image(ia2(3)) & " " & index'image(ia2(4)) & " " & index'image(ia2(5)) & " ");

put_line("complement " & complement(o,1)  & complement(o,3) & complement(o,2)
 & complement(o,4) & complement(o,5));

put_line("contain aller " & boolean'image(contains_complement(o,"aller"));
put_line("contain qller " & boolean'image(contains_complement(o,"qller"));

put_line("position de " & natural'image(position_complement(o,"de"));
put_line("position des " & natural'image(position_complement(o,"des"));

put_line("redirection salle 2");
make_redirection(o,"salle",5);
show(o);

put_line("redirection salle 4 [cuisine aller nord salle]");
make_redirection(o,"salle",4);
show(o);

put_line("show apres free");
free(o);
show(o);

end;

-- test order_list --

with text_io,order_list,order,identifier,moving_string_array,group_array,complement_identifier_array;
use text_io,order_list;
procedure test_order is

o : order.object;
id : identifier.object;
ok : boolean;

begin
complement_identifier_array.put(identifier.from_string("courir"),ok);
complement_identifier_array.put(identifier.from_string("chambre"),ok);
complement_identifier_array.put(identifier.from_string("salon"),ok);
complement_identifier_array.put(identifier.from_string("aller"),ok);
complement_identifier_array.put(identifier.from_string("de"),ok);
complement_identifier_array.put(identifier.from_string("nord"),ok);
complement_identifier_array.show;

identifier.put(id,"salle");
group_array.put(id,complement_identifier_array.index("chambre"),ok);
group_array.put(id,complement_identifier_array.index("salon"),ok);
group_array.put(id,complement_identifier_array.index("cuisine"),ok);
group_array.show

put_line("show vide");
show;

put_complement(o,moving_string.from_string("cuisine"),moving_string.from_string_string("aller"),
moving_string.from_string("nord"),
moving_string.from_string("de"),
moving_string.from_string("salle");
put_line("order 1");
order.show(o);
put(o,ok);
put_line("put ok " & boolean'image(ok));
put(o,ok);
put_line("put ok " & boolean'image(ok));

put_complement(o,moving_string.from_string("cuisine"),moving_string.from_string_string("aller"),
moving_string.from_string("nord"),
moving_string.from_string("salle"),
moving_string.from_string("");
put_line("order 1");
order.show(o);
put(o,ok);

put_line("put ok " & boolean'image(ok));
put_complement(o,moving_string.from_string("cuisine"),moving_string.from_string_string("courir"),
moving_string.from_string("nord"),
moving_string.from_string("de"),
moving_string.from_string("salle");
put_line("order 1");
order.show(o);
put(o,ok);
put_line("put ok " & boolean'image(ok));

put_complement(o,moving_string.from_string("cuisine"),moving_string.from_string_string("courir"),
moving_string.from_string("salle"),
moving_string.from_string("nord"),
moving_string.from_string("");
put_line("order 1");
order.show(o);
put(o,ok);
put_line("put ok " & boolean'image(ok));

put_line("contain aller " & boolean'image(contains_complement(o,"aller"));
put_line("contain qller " & boolean'image(contains_complement(o,"qller"));
put_line("contain de " & boolean'image(contains_complement(o,"de"));
put_line("contain salle " & boolean'image(contains_complement(o,"salle"));

put-line("show avant redirection");
show;

put_line("redirection salle");
make_redirection("salle");

put_line("show apres redirection");
show(o);

put-line("iteration");
init;
while not done loop
o:=value;
order.show(o);
next;
end loop;



put_line("show apres free");
free(o);
show(o);

end;

-- test the_order --


with text_io,the_order,order,identifier,moving_string_array,group_array,complement_identifier_array;
use text_io,the_order;
procedure test_the_order is

ia : order.index_array;
id : identifier.object;
ok : boolean;

begin
complement_identifier_array.put(identifier.from_string("courir"),ok);
complement_identifier_array.put(identifier.from_string("chambre"),ok);
complement_identifier_array.put(identifier.from_string("salon"),ok);
complement_identifier_array.put(identifier.from_string("aller"),ok);
complement_identifier_array.put(identifier.from_string("de"),ok);
complement_identifier_array.put(identifier.from_string("nord"),ok);
complement_identifier_array.show;

identifier.put(id,"salle");
group_array.put(id,complement_identifier_array.index("chambre"),ok);
group_array.put(id,complement_identifier_array.index("salon"),ok);
group_array.put(id,complement_identifier_array.index("cuisine"),ok);
group_array.show

put_line("show vide");
show;

put_line("put complement");
put_complement(moving_string.from_string("cuisine"),moving_string.from_string_string("aller"),
moving_string.from_string("nord"),
moving_string.from_string("de"),
moving_string.from_string("salle");

put_line("put redirection");
ia:=(1,3,4,5,2);
put_redirection(ia);

put_line("show plein");
show(;


put_line("complement " & complement(1)  & complement(3) & complement(2)
 & complement(4) & complement(5));


put_line("show apres free");
free;
show;

end;

with text_io,objet,order,the_order,the_hero,the_place,identifier,group_array,complement_identifier_array;
use text_io,objet;
procedure test_objet is

o : order.object;
id : identifier.object;
ia : index_array;
ok : boolean;

begin
complement_identifier_array.put(identifier.from_string("courir"),ok);
complement_identifier_array.put(identifier.from_string("chambre"),ok);
complement_identifier_array.put(identifier.from_string("salon"),ok);
complement_identifier_array.put(identifier.from_string("aller"),ok);
complement_identifier_array.put(identifier.from_string("de"),ok);
complement_identifier_array.put(identifier.from_string("nord"),ok);
complement_identifier_array.put(identifier.from_string("gaston"),ok);
complement_identifier_array.put(identifier.from_string("alfred"),ok);
complement_identifier_array.show;

identifier.put(id,"salle");
group_array.put(id,complement_identifier_array.index("chambre"),ok);
group_array.put(id,complement_identifier_array.index("salon"),ok);
group_array.put(id,complement_identifier_array.index("cuisine"),ok);
group_array.show;

put_line("the order put complement avec 5 pour 5");
the_order.put_complement(moving_string.from_string("cuisine"),moving_string.from_string_string("aller"),
moving_string.from_string("nord"),
moving_string.from_string("de"),
moving_string.from_string("cuisine");
ia:=(0,0,0,0,5);
the_order.put_redirection(ia);
the_order.show;

the_hero.put(complement_identifier_array.index("gaston");
put_line("index the hero : " & natural'image(the_hero.index)); 
the_hero.show;

the_place.put(complement_identifier_array.index("salon");
put_line("index the place : " & natural'image(the_place.index)); 
the_place.show;

put_line("create real");
create_real(o,complement_identifier_array.index("alfred"));
show(o);
put_line("is a real : " & boolean'image(is_a_real(o)));
put_line("is a group : " & boolean'image(is_a_group(o)));
put_line("is the place : " & boolean'image(is_the_place(o)));
put_line("is the hero : " & boolean'image(is_the_hero(o)));
put_line("complement " & natural'image(complement(o)) & image(o));

put_line("create group");
create_group(o,5);
show(o);
put_line("is a real : " & boolean'image(is_a_real(o)));
put_line("is a group : " & boolean'image(is_a_group(o)));
put_line("is the place : " & boolean'image(is_the_place(o)));
put_line("is the hero : " & boolean'image(is_the_hero(o)));
put_line("complement " & natural'image(complement(o)) & image(o));

put_line("create place");
create_place(o);
show(o);
put_line("is a real : " & boolean'image(is_a_real(o)));
put_line("is a group : " & boolean'image(is_a_group(o)));
put_line("is the place : " & boolean'image(is_the_place(o)));
put_line("is the hero : " & boolean'image(is_the_hero(o)));
put_line("complement " & natural'image(complement(o)) & image(o));

put_line("create hero");
create_hero(o);
show(o);
put_line("is a real : " & boolean'image(is_a_real(o)));
put_line("is a group : " & boolean'image(is_a_group(o)));
put_line("is the place : " & boolean'image(is_the_place(o)));
put_line("is the hero : " & boolean'image(is_the_hero(o)));
put_line("complement " & natural'image(complement(o)) & image(o));

put_line("the order put complement avec 4 pour 5");
the_order.put_complement(moving_string.from_string("cuisine"),moving_string.from_string_string("aller"),
moving_string.from_string("nord"),
moving_string.from_string("cuisine"),
moving_string.from_string("");
ia:=(0,0,0,0,4);
the_order.put_redirection(ia);
the_order.show;

put_line("create group");
create_group(o,5);
show(o);
put_line("is a real : " & boolean'image(is_a_real(o)));
put_line("is a group : " & boolean'image(is_a_group(o)));
put_line("is the place : " & boolean'image(is_the_place(o)));
put_line("is the hero : " & boolean'image(is_the_hero(o)));
put_line("complement " & natural'image(complement(o)) & image(o));

end