[cfe-dev] Mapping Clang C code AST to Code

Carlos Andrade carlosviansi at gmail.com
Fri Jun 15 11:58:15 PDT 2012


I am interested on seeing this sort of information on the tree. Do you believe it would be hard to implement this given what information the other parts that already exist get the tree? I could contribute to it. Few pointers where to look into the source would be very appreciated.

Specifically I want to see code lines and the values of operators etc. 

Best,

--
Carlos Andrade
http://carlosandrade.co

Sent from my iPhone. 

On 15/06/2012, at 10:20, Douglas Gregor <dgregor at apple.com> wrote:

> 
> On Jun 13, 2012, at 9:28 AM, Carlos Andrade wrote:
> 
>> Hi,
>> 
>> I have been trying without much success figuring a way to map the -ast-view from Clang cc1 option to code, and --ast-dump-XML as well. Is this possible? If so, how?
>> 
>> Please let me know if this is the wrong list to post this.. 
> 
> 
> Neither of these is directly possible. The AST-printing facilities do not print well-formed code, and the XML dumps are both incomplete and not necessarily well structured for anything other than debugging the compiler. That's why both options are hidden behind the compiler's internal -cc1 interface.
> 
> What are you actually trying to accomplish?
> 
>    - Doug




More information about the cfe-dev mailing list