[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ylwrap should be included for any Yacc compilations.
From: |
Derek Price |
Subject: |
Re: ylwrap should be included for any Yacc compilations. |
Date: |
Mon, 04 Apr 2005 17:17:32 -0400 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Alexandre Duret-Lutz wrote:
|>>> "Derek" == Derek Price <address@hidden> writes:
|
|
| Derek> ylwrap appears to take care of the problem that Yacc
| compilers like to Derek> generate #line directives in generated C
| sources with complete paths Derek> to source files.
|
| So does the inline rule. Can you provide instructions to reproduce
| the problem ?
Alexandre,
Glancing at the inline rule which was being used:
~ sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >address@hidden && mv address@hidden $@
Only the filename portion of the path is being replaced here. The
ylwrap script actually replaces an absolute path in the #line
directive with just the filename:
...
~ # Quote $INPUT_DIR so we can use it in a regexp.
~ # FIXME: really we should care about more than `.' and `\'.
~ input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
...
~ sed "/^#/{s,$input_rx,,;s,$from,$2,;s,$FROM,$TO,;}" "$from" >"$target"
...
It's the absolute path which some yacc compilers leave behind that we
need removed to avoid this problem. I'd be just as happy if it
happened in the inline version, but I thought it would be simpler to
just use ylwrap since it already exists and does what is needed. Even
if it does a little extra work at least the compatibility cruft would
only need to be maintained in a single location.
Cheers,
Derek
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCUa7sLD1OTBfyMaQRAvKWAKDEFAwXHnw1F+Wu5V+2eZ8+rJF7CgCgi940
WPLOtHffnyVuBk9z3Ts7It0=
=nC7F
-----END PGP SIGNATURE-----