summaryrefslogtreecommitdiff
path: root/stack/src/main.adb
blob: 977a46b5a6560ce456858be85f3624f967e6a49f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
with Ada.Assertions; use Ada.Assertions;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Ada.Text_IO; use Ada.Text_IO;

with Stack;

procedure Main is
   package IntStack is new Stack (Integer);
   S : IntStack.Stack;
   Val : Integer;
begin
   Put_Line ("Hello world!");
   for I in 1 .. 5 loop
      IntStack.Push (S, I);
   end loop;
   while not IntStack.Empty (S) loop
      Assert (IntStack.Pop (S, Val));
      Put_Line (Val'Image);
   end loop;
end Main;