toms@ncifcrf.gov wrote:
Folks:
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. If run call GPC from a user interface that supports it (e.g., PENG ... excuse the little plug ;-), 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
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.
Frank