<html>
<head></head>
<body>
<p>Hi,</p>
<p>I'm newbie using ASTMatchers and I'm trying to learn little by little how to use them.</p>
<p>I was basing on the matcher <span class="pre" style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">recordDecl(hasName("Foo"),</span><span style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify; background-color: #e2e2e2;"> </span><span class="pre" style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">isDerivedFrom("Bar")) </span>shown in <a href="http://clang.llvm.org/docs/LibASTMatchers.html">http://clang.llvm.org/docs/LibASTMatchers.html</a> trying to include new features. For instance, I tried to look for classes which have at least one virtual method:</p>
<p><span class="pre" style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">recordDecl(hasName("Foo"),</span><span style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify; background-color: #e2e2e2;"> </span><span class="pre" style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">isDerivedFrom("Bar"), hasMethod(isVirtual()))</span></p>
<p>Or I tried to match protected overriden methods:</p>
<p><span class="pre" style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">methodDecl(allOf(isProtected(), isOverride()</span><span class="pre" style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">);</span></p>
<p>But neither of them worked as it couldn't find "isOverride" and "isVirtual" identifiers. I was trying a lot of combinations, but I can't understand this well.</p>
<p>Finally, I tried to look for the the default constructor of a certain class:</p>
<p><span class="pre" style="color: #333333; font-family: monospace; font-size: 12px; line-height: 17px; text-align: justify;">constructorDecl(hasName("Foo"), isDefaultConstructor())</span></p>
<p>but this is wrong. What I'm doing bad? Please, any information you give me will be fine to me to understand how to use matchers.</p>
<p>Thanks in advance,</p>
<p>Pedro.</p>
<br/>
</body>
</html>