Frank:
Here is a bad chunk of code:
ri := ri + end;
This is what GPC has to say about it:
ridi.p:1531: parse error before `End'
Here is what the Sun Pascal compiler has to say about it:
pc0: WorkShop Compilers 4.2 01/04/00 Pascal 4.2 patch 104632-11 Fri Nov 1 02:52:33 2002 ridi.p: 1531 end; E 18480----------------^--- Inserted identifier
I always find the Sun display much easier to interpret instantly. It would be nice to have GPC show the line and show the point of the error.
GPC's error messages (which follow the same standard as most GNU programs) are more targeted towards automatic parsing.
Yes, that's good.
If run call GPC from a user interface that supports it (e.g., PENG ... excuse the little plug ;-),
Noted!
but I guess also RHIDE, Emacs, etc.), it will show the source position.
But if you prefer working on the command-line, here's a little script to convert the message format. You have to pipe the error messages through it, e.g.
sh/bash:
gpc <options> foo.pas 2>&1 | gnumsg2spc
csh/tcsh:
gpc <options> foo.pas |& gnumsg2spc
DJGPP:
redir -eo gpc <options> foo.pas | sh gnumsg2spc
Thanks for the explanation. I was not able to locate gnumsg2spc on the web with google though. Where is it?
Another issue is that GPC's messages don't include the column position. Unfortunately, that's hard to achieve with the current design of the preprocessor and lexer. But a reimplementation of those is planned, and then it will be possible I hope.
Great!
Tom
Dr. Thomas D. Schneider National Cancer Institute Laboratory of Experimental and Computational Biology Frederick, Maryland 21702-1201 toms@ncifcrf.gov permanent email: toms@alum.mit.edu (use only if first address fails) http://www.lecb.ncifcrf.gov/~toms/
Tom Schneider wrote:
Thanks for the explanation. I was not able to locate gnumsg2spc on the web with google though. Where is it?
I sent it with my last mail. You can find it in the archive at http://gnu-pascal.de/crystal/gpc/en/mail7130.html. The script will be included with future GPC source releases.
Frank