Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » External #define -> indexer
External #define -> indexer [message #989848] Sat, 08 December 2012 12:55 Go to next message
Martin CS is currently offline Martin CSFriend
Messages: 2
Registered: December 2012
Junior Member
Hi!

In my project we are using a custom configuration system (in its own modularized non-C language) that is parsed before, and creates the configuration for, the build of C (etc.). One of the aspects of this is that it passes #defines to the C-build process, which thus are not available prior to the parsing of the configuration and influences the C-code used.

This means that the indexer will not work correctly, since it is lacking information (the external defines). You could basically view it as a set of per-file -D passed on the command line to the compiler.

An intermediate step is that the parsed per-file -D are all put inside a standard makefile. This is created by the "build" (parsing) of the configuration prior to starting the C-build which depends on the configuration.

I would like to create a solution that correctly handles the indexing and thus if anyone could give me a few pointers on where to look or even sketch out how and what to hook in where, I will highly appreciate it.

I see two possibilities:
1) base it on the makefile
2) full fledged parser of custom configuration and hooking it into CDT

The first one is easier and would just require an initial invocation of the first step in the build process, but it will not be able to adapt automatically to changes in the configuration code itself during editing.

The second one is cooler.

I have no idea where to begin with any of these two options. I have never developed for Eclipse before, but I do develop with Eclipse every day.

Also if you know of any similar efforts, projects or threads then please do tell me!

Thanks alot,
Martin
Re: External #define -> indexer [message #1000242 is a reply to message #989848] Mon, 14 January 2013 10:40 Go to previous messageGo to next message
Martin CS is currently offline Martin CSFriend
Messages: 2
Registered: December 2012
Junior Member
Bump! Smile
Re: External #define -> indexer [message #1000331 is a reply to message #989848] Mon, 14 January 2013 14:40 Go to previous message
Andrew Gvozdev is currently offline Andrew GvozdevFriend
Messages: 257
Registered: July 2009
Senior Member
Martin CS wrote on Sat, 08 December 2012 07:55

I see two possibilities:
1) base it on the makefile

Parsing of most non-trivial makefiles would be difficult.
You could be better off parsing the build output. Can you produce a log with "gcc -D... -I... file.c"? Build Output Parser in CDT can parse that.
Quote:

2) full fledged parser of custom configuration and hooking it into CDT

Are you into eclipse plugin development with CDT? That should not be difficult but you'll need at least basic experience on developing eclipse plugins.

Thanks,
Andrew
Previous Topic:CDT uninstalls itself on startup!
Next Topic:Add new source files programmatically
Goto Forum:
  


Current Time: Fri Apr 26 04:23:04 GMT 2024

Powered by FUDForum. Page generated in 0.03629 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top