Gerald Pfeifer wrote:
> If wrc is built by (BSD) yacc, the build aborts with the following error:
> 
>   ../../tools/wrc/wrc -c -s -p rsrc -s -pcomdlg32 -I. -I. -I../../include
>   -I../../include ./rsrc.rc
>   Error cdlg_xx.rc: 8, 1: syntax error
>   *** Error code 1

This is a yacc issue. I am working on it (use bison for the time being).
It has something to do with the lookahead token management, where an
empty lookahead is "-2" for bison and "-1" for yacc. There are also a
few other issues involved which still need to be examined more closely.

> Now, there are several issues:
>  1. It is not completely intuitive, what "8" and "1" mean, respectively.
>     Line and column, I guess? Perhaps adding "column" before "1" makes
>     sense?

Line 8, column 1. I know, it should be documented...

>  2. Neither wrc -help nor -h nor --help provides any help.

Noop, -h genereates a header file and longopts are not implemented.
However,... what about:
$ more tools/wrc/README.wrc
$ man tools/wrc/wrc.man
Wouldn't hurt to look at these, does it?

>  3. In the example at hand, "8, 1" is not correct. If I modify cdlg_xx.rc
>     by inserting blank lines at the beginning, the error message does not
>     change!

This is because the previous line (which had a token on it) is at fault.
Just like all compilers, some errors occur *after* the real error due to
token (-lookahead-) scaning. This can only partly be solved when I
implement "real" error messages. However, you always will need some kind
of "programmer's eye" to solve the real problem. There is absolutely no
provision for resolving the error token at the moment. This is the only
way to give real messages. I haven't had time to go into that because it
is a lot of work (and the grammar is already ugly as it is). It is made
more difficult by the combination of syntax sensitivity and
insensitivity of the grammar involved.

> I'd try to fix these by myself, but wrc isn't something I'm familiar with,
> so can any of you provide some help?

What do you want to fix? You can always send patches to me.

Greetings Bertho

Reply via email to