<div dir="ltr"><span style="color:rgb(80,0,80);font-size:12.8px">On Fri, Mar 17, 2017 at 2:16 AM, Nestal Wan <</span><a href="mailto:me@nestal.net" style="font-size:12.8px">me@nestal.net</a><span style="color:rgb(80,0,80);font-size:12.8px">> wrote:</span><br style="color:rgb(80,0,80);font-size:12.8px"><span style="color:rgb(80,0,80);font-size:12.8px">> Thanks, Adi! Do you mean that CXCursor_TypeRef is a child under the</span><br style="color:rgb(80,0,80);font-size:12.8px"><span style="color:rgb(80,0,80);font-size:12.8px">> CXCursor_CXXBaseSpecifier?</span><div><div class="gmail_extra"><br></div><div class="gmail_extra"><span style="font-size:12.8px"></span>Yes, that's right. `CXCursor_TypeRef` is going to be a child of `CXCursor_CXXBaseSpecifier` cursor.<div><br></div><div>But I would advise you to make yourself a big favor and write a simple AST traversal function which dumps _all_ the information you can extract from cursors. Clang built-in AST dump is a good one but does not contain every bit of information which might be quite important while you're debugging or developing a new specific use-case which, for example, is not covered by libclang API. Given you have such debugging tool you would immediately see that `CXCursor_TypeRef`s are descendants of `CXCursor_CXXBaseSpecifier` cursors as well as many other similar details for other use-cases.</div><div><br></div><div>I've developed such debugging tool for myself and you can have a look at it to get some inspiration:</div><div>    * <a href="https://github.com/JBakamovic/yavide/blob/clang_indexer/core/services/parser/clang_parser.py#L332">https://github.com/JBakamovic/yavide/blob/clang_indexer/core/services/parser/clang_parser.py#L332</a></div><div><br></div><div><span style="color:rgb(80,0,80);font-size:12.8px">On Fri, Mar 17, 2017 at 3:01 AM, Michael <</span><a href="mailto:redm@gmx.de" style="font-size:12.8px">redm@gmx.de</a><span style="color:rgb(80,0,80);font-size:12.8px">> wrote:</span><br style="color:rgb(80,0,80);font-size:12.8px"><span style="color:rgb(80,0,80);font-size:12.8px">> Well, at least for me it didn't really help, it did not do what I would have</span><br style="color:rgb(80,0,80);font-size:12.8px"><span style="color:rgb(80,0,80);font-size:12.8px">> expected it to do... i.e. return the specialized versions of the template,</span><br style="color:rgb(80,0,80);font-size:12.8px"><span style="color:rgb(80,0,80);font-size:12.8px">> "RecursiveBase<Base>" and more importantly it's base "Base" in your example.</span><br></div><div><br></div><div>How come? This is the AST representation of that piece of code (reads as CursorKind : CursorSpelling):</div><div><br></div><div><span style="font-size:12.8px">|-`</span><span style="font-size:12.8px">CXCursor_</span><span style="font-size:12.8px">ClassDec</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">l`:</span><span class="gmail-im" style="font-size:12.8px"> 'Derived'</span></div><div><span style="font-size:12.8px">|</span><span style="font-size:12.8px">   </span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">|-`CXCursor_CXXBaseSpecifier`: 'RecursiveBase<class Base>'</span></div><div><span style="font-size:12.8px">|    </span><span style="font-size:12.8px">   </span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">|-`CXCursor_TemplateRef`: 'RecursiveBase'</span></div><div><span style="font-size:12.8px">|       </span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">|-`CXCursor_TypeRef`: 'class Base'</span></div><div><span style="font-size:12.8px">|</span><span style="font-size:12.8px">   </span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">|-`CXCursor_CXXBaseSpecifier`: 'class Base2'</span></div><div><span style="font-size:12.8px">|    </span><span style="font-size:12.8px">  </span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">|-`CXCursor_TypeRef`: 'class Base2'</span></div><div><span style="font-size:12.8px">|</span><span style="font-size:12.8px">   </span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">|-`CXCursor_CXXBaseSpecifier`: 'class Base3'</span></div><div><div><span style="font-size:12.8px">|    </span><span style="font-size:12.8px">   </span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">|-`CXCursor_TypeRef`: 'class Base3</span><span style="font-size:12.8px">'</span></div></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Cheers,</span></div><div><span style="font-size:12.8px">Adi</span></div></div></div></div>