-- Code of Figure 8.4, pages 335-336 from
-- Kenneth C. Louden, Programming Languages
-- Principles and Practice 2nd Edition
-- Copyright (C) Brooks-Cole/ITP, 2003

with Text_IO; use Text_IO;
with Ada.Integer_Text_IO;
use Ada.Integer_Text_IO;

procedure lastex is

  procedure p(n: integer) is

    procedure show is
    begin
      if n > 0 then p(n - 1);
      end if;
      put(n);
      new_line;
    end show;

  begin -- p
    show;
  end p;

begin -- lastex
  p(1);
end lastex;


