Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » C Variant (keywords) - Indexing
C Variant (keywords) - Indexing [message #229722] Thu, 29 January 2009 16:39 Go to next message
Rob is currently offline RobFriend
Messages: 6
Registered: July 2009
Junior Member
Hi;

First where to post this..is this correct forum?

I am using c/C++ perspective for Keil C51 code. There are variants
in the code that cause functions to be missing in the outline view
and cannot be searched.

How do I modify the C/C++ (or whatever part of Eclipse) to accomodate
keyword variants in the C language (for embedded processors)?

I submitted a lengthy post two days ago with all the gory details but
it was never posted for some reason..(censorship maybe??)

Rob
Re: C Variant (keywords) - Indexing [message #229796 is a reply to message #229722] Fri, 30 January 2009 21:23 Go to previous messageGo to next message
Rob is currently offline RobFriend
Messages: 6
Registered: July 2009
Junior Member
This is my post to the newcomers forum which one fellow points me here.
But I have not had a response so I am adding this to make it more clear
what I am asking help for.

>>>>>>>>>PREV POST ON NEWCOMERS FORMUM>>>>>>>>>>>>>>>>>>>
I am programming for 8051 targets with Keil Compiler. So there are
a number of keywords that are not recognized and indexed by Eclipse.

I want to modify Eclipse so it understands the language variances and
indexes them so the outliner and call heirarchy function properly.

Let me state here, that what the indexer misses does not show up in the
outliner or call heirarchy. For example:

a function prototype for an ISR

void isr_interrupt0(void);

the corresponding function declaration for an ISR (this is KEIL C51!)

void isr_interrupt0(void) interrupt VECTOR12
{
}

So what is seen in the indexer is the prototype (I think because it passes
the ANSI C syntax and I am using a C/C++ perspective)...BUT the
declaration is not shown in the outline view because of the (I believe)
unrecognized keywords or formatting of the function declaration.

Where do I address this issue? Is this done by creating a perspective? Or
is there some underlying indexer stuff that I need to modify...I saw a
video
presentation on the CDT where the guys said the indexer is custom
built...I just dont have a good block diagram of how this all fits
together..Where do I find that?
Re: C Variant (keywords) - Indexing [message #229819 is a reply to message #229796] Sat, 31 January 2009 03:31 Go to previous message
Rob is currently offline RobFriend
Messages: 6
Registered: July 2009
Junior Member
Saw a post in one of the groups that recommended putting a conditional
define in some property page. Instead I put it in a header file like so
and made the keyword variants only defined properly for the embedded
compiler, made them generic for the gnu or cygwin tool chain and now the
code indexes and the call heirarchy view picks up the variants (because
they are now not variants.) the key was to know the define for the indexer
which was given in the post.

So this is a solution for my problem, hope it helps someone else.

#ifdef __CDT_PARSER__
// unsigned char defines
#define UCHARCODEPTR unsigned char *
#define UCHARXDATAPTR unsigned char *
#define UCHARIDATAPTR unsigned char *
#define UCHARDATAPTR unsigned char *
#define UCHARCODE unsigned char
#define UCHARXDATA unsigned char
#define UCHARIDATA unsigned char
#define UCHARDATA unsigned char
// signed char defines
#define CHARCODEPTR char *
#define CHARXDATAPTR char *
#define CHARIDATAPTR char *
#define CHARDATAPTR char *
#define CHARCODE char
#define CHARXDATA char
#define CHARIDATA char
#define CHARDATA char
// unsigned int defines
#define UINTCODEPTR unsigned int *
#define UINTXDATAPTR unsigned int *
#define UINTIDATAPTR unsigned int *
#define UINTDATAPTR unsigned int *
#define UINTCODE unsigned int
#define UINTXDATA unsigned int
#define UINTIDATA unsigned int
#define UINTDATA unsigned int
// signed int defines
#define INTCODEPTR int *
#define INTXDATAPTR int *
#define INTIDATAPTR int *
#define INTDATAPTR int *
#define INTCODE int
#define INTXDATA int
#define INTIDATA int
#define INTDATA int
// unsigned long defines
#define ULONGCODEPTR unsigned long *
#define ULONGXDATAPTR unsigned long *
#define ULONGIDATAPTR unsigned long *
#define ULONGDATAPTR unsigned long *
#define ULONGCODE unsigned long
#define ULONGXDATA unsigned long
#define ULONGIDATA unsigned long
#define ULONGDATA unsigned long
// signed long defines
#define LONGCODEPTR long *
#define LONGXDATAPTR long *
#define LONGIDATAPTR long *
#define LONGDATAPTR long *
#define LONGCODE long
#define LONGXDATA long
#define LONGIDATA long
#define LONGDATA long
// float
#define FLOATCODEPTR float *
#define FLOATXDATAPTR float *
#define FLOATCODE float
#define FLOATXDATA float

#else
// unsigned char defines
#define UCHARCODEPTR unsigned char code *
#define UCHARXDATAPTR unsigned char xdata *
#define UCHARIDATAPTR unsigned char idata *
#define UCHARDATAPTR unsigned char data *
#define UCHARCODE unsigned char code
#define UCHARXDATA unsigned char xdata
#define UCHARIDATA unsigned char idata
#define UCHARDATA unsigned char data
// signed char defines
#define CHARCODEPTR char code *
#define CHARXDATAPTR char xdata *
#define CHARIDATAPTR char idata *
#define CHARDATAPTR char data *
#define CHARCODE char code
#define CHARXDATA char xdata
#define CHARIDATA char idata
#define CHARDATA char data
// unsigned int defines
#define UINTCODEPTR unsigned int code *
#define UINTXDATAPTR unsigned int xdata *
#define UINTIDATAPTR unsigned int idata *
#define UINTDATAPTR unsigned int data *
#define UINTCODE unsigned int code
#define UINTXDATA unsigned int xdata
#define UINTIDATA unsigned int idata
#define UINTDATA unsigned int data
// signed int defines
#define INTCODEPTR int code *
#define INTXDATAPTR int xdata *
#define INTIDATAPTR int idata *
#define INTDATAPTR int data *
#define INTCODE int code
#define INTXDATA int xdata
#define INTIDATA int idata
#define INTDATA int data
// unsigned long defines
#define ULONGCODEPTR unsigned long code *
#define ULONGXDATAPTR unsigned long xdata *
#define ULONGIDATAPTR unsigned long idata *
#define ULONGDATAPTR unsigned long data *
#define ULONGCODE unsigned long code
#define ULONGXDATA unsigned long xdata
#define ULONGIDATA unsigned long idata
#define ULONGDATA unsigned long data
// signed long defines
#define LONGCODEPTR long code *
#define LONGXDATAPTR long xdata *
#define LONGIDATAPTR long idata *
#define LONGDATAPTR long data *
#define LONGCODE long code
#define LONGXDATA long xdata
#define LONGIDATA long idata
#define LONGDATA long data
// float
#define FLOATCODEPTR float code *
#define FLOATXDATAPTR float xdata *
#define FLOATCODE float code
#define FLOATXDATA float xdata

#endif



Cheers,
Rob
Previous Topic:Project does not build under Eclipse CDT but does under MSW
Next Topic:ARM Memory addressing
Goto Forum:
  


Current Time: Fri Apr 26 04:19:57 GMT 2024

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

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

Back to the top