<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font size="+1">My first choice was using libClang after reading
the document, but when I realized that the limitation of
libClang--unable to get the content of a node easily, my
preference shifts to using libTooling.<br>
</font></p>
<pre class="moz-signature" cols="72">Love,
Lou
</pre>
<div class="moz-cite-prefix">On 10/31/18 4:20 AM, Jacob Carlborg via
cfe-dev wrote:<br>
</div>
<blockquote type="cite" cite="mid:prae9o$bnt$1@blaine.gmane.org">On
2018-10-30 05:15, Lou Wynn via cfe-dev wrote:
<br>
<blockquote type="cite">That's what I guessed. But my purpose is
doing source-to-source translation. I'm not sure if I should use
libclang and your previously suggested method to do it, or use
libTooling to directly get AST nodes. To me, the second method
seems easier to get the content of a node.
<br>
<br>
Any suggestions? Which way do you prefer if you were translating
the source to another language?
<br>
</blockquote>
<br>
I have a a tool that converts C and Objective-C headers to D
modules [1] using libclang. It's written in D so libclang is the
best choice for me. I suggest you have a look at this page [2]
which compares the different ways of using Clang when building
tools.
<br>
<br>
[1] <a class="moz-txt-link-freetext" href="http://github.com/jacob-carlborg/dstep">http://github.com/jacob-carlborg/dstep</a>
<br>
[2] <a class="moz-txt-link-freetext" href="https://clang.llvm.org/docs/Tooling.html">https://clang.llvm.org/docs/Tooling.html</a>
<br>
<br>
</blockquote>
</body>
</html>