It works, thx a lot !!<br><br><div class="gmail_quote">2013/1/11 Philip Craig <span dir="ltr"><<a href="mailto:philipjcraig@gmail.com" target="_blank">philipjcraig@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 11 January 2013 15:08, huang jun wen <<a href="mailto:kassarar@gmail.com">kassarar@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I'm new to libclang, recently I wrote a program for testing parsing,<br>
> basically it output the ast to stdout. But when I run it over some source<br>
> file, there are some statements missing? I can't figure out what happened.<br>
> The question was originally posted at stackoverflow, but no reply until now<br>
> :) Can any one give me some hints? Thanks very much.<br>
><br>
> The problem's link:<br>
> <a href="http://stackoverflow.com/questions/14250754/libclang-missing-some-statements-in-the-ast" target="_blank">http://stackoverflow.com/questions/14250754/libclang-missing-some-statements-in-the-ast</a><br>
<br>
</div></div>The problem is that parsing is failing due to missing a stddef.h, so<br>
the lines that fail to parse aren't in the AST. I can get it to work<br>
on my system by running it like this:<br>
<br>
./parse_ast -I/usr/local/bin/../lib/clang/3.3/include tt.c<br>
<br>
There is some info on this at<br>
<a href="http://clang.llvm.org/docs/LibTooling.html#builtin-includes" target="_blank">http://clang.llvm.org/docs/LibTooling.html#builtin-includes</a>. This<br>
problem comes up a lot, so you could also search the list archive for<br>
stddef.h for more discussion of it.<br>
</blockquote></div><br>