--<****D* RoboDoc Example: Description and Usage -- NAME -- usestack.adb - Test Driver for Integer Stack Package - RoboDoc demo -- AUTHOR -- Dr. Spiegel -- CREATION DATE -- 29 March 2019 -- EXAMPLE -- Run, enter integers, terminated by -1. -- List prints in reverse, as it is unloaded from stack -- DESCRIPTION -- Tests all Stack Operations (except Top()). -- NOTES -- Use gdb to watch constructor, destructor, and = operator fire as calls to -- Initialize, Finalize, and Adjust, respectively. -- Robodoc is displayed here: -- http://acad.kutztown.edu/~spiegel/CSc310/toc_index.html#top -->**** with Gnat.Io; use Gnat.Io; with IntStack; use IntStack; --<****f* UseStack/UseStack.main -- DESCRIPTION -- Test Driver Program UseStack -- PARAMETERS -- I: Integer; - Data Read Into I -- R, S: Stack; - Two Stacks; Allows demo of Adjust() -->**** procedure UseStack is --<****f* UseStack/UseStack.Print -- DESCRIPTION -- Print the stack of integers. -- PARAMETERS -- S: Stack - The stack object -->**** procedure Print(S: in out Stack) is I: Integer; begin while not Empty(S) loop Pop(S, I); Put(I); Put(" "); end loop; New_Line; end Print; -- Test vars. I: Integer; R, S: Stack; begin -- Get some integers. loop -- Read integers, stopping at -1. Put("Enter Integers, -1 to quit > "); Get(I); exit when I = -1; Push(R, I); end loop; -- Print 'em, twice. S := R; Print(R); Print(S); end UseStack;