[cfe-dev] Using the Clang AST to generate other abstract models
Guy Sherman
guy at guysherman.com
Sun Jun 29 02:17:08 PDT 2014
Hi There,
I’m new to this list and new to mucking around with compilers, so I crave your indulgence.
There is a suite of tools called Moose Tools (http://www.moosetechnology.org/), which is somewhat like a Business Intelligence platform for codebases. You convert a codebase to a model of that codebase, and then you can build queries on top of that mode, and visualisations on top of those queries. The models are called an “MSE” file, and they seem similar to an AST.
So anyway, there are reasonably good tools to import codebases from java, smalltalk, etc, but nothing that I’ve tried for C/C++ seems to do the job. So, I did a little bit of reading about Clang and LLVM, and have been wanting to try using the Clang front-end but instead of spitting out LLVM IR I want to generate an MSE file. I had a look at the output from the AST-dump mode of Clang and it looks like the data would be suitable, I could probably write a python script to parse that output and convert it, but I would rather do it properly.
I’m not sure of the right approach though… I could start hacking on the AST-dump mode, but I imagine that this is not something that you would ever want to keep in the CFE codebase. So, is there some guidance somewhere, on putting together the minimal subset of the CFE that I would need in order to be able to dump the AST? Or should I just fork CFE and start from there?
Many thanks,
Guy Sherman.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140629/c95d6513/attachment.html>
More information about the cfe-dev
mailing list