This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Plugify Objective-C++ parser bits
On Mon, 14 Feb 2011, Nicola Pero wrote:
> But I was also intrigued by Mike's idea of parsing plugins. Allowing people
> to change or experiment with the parser is an interesting idea. :-)
>
> On the other hand, if we do it, it makes sense to do it properly, as you say,
> using "real" hooks or "callbacks" so that you can use your own stock GCC,
> without having to recompile it, and load a plugin at runtime that will add
> (or remove ?) support for some syntax to C/ObjC/C++/ObjC++.
Sure, the basic idea of plugins here makes sense. But:
* It needs some sort of public design discussion or explanation of the
design used. (It's possible that being able to implement ObjC++ as a
plugin could be part of the rationale for the design - having a use case
is certainly considered desirable when adding plugin hooks.)
* It's not safe to add in Stage 4.
* We're moving away from macros where possible; functions are better, and
required if you want to be able to load a plugin at runtime that affects
syntax.
* We prefer standard language and library features to things that are
GCC-specific where reasonable, to make GCC internals more accessible to
new developers (one aim of moving to C++ as implementation language is to
be able to use standard C++ language and library features in various
places where there are GCC-specific emulations using macros); aesthetics
aren't enough justification for a new syntax for line-continuation in
macros and a GCC-specific preprocessor (especially since the preferred
solution is to replace long macros by proper hooks using functions).
--
Joseph S. Myers
joseph@codesourcery.com