This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch] PR 4093


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]