[cfe-dev] Clang tutorial

moataz ragab mtzrgb at gmail.com
Wed May 20 14:37:38 PDT 2009


I am basically 10 days ahead of you. I have modified the tutorial files from
amnoid.de.
You can also go through Steve Naroff presentations at Clang website. if you
are looking into AST traversal you have to look into ASTConsumers especially
the ASTdumper is a good example. If you are looking for rewriting you can
look at the ObjC rewriter.
You can use the file that Eli sent or modify clang-cc top level to act as
your top level.
Clang relies on llvm command line interface to parse command line arguments.
which you can easily extend to parse your specific switches.

The doxygen documentation will be useful as you go on.

Have fun.

Moataz

On Wed, May 20, 2009 at 9:41 AM, Simone Pellegrini <
spellegrini at dps.uibk.ac.at> wrote:

> Hi everyone,
> is there any clang tutorial which explain how to embed the parser into
> another C/C++ program?
>
> I started with this: http://amnoid.de/tmp/clangtut/tut.html
>
> but with the new build of Clang my program doesn't work anymore because
> it cannot no longer parse some headers!


>
> I guess the best option is to have a look to clang-cc.cpp but it's
> rather huge, is there any stripped version?
>
> thanks, Simone
> _______________________________________________
> 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/20090520/68bf79f1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PPContext.h
Type: text/x-chdr
Size: 1373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090520/68bf79f1/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tut01_pp.cpp
Type: text/x-c++src
Size: 112 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090520/68bf79f1/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tut02_pp.cpp
Type: text/x-c++src
Size: 803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090520/68bf79f1/attachment-0001.cpp>


More information about the cfe-dev mailing list