<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Mar 18, 2010, at 9:54 AM, Stefan Seefeld wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Doug,<br><br>thanks for the clarification on invalid source locations. May I assume <br>that whenever the filename is 0, the location corresponds to "builtin", <br>i.e. injected code, preceding the actual source code ?<br></div></blockquote><div><br></div><div>When the filename is 0, it means that the entity you're looking at was implicitly declared by the compiler.</div><br><blockquote type="cite"><div>I'v got a little further now. Using clang_visitChildren() on a file <br>containing "int i;" will report a cursor with kind CXCursor_VarDecl, <br>where the location corresponds to the position after the declarator "i" <br>(and the spelling yields the declarator itself).<br>Is that intended ? </div></blockquote><div><br></div><div>The location should point at the first character of "i".</div><br><blockquote type="cite"><div>I wonder what "VarDecl" stands for, Declarator, or <br>Declaration. If this really reports the declarator, how can I access the <br>(full) declaration. Why is this not directly visited via <br>clang_visitChildren() ?<br></div></blockquote><div><br></div><div>We're pointing at the declaration of the variable "i". </div><br><blockquote type="cite"><div>More generally, what entities does clang_visitChildren() report, and, <br>assuming this is just a subset of the full AST, how may I access the rest ?<br></div></blockquote><div><br></div><div>Everything listed in the CXCursorKind is reported by this API. Not everything in C++ is reported exposed, but it's relatively simple to expose new declaration kinds.</div><br><blockquote type="cite"><div>I'm sorry to come up with all those entry-level questions. Perhaps there <br>is some documentation available, which I haven't found yet.<font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div>The Doxygen documentation is here:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">       <a href="http://clang.llvm.org/doxygen/group__CINDEX.html">http://clang.llvm.org/doxygen/group__CINDEX.html</a></span></div><div><br></div><div>In c-index-test shows how to poke the API.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">     </span>- Doug</div></body></html>