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

⟦b117aa7d3⟧ TextFile

    Length: 905 (0x389)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

package body Stack_Gen is

    procedure Push (On : in out Stack_Gen.Object; The_Element : in Element) is
    begin
        On.Top := On.Top + 1;
        On.Content (On.Top) := The_Element;
    exception
        when Constraint_Error =>
            raise Full_Stack;
    end Push;


    procedure Pop (From : in out Stack_Gen.Object; The_Element : out Element) is
    begin
        From.Top := From.Top - 1;
        The_Element := From.Content (From.Top + 1);
    exception
        when Constraint_Error =>
            raise Empty_Stack;
    end Pop;


    function Top (From : Stack_Gen.Object) return Element is
    begin
        if Depth (From) = 0 then
            raise Empty_Stack;
        else
            return From.Content (From.Top);
        end if;
    end Top;


    function Depth (From : Stack_Gen.Object) return Natural is
    begin
        return From.Top;
    end Depth;

end Stack_Gen;