Re: Informix compiler parsing is poor
Posted in 1994
->From: andrewm@ccfadm.eeg.ccf.org (Martin Andrews) ->Subject: Re: Informix compiler parsing is poor ->Date: Thu, 10 Feb 1994 13:50:49 GMT ->Reply-To: andrewm@ccfadm.eeg.ccf.org (Martin Andrews) ->Organization: Biomedical Engineering, Cleveland Clinic Foundation -> ->Bruce Momjian (root@candle.uucp) wrote: ->: Has anyone else noticed that the informix c4gl compiler accepts some ->: sytax as valid, like -> ->: print column "fred", "barney" [1] -> ->: which emits no compiler warning, but goes into an infinite loop at run ->: time. The parser should catch this bug. -> ->: I have found other weird limitations, like you can't use a string ->: constant in a cursor OPEN statement, and sometimes built-in function ->: calls can't be used in certain cases. [2] -> ->: It seems like the 4gl parsing is just not as robust as other languages I ->: have used. Has anyone else noticed this? -> ->Absolutely, the most infuriating is when simple syntax errors generate ->broken code like the print statement you mentioned. I ran into the problem ->that if I closed a window that I hadn't opened (I mis-typed the name) the ->executable would core dump. Why can't the compiler catch this? [3] -> ->---- ->Martin Andrews andrewm@ccfadm.eeg.ccf.org ->Dept. of Neurology Phone (216)444-7485 ->Cleveland Clinic Foundation Fax (216)445-6617 [1] I agree that this is strange. The column operator should take an integer argument, or at least numeric that it converts to integer; the compiler should complain if you give it a string. Hmmm, however, I-4GL will convert "123" to numeric 123 in many contexts. Maybe this is one, and that is why the compiler lets you do what looks like an error, since the compiler does not evaluate the CONTENT of the string. [2] You need to distinguish between SQL and 4GL built-in functions. 4GL will let you use SQL built-ins in embedded SQL, but they are not available in plain 4GL statements. USER is an example. [3] On my system the compiler does not catch it, but `ld' pukes during the link step. It says "undefined external" and lists the window name preceded by (if I remember correctly) "__W", so window "frame" is listed as "__Wframe". This is in compiled 4GL; if you are using RDS, then this might not be caught by the compiler, and there is no real link step. With RDS, I would expect a run-time error, not a core-dump. Regards, Alan ___________________________ ______________________| R. Alan Popiel |__________________________ \\ Internet: | Martin Marietta, SLS | / \\ alan@den.mmc.com | P.O. Box 179, M/S 3810 | Std disclaimers apply. / )Voice: | Denver, CO 80201-0179 USA | ( / 303-977-9998 |___________________________| (But you knew that!) \\ /________________________) (____________________________\\