<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><pre><div><span style="line-height:19.0399990081787px;font-family:Arial">mobi phil, Thanks ! I will use VisitStmt.</span><br></div><div><pre style="line-height:19.0399990081787px">But I have another question:</pre><pre style="line-height:19.0399990081787px">   How to get namespace name of a  function ?</pre><pre style="line-height:19.0399990081787px">if this function is CXXMethodDecl, I  use CXXRecordDecl to get a <span style="line-height:19.0399990081787px">NamespaceDecl  object, then I will get the namespace name.</span></pre><pre style="line-height:19.0399990081787px"><span style="line-height:19.0399990081787px">if this function is a global function, I do not know howto.</span></pre></div></pre></div></blockquote><div><br></div><div>do not know at the moment, but general advice: play with the dynamic matchers and the completion mechanism. That is how I learned a lot about the relationship between objects (nodes) in the AST. There is not too much documentation, but the clang-query or cmatch will tell you a lot about the relationship between AST nodes. </div></div>
</div></div>