[cfe-dev] lookup from AST

steve naroff snaroff at apple.com
Tue Oct 13 10:50:47 PDT 2009


Hi Axel,

Sema is considered a transient object (whose 'output' is a well-formed  
AST).

The design is oriented toward creating an ASTConsumer. This 'callback'  
interface, combined with ASTContext's "get*" functions (and the  
respective AST's) should do the trick.

Did you try this? If we are missing some functionality in the AST, let  
us know (it is entirely possible that there is some logic that needs  
to move from Sema->AST).

snaroff

On Oct 13, 2009, at 9:04 AM, Axel Naumann wrote:

> Hi,
>
> I need to access reflection gathered from some C++ code, e.g. which
> classes are defined, what data members does class "MyClass" have. My
> naive approach was to parse the source and query the resulting
> ASTContext using Sema, i.e. lookup "MyClass" and walk its decls. But
> Sema is a non-public API, which makes me wonder whether this is the
> right approach.
>
> Is it?
>
> Cheers, Axel.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list