Prof A Olowofoyeku (The African Chief) wrote:
On 30 Sep 2004 at 13:32, Waldek Hebisch wrote:
Prof A Olowofoyeku (The African Chief) wrote:
I can't remember whether we have discussed this one before, but would it be possible for GPC to ignore some of the Delphi commands for exception handling - i.e., the "Try", "Except", "Finally" ... "End" blocks (perhaps with a warning that they are ignored/unsupported)?
At first glance looks easy. However, we do not want to make `try', `except', `on', `finally' into reserved words. Since for most Pascal instructions prepending identifier to the instruction turns the instruction into illegal code we should be able to parse `try' blocks reserving any words. Still, there are some nasty cases (at least user defined operators cause a problem).
On the other hand we would like do things properly. I would feel guilty putting into the compiler code which just ignores some important aspect of source programs.
I feel the same. (Actually I was going to write something like this, but I waited if you had anything better to say. ;-)
On the other hand, the points that you have raised are significant. So I should perhaps withdraw my request, and replace it with a request that exception handling be added to GPC if at all possible.
I agree that it should be added. It would allow for cleaner handling of runtime errors (when wanted) and nonlocal gotos (where there are problems now) as well.
As I've said (at least in discussions with Waldek and Markus), the backend has some kind of exception support, and first we should learn about it and decide whether we can use it. If so, I'd rather do this than to reinvent the wheel. Again if so, it might mean that we'll have to require a certain backend version (3.x.y), which is planned after the release of gpc-2.2. But then I really hope we can add it soon ...
Frank