I’m new to libclang, recently I wrote a program for testing parsing, basically it output the ast to stdout. But when I run it over some source file, there are some statements missing? I can’t figure out what happened. The question was originally posted at stackoverflow, but no reply until now Can any one give me some hints? Thanks very much.
The problem’s link: http://stackoverflow.com/questions/14250754/libclang-missing-some-statements-in-the-ast
The problem is that parsing is failing due to missing a stddef.h, so
the lines that fail to parse aren't in the AST. I can get it to work
on my system by running it like this:
./parse_ast -I/usr/local/bin/../lib/clang/3.3/include tt.c
There is some info on this at
problem comes up a lot, so you could also search the list archive for
stddef.h for more discussion of it.
It works, thx a lot !!
2013/1/11 Philip Craig <email@example.com>
you might want to add some error handling, see page 15: