Open aryx opened 3 years ago
To get a dump you need to run clang with the plugin attached:
./facebook-clang-plugins/clang/install/bin/clang \
-Xclang -load -Xclang facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib \
-Xclang -add-plugin -Xclang YojsonASTExporter \
-c examples/hello.c
To read that data from OCaml you can take a look at the clang-ocaml/ directory, which has a README.md, or at how infer does it.
Thx a lot! I think you should put such information in the toplevel README of this project.
I could not find any documentation on how to install and use facebook-clang-plugins and its ocaml library to get a simple AST dump of a c++ program.
Let's say I have this simple c++ program:
void main() { return 1 + 2; }
Which OCaml program do I need to write to access its AST from OCaml?