Hello Dmitri, <div><br></div><div>Thank you for your answer. Although I didn't tell, I was already able to generate the output of the astdumper to a file (without using the flag, just reusing the AstDumper class) when building through Xcode. I understand that the output is irregular, but I plan to eventually modify the dumper according to my needs to make the output usable.</div><div><br></div><div>Also, I will take a deeper look at SourceKit. It seems to be the correct way to do it. Thank you very much for the tip.<br><br>Thanks,</div><div>Marcel</div><div><br>Em domingo, 28 de agosto de 2016, Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>> escreveu:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Aug 24, 2016 at 10:27 AM, Marcel Rebouças <<a href="javascript:;" onclick="_e(event, 'cvml', 'swift-dev@swift.org')">swift-dev@swift.org</a>> wrote:<br>
> Hello everybody,<br>
><br>
> I am planning in doing some research and analysis with the ASTs of swift<br>
> programs and, for that reason, I am trying to modify the compiler to always<br>
> generate a file with the contents of the -dump-ast flag when building a<br>
> project.<br>
<br>
Hi Marcel,<br>
<br>
dump-ast format is not machine-parseable. It was never designed to be<br>
such (so it is irregular), and it will change in incompatible ways in<br>
future. And of course '-dump-ast' is not a publicly documented<br>
compiler flag, so it can go away at any point, for example, it can be<br>
removed from compilers built as public releases to save code size.<br>
<br>
If you want to (eventually) use your tool in a production environment,<br>
you should consider building your tool on top of SourceKit, possibly<br>
extending SourceKit along the way.<br>
<br>
Dmitri<br>
<br>
--<br>
main(i,j){for(i=2;;i++){for(j=<wbr>2;j<i;j++){if(!(i%j)){j=0;<wbr>break;}}if<br>
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="javascript:;" onclick="_e(event, 'cvml', 'gribozavr@gmail.com')">gribozavr@gmail.com</a>>*/<br>
</blockquote></div>