<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 16, 2011, at 2:46 AM, Michael Lehn wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,<br><br>I am working on a little documentation tool for C++.   For this I need<br>to parse C++ files to some degree.  For this purpose I want to extract<br>from source/header files what function signature gets defined/declared<br>in what line.  <br><br>I figured out that all I need can be done perfectly with ast-print-xml as long<br>as functions and classes are not templated.<br><br>So for clang-developers this question might sound stupid:  Is this technically<br>not possible.  I mean is the information I am looking for "not in the AST"? Or<br>does the ast-print-xml just skip certain template-nodes?<br><br>Just to make sure that I make clear what I am looking for.  If I have a code like<br><br>template <typename T><br>    int<br>    dummy(const T a);<br><br>// ....<br><br>template <typename T><br>int<br>dummy(const T a)<br>{<br>    // ...<br>}<br><br>I merely would like to extract the information:<br><br>1)  Funktion "template <typename T>  int dummy(const T a)" declared in line ...<br>2)  Funktion "template <typename T>  int dummy(const T a)" defined in line ...<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>The AST has all of this information, but the XML printer isn't anywhere near complete and isn't kept up-to-date. Personally, I wouldn't use it: I think you're better off using libclang, writing a Clang plugin, or extending/customizing something like Synopsis.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">   </span>- Doug</div></body></html>