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)?
You mean to treat: try Statements except on ex1 do EH1 on ex2 do EH2 else EHE finally FS end
as begin Statements; FS end
Yes
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.
With warnings. Presumably, those who are sharing code between compilers that support exception handling of that kind and those that do not, are aware of the potential problem. With warnings, the ball is then left squarely in their courts.
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.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/