Open flavorjones opened 8 years ago
Blah. I thought there was a way to dump the AST as XML, but apparently that option was removed. Looks like there's a way to get graphviz representation, but that requires clang to be built in a special way. Seems like option 2 is the most portable way to go.
ffi-clang can't access any of the C++ API of libclang, and as a result we can't actually access all the information we need to build
Sexp
s for the AST.One example is the opcode for a
BinaryOperator
.We need to come up with an alternative. Two ideas come to mind:
1. read the output from
clang -Xclang -ast-dump -fsyntax-only foo.c
, which looks like:2. write a C++ extension that accesses libclang for only the bare minimum necessary to generate an AST.
Would love anyone's thoughts.