From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c59de49f7d99d0b5 X-Google-Attributes: gid103376,public From: "David C. Hoos, Sr." Subject: Re: Difficulty compiling ada program! Date: 1998/07/14 Message-ID: <0dZUO8xr9GA.83@samson.airnet.net>#1/1 X-Deja-AN: 371319760 References: <900407099.23331.0.nnrp-10.c2de523e@news.demon.co.uk> Newsgroups: comp.lang.ada X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Date: 1998-07-14T00:00:00+00:00 List-Id: 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 ""<>, 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.