Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Parsing Objective C syntax in a header file

On Thu, Jul 9, 2009 at 3:09 PM, Mike Kucera<mkucera@xxxxxxxxxx> wrote:
> So to get this to work properly for Objective C you need that information in
> the index, which I'm guessing is not available at the moment.

No, not yet. We've got an ADT being parsed, but I don't know what
step(s) are needed to then move it to being indexed. As there are some
items which are concepts new to CDT (message sends, protocol
references, categories etc.) I imagine some additions would need to be
made to the closed-set world of the CDT's PDom indexer. The
alternative would be to write our own indexer?

> Otherwise you may need an Objective C project type.

We've got a project nature that identifies the project as an objective
c one - is that helpful? Unfortunately the CDT code tends to assume
that "c && ! c++ => c" and "c && c++ => c++" in the natures. It would
really be good to have a 'base c' nature that 'vanilla c' and 'c++'
could both extend, as well as avoiding such hard-coded methods as
isCLangauge() and IsCppLanguage() ...

> As a work around you can use the language mappings to force the language. Go
> to the project properties and choose C/C++ General > Language Mappings, then
> pick Objective C for the C header content type.

I tried that, but it didn't seem to have any effect. I may have found
a bug in my system or I may have corrupted my workspace. I'll try and
find out which.

> Language mappings can also be set up programatically using the LanguageManager,
> for example the new UPC project wizard maps .c files to the UPC language.

That sounds like something I could hook in for the Objecitve C wizard
fairly easily and in advance of finding a better solution. Can you
point me to the CVS location or source where that happens? I'm
unfamiliar with the UPC project(s).

Alex


Back to the top