[C++ Patch] PR 4093
Neil Booth
neil@daikokuya.demon.co.uk
Fri Mar 1 15:20:00 GMT 2002
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.
More information about the Gcc-patches
mailing list