Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Towards a more language neutral CDT

Hello Craig,

Glad to see the multi-language ball is still rolling!

> We in the Parallel Tools Project (PTP) are interested in
> supporting Fortran and so we have an interest in helping
> to make CDT more language neutral.  This will make it
> easier for us to leverage off from the very nice work in CDT.
> As a first step, we would like to suggest a mechanism for
> abstracting out access to the singleton CCorePlugin object.
> There are roughly 170 calls to the static method,
> CCorePlugin.getDefault(), which is the entry point into much
> of the language model.
>  From our first experience with building FDT (Fortran Development
> Tools), pretty much just a straight copy of CDT, we have
> noticed that CCorePlugin.getDefault is a major stumbling block
> for a language neutral layer.
> So how about this for a straw dog proposal:
> 1. Create a language neutral CorePlugin class, (or LangCorePlugin)
> that CCorePlugin and FortranCorePlugin can inherit from.
> 2. Add a static method, CorePlugin.setDefault(), that allows the default
> to be changed at runtime, depending on context.  Or maybe a better
> way would be to leave default alone (default is still CCorePlugin) and
> add set/getCurrent().

If FDT & CDT are expected to live side by side, active in the same workspace,
even w/natures added to the same project, setDefault() is not going to work.
It's one huge race condition waiting to happen.  

The rationale behind having a singleton (like the ResourcesPlugin) for our Core
and UI is that we had thought that there wasn't a need for this to be extensible.
What would make more sense (to me, at least) is that perhaps all of the static
registries that are assuming that everything is CNature/CPPNature should take an
additional parameter (a nature, perhaps) that would serve as a key into a table of sorts.

That being said, we need to decide as to how the extension architecture is going to look.
Does FDT register another language/nature into the CDT or does FDT plan to clone/own the CDT's
structure and thus wants some base classes to start out with?  



Back to the top