summaryrefslogtreecommitdiff
path: root/stack/src/main.adb
diff options
context:
space:
mode:
Diffstat (limited to 'stack/src/main.adb')
-rw-r--r--stack/src/main.adb20
1 files changed, 20 insertions, 0 deletions
diff --git a/stack/src/main.adb b/stack/src/main.adb
new file mode 100644
index 0000000..977a46b
--- /dev/null
+++ b/stack/src/main.adb
@@ -0,0 +1,20 @@
1with Ada.Assertions; use Ada.Assertions;
2with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
3with Ada.Text_IO; use Ada.Text_IO;
4
5with Stack;
6
7procedure Main is
8 package IntStack is new Stack (Integer);
9 S : IntStack.Stack;
10 Val : Integer;
11begin
12 Put_Line ("Hello world!");
13 for I in 1 .. 5 loop
14 IntStack.Push (S, I);
15 end loop;
16 while not IntStack.Empty (S) loop
17 Assert (IntStack.Pop (S, Val));
18 Put_Line (Val'Image);
19 end loop;
20end Main;