This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] PR 4093
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: Stan Shebs <shebs at apple dot com>
- Cc: Richard Henderson <rth at redhat dot com>, Jason Merrill <jason at redhat dot com>,Craig Rodrigues <rodrigc at attbi dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 1 Mar 2002 23:20:13 +0000
- Subject: Re: [C++ Patch] PR 4093
- References: <20020224124958.A20386@attbi.com> <wvladty3fjp.fsf@prospero.cambridge.redhat.com> <20020225145300.D27689@redhat.com> <3C7FFAEC.F1C9CE6C@apple.com>
Stan Shebs wrote:-
> One of the long-term directions that has been talked about is to
> unify all the C dialects into a single compiler, organized around
> the rewritten C++ parser. Making the C++ frontend __GNUC__-only
> would work against that.
I've been thinking about this recently. IMO the value to be had is
in sharing the semantic actions (i.e. parser_build_xxx etc.) and the
rest below them, but I don't think there is much value in sharing the
*parser* itself. In the last six months we've found at least 3 major
bugs in the semantic actions that had been fixed in either C or C++
but not the other, and many more minor ones (I'm particularly thinking
of various C / ObjC issues I've resolved here).
C and C++ are simply too different, and C can be parsed efficiently with
a single lookahead token, whereas C++ requires extra baggage for arbitrary
lookahead that would be a shame to impose upon the C parser. Thoughts?
Neil.