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

⟦a2e9320bb⟧ Ada Source

    Length: 3072 (0xc00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body T_Stack, seg_03fde4

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 Unchecked_Deallocation, T_Stack, Text_Io;

package body T_Stack is

    procedure Free is new Unchecked_Deallocation (Stack_Cell, Tstack);

    procedure Create (Thetop : in out Tstack) is
    begin
        Thetop := null;
    end Create;

    function Empty (Thetop : Tstack) return Boolean is
    begin
        return (Thetop = null);
    end Empty;

    procedure Push (Thetop : in out Tstack; X : P) is
        Astack : Tstack;
    begin
        Astack := new Stack_Cell;
        Astack.all.Element := X;
        Astack.all.Next_Cell := Thetop;
        Thetop := Astack;
    exception
        when others =>
            raise Error_Tstack_Allocation;
    end Push;

    procedure Pop (Thetop : in out Tstack) is
        Astack : Tstack;
    begin
        if not Empty (Thetop) then
            Astack := Thetop;
            Thetop := Astack.all.Next_Cell;
            Free (Astack);
        end if;
    end Pop;

    function Get (Thetop : Tstack) return P is
    begin
        return Thetop.all.Element;
    end Get;


end T_Stack;

E3 Meta Data

    nblk1=2
    nid=0
    hdr6=4
        [0x00] rec0=28 rec1=00 rec2=01 rec3=020
        [0x01] rec0=07 rec1=00 rec2=02 rec3=001
    tail 0x21539f870860c588f5413 0x42a00088462060003