[cfe-dev] How to pretty print the abstract syntax tree for a C source file?

Simon simonhf at gmail.com
Tue Aug 23 12:04:16 PDT 2011


Thanks for the link, Ehsan. Looks like an interesting example of
programmatically dumping the clang AST. I'll take a look. -- Simon


On Tue, Aug 23, 2011 at 11:50 AM, Ehsan Akhgari <ehsan.akhgari at gmail.com>wrote:

> You can also look at viewsource <https://github.com/jcranmer/viewsource>,
> written by Joshua.
>
> --
> Ehsan
> <http://ehsanakhgari.org/>
>
>
> On Tue, Aug 23, 2011 at 1:16 PM, Simon <simonhf at gmail.com> wrote:
>
>> I am trying to find a tool that will parse and tell me information about a
>> C source file in a verbose manner which I can digest and use in a script I
>> am writing. The closest I have come so far using gcc to generate debug info
>> and then extract the debug info and parse that. However, what I'd prefer is
>> a tool which lets me get at similar debug info (although obviously not
>> memory offsets etc) *without* having to compile the C source code into
>> object files. I know that clang has been re-written from scratch to be a lot
>> more flexible than gcc. Does anybody in this list know how I could use clang
>> (or another tool) to obtain such debug info without compiling all the way?
>> Thanks, Simon
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110823/f06fdafe/attachment.html>


More information about the cfe-dev mailing list