Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Parsing snippet of C (macro definitions)
Parsing snippet of C (macro definitions) [message #917536] Thu, 20 September 2012 07:12
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 190
Registered: July 2009
Location: Dublin
Senior Member

Hi,
I would like to parse the definition of macros to try to understand what they contain and categorize them. For example:

#define A 123
#define B "hello"

would be categorized as constant while

#define C 23*A

would be an expression, and so on.

I have learned ho to use CDT to parse entire files and I was wondering if it possible to use the same API to parse just a snippet of C code, so to recognize that 123 is an integer literal. Maybe I could trick the API surrounding the expression with a dummy function and assigning the value to a variable but I would try to avoid that. Any suggestion?


Previous Topic:Config complicated options in CDT Manage Build
Next Topic:Eclipse and FFTW
Goto Forum:
  


Current Time: Sat Oct 05 15:54:26 GMT 2024

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

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

Back to the top