[cfe-dev] Is there a tool that restores a previously saved AST?

João Matos ripzonetriton at gmail.com
Mon Jul 8 16:31:01 PDT 2013


On Mon, Jul 8, 2013 at 11:54 PM, Douglas Gregor <dgregor at apple.com> wrote:

> Generating correct Clang ASTs from anything but parsed C++ code is going
> to be extremely complicated. I think you’re better off generating C++
> directly, or simply keeping your language front end separate from Clang.
>

I've done this in a C++/CLI Clang implementation I've been working on. It
generates AST nodes directly from .NET types read from assemblies. I would
not say it was extremely complicated, but definitely tricky. There are a
lot of things that are not obvious and you will only find out about them
when the code crashes inside Clang internals, but if you're not afraid of
debugging it's pretty doable.

In case anyone is interested to look at the code:
https://github.com/tritao/clang/blob/master/lib/Sema/SemaCLI.cpp

-- 
João Matos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130709/04d6f9e3/attachment.html>


More information about the cfe-dev mailing list