comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
Subject: Re: Difficulty compiling ada program!
Date: 1998/07/14
Date: 1998-07-14T00:00:00+00:00	[thread overview]
Message-ID: <0dZUO8xr9GA.83@samson.airnet.net> (raw)
In-Reply-To: 900407099.23331.0.nnrp-10.c2de523e@news.demon.co.uk


Ramsey Khair wrote in message
<900407099.23331.0.nnrp-10.c2de523e@news.demon.co.uk>...
>Hi,
>
>Can sombody please try compiling this source code as it keep saying "End of
>file expected" you have spilt the files where it says, if anybody has any
>luck please let me know!
>

Luck has nothing at all to do with it.  It just takes common sense and
perseverance.

First, when submitting questions to the group, it is always best to specifiy
the compiler and platform being used, with version numbers for both.

Second, when submitting source code, you should insure that your
mailer/poster software does not split lines, either by setting its
parameters appropriately, or by editing the source so its lines are within
your mailer/poster's capabilites.  A number of your comment lines were split
by your mailer/poster software.

Since you did not specify the compiler you are using, I used gnat-3.10p for
Windows NT -- my platform version is 4.0 (SP3).

Here, I followed the instructions in the GNAT User's Guide, particularly the
section entitled "Handling Files with Multiple Units".

This resulted in the file being split into three source files named
appropriately for GNAT.  It was in this step that the problem of
inappropriately split comment lines was revealed.

After rejoining the spli comment lines,then there were three compilation
errors in the file "generic_event_handler.adb", where there were lines
containing only "<>".

Initially I commented these lines out, and attempted a recompile (using the
command "gnatmake event_handler_test" to compile, bind and link all required
files with a single command, given that a cursory examination of the source
code suggested that "event_handler_test" was the main program).

Now, the compiler complained about three targets of "goto" statements being
undefined.  Knowing that goto labels are of the form ""<<Label_Identifier>>,
and given the three commented-out "<>" lines, I surmised thaat somehow these
labels had been corrupted.  Fortunately, the code immediately following two
of these three lines was commented appropriately so that the correct
placement of the three missing labels "Walk_Left", "Walk_Right", and
"End_Walk" could be deduced.

After typing in the three labels, the program compiled error- and
warning-free, and executed correctly.

Normally, I would not take the time nor make the effort I did with this one,
except that I am always on the lookout for possibly re-usable code to
include in my sanitized code repository.  This code is Ada83, and as such,
could benefit from some of the new cpapbilities of Ada95.  For example, I
would replace heap allocation with a user-defined storage pool to avoid the
potential of heap fragmentation, and the generally poorer performance of
heap allocators over user-defined storage pools.  General-purpose components
for simulations should not introduce the possibility that the simulation
could not run for extended periods of time (months or years) without
failure.

In short, "reusable" code from repositories often isn't, and there is no
"silver bullet". When all else fails (but before posting to the group) READ
(AND FOLLOW) THE INSTRUCTIONS.

David C. Hoos, Sr.






  reply	other threads:[~1998-07-14  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-14  0:00 Difficulty compiling ada program! Ramsey Khair
1998-07-14  0:00 ` David C. Hoos, Sr. [this message]
1998-07-14  0:00 ` Dale Stanbrough
1998-07-14  0:00 ` Markus Kuhn
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox