From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_MSGID, SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,be67139caad111d0,start X-Google-Attributes: gid103376,public From: "Scott Barrish" Subject: NEED HELP!!! Date: 1997/10/03 Message-ID: <343527ec.0@mail.icontech.com>#1/1 X-Deja-AN: 277646845 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Newsgroups: comp.lang.ada Date: 1997-10-03T00:00:00+00:00 List-Id: Here is my Stack.ads file: generic type Element_Type is private; -- The stack element package Stack is -- This package implements a stack, a data structure in which elements are added -- and removed from only one end; a "last in, first out" (LIFO) structure. type Stack_Type (Max_Size : Positive) is limited private; -- The stack class UNDERFLOW : exception; OVERFLOW : exception; procedure Clear (Stack : in out Stack_Type); -- Remove all elements from the stack -- Preconditions: None -- Postconditions: Stack is empty; it contains no elements function Empty (Stack : in Stack_Type) return Boolean; -- Tests whether a stack is empty (contains no elements) -- Preconditions: None -- Postconditions: Empty = (stack is empty) function Full (Stack : in Stack_Type) return Boolean; -- Tests whether a stack is full (no more elements can be pushed on it) -- Preconditions: None -- Postconditions: Full = (stack is full) procedure Push (Stack : in out Stack_Type; New_Element : in Element_Type); -- Adds New_Element to the top of Stack -- Preconditions: None -- Postconditions: Stack = original Stack with New_Element added on top -- Exceptions: OVERFLOW Raised on attempt to Push a new element onto a -- full stack. Stack is unchanged procedure Pop (Stack : in out Stack_Type; Popped_Element : out Element_Type); -- Removes top element from Stack and returns it in Popped_Element -- Preconditions: None -- Postconditions: Stack = original Stack with top element removed -- Popped_Element = top element of original Stack -- Exceptions: UNDERFLOW Raised on attempt to Pop an element from an -- empty stack. Stack remains empty. private type Stack_Array is array (Positive range <>) of Element_Type; type Stack_Type (Max_Size : Positive) is record Top : Natural := 0; Elements : Stack_Array (1..Max_Size); end record; end Stack; I need to know how to declare a stack of type element and max size. Sincerely, Scott Barrish