/usr/share/doc/gnat-gps/examples/tutorial/common/sdc.adb is in gnat-gps-doc 5.3dfsg-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | with Except;
with Screen_Output; use Screen_Output;
with Stack;
with Tokens; use Tokens;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Command_Line; use Ada.Command_Line;
procedure Sdc is
File : File_Type;
begin
Msg ("Welcome to sdc. Go ahead type your commands ...");
if Argument_Count = 1 then
begin
Open (File, In_File, Argument (1));
exception
when Use_Error | Name_Error =>
Error_Msg ("Could not open input file, exiting.");
return;
end;
Set_Input (File);
end if;
loop
-- Open a block to catch Stack Overflow and Underflow exceptions.
begin
Process (Next);
-- Read the next Token from the input and process it.
exception
when Stack.Underflow =>
Error_Msg ("Not enough values in the Stack.");
when Stack.Overflow =>
null;
end;
end loop;
exception
when Except.Exit_SDC =>
Msg ("Thank you for using sdc.");
when others =>
Msg ("*** Internal Error ***.");
end Sdc;
|