Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] How to get definition of a declaration that is in a header file.

> I generally use Binding.getDefn() if the type of binding is CPPCLasstype 
> But, if the definition is outside, then what I get  
> is org.eclipse.cdt.internal.core.pdom.dom.cpp.PDOMCPPClassType and this  
> has no getDefn(). 
> Basically , its a struct definition node and I want to get it 

CDT does not keep ASTs for files in the index. It creates an AST for a file during indexing, saves information from the AST into the index, and then discards the AST.

Therefore, you have two options:
  1) Get the information you want from the index.
  2) Re-parse the header file to get an AST for it.

Depending on what it is exactly you want to do, one or the other may be more appropriate.


Back to the top