From: George <mail2george@gmx-topmail.de>
Subject: Wrong program structure
Date: 23 Oct 2010 21:08:32 GMT
Date: 2010-10-23T21:08:32+00:00 [thread overview]
Message-ID: <8ih16gF70rU2@mid.individual.net> (raw)
Hi All,
GNAT is complaining about "begin" being used as identifier and a missing
"begin" for procedure "keywords4". The progam structure is like this:
with Ada.Text_IO;
with Ada.Command_Line;
with Ada.Characters.Handling;
procedure keywords4 is
procedure Ada83 is
begin
-- some string output
end Ada83;
procedure Ada95 is
begin
-- some string output
end Ada95;
procedure Ada2005 is
begin
-- some string output
end Ada2005;
procedure Attributes is
begin
-- some string output
end Attributes;
procedure Sources is
begin
-- some string output
end Sources;
procedure Author is
begin
-- some string output
end Author;
begin
-- Ada.Command_Line.Argument_Count is "0" if
-- a) Command_Line.Argument_Count is not implemented (Compiler, OS)
-- b) no arguments given
if Ada.Command_Line.Argument_Count > 0 then
for counter in 1..Ada.Command_Line.Argument_Count loop
declare
Arg : constant String := Ada.Characters.Handling.To_Upper
(Ada.Command_Line.Argument(counter));
-- some commands
end loop;
else -- if Argument_Count = 0 print help
-- some commands
end if;
end keywords4;
I nested the procedures Ada83, Ada95, etc. into keywords4 because I can
not have multiple compilation units. I tried defining a package but when
executing the program the runtime library came back with the message that
the code could not be executed.
Maybe I am asking simple questions. Its because I am new to Ada and try
get used to the language.
What is the problem with the above code?
Regards
George
next reply other threads:[~2010-10-23 21:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-23 21:08 George [this message]
2010-10-23 21:16 ` Wrong program structure Vinzent Hoefler
2010-10-23 21:24 ` George
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox