Getting ahold of Pound Defines (#define) [message #219910] |
Mon, 21 July 2008 14:59  |
Eclipse User |
|
|
|
Originally posted by: gang.xu.delphi.com
So I've written a function parser that will identify input and output
variables given a string (like body of a function), and I have added
support for ignoring commented out code.
Pound defines, however, are a different problem entirely. Where and how,
in the CDT model, can I find the pound defines?
I tried looking in the IASTDeclaration[] array obtained from a CFile as an
ITranslationUnit, but it was not there (only variable and function
definitions).
ITranslationUnit cFile = (ITranslationUnit)elem;
//try this code:
IASTDeclaration[] decl = cFile.getAST().getDeclarations();
So, I'm wondering-how the heck do I find these pound defines so I know
when to filter them out?
|
|
|
Re: Getting ahold of Pound Defines (#define) [message #220378 is a reply to message #219910] |
Thu, 24 July 2008 09:56  |
Eclipse User |
|
|
|
Dan Xu wrote:
> So I've written a function parser that will identify input and output
> variables given a string (like body of a function), and I have added
> support for ignoring commented out code.
>
> Pound defines, however, are a different problem entirely. Where and how,
> in the CDT model, can I find the pound defines?
>
> I tried looking in the IASTDeclaration[] array obtained from a CFile as
> an ITranslationUnit, but it was not there (only variable and function
> definitions).
>
> ITranslationUnit cFile = (ITranslationUnit)elem;
> //try this code:
> IASTDeclaration[] decl = cFile.getAST().getDeclarations();
>
> So, I'm wondering-how the heck do I find these pound defines so I know
> when to filter them out?
>
How about
org.eclipse.cdt.core.dom.ast.IASTTranslationUnit.getAllPrepr ocessorStatements()?
--
Anton Leherbauer
Wind River Systems, Austria
CDT Committer - http://www.eclipse.org/cdt
DSDP/DD Committer - http://www.eclipse.org/dsdp/dd
|
|
|
Powered by
FUDForum. Page generated in 0.14109 seconds