<div dir="ltr"><div class="gmail_default" style="font-size:small">I checked in the AST Matcher Ref doc I generated from my build tree, then either there is a doc problem, or I don't understand how to use findAll (however Matcher<T> Matcher actually mean any matcher, then any place).</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">PS.: Perhaps I'll create a doc bug for it ...??</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="color:rgb(100,100,100);font-size:14.0014px"><span style="font-size:14.0028px"><font face="monospace, monospace">*-=-=-=-=-*</font></span></div><div style="color:rgb(100,100,100);font-family:Arial;font-size:14.0014px"><span style="font-size:14.0028px">Rémi COHEN-SCALI<b> - Direction Technique </b><a href="http://jayacode.fr/" style="font-weight:bold" target="_blank">Jayacode</a></span><br style="font-size:14.0028px"></div><div style="padding:5px 0px"><a style="color:rgb(141,141,141);font-family:Arial;font-size:13px" href="http://tel+33%20665%20964%20182" target="_blank">+33 665 964 182</a> <span style="color:rgb(69,102,142);font-family:Arial;font-size:13.0013px;display:inline-block">|</span><font color="#8d8d8d" face="Arial"><span style="font-size:13px"> </span></font><span style="color:rgb(141,141,141);font-family:Arial;font-size:13.0013px;display:inline-block"><span style="font-size:13.0026px">Skype: </span></span><span style="text-align:initial;background-color:transparent"><font color="#8d8d8d" face="Arial"><span style="font-size:13.0026px">remi.cohen-scali</span></font></span></div><div style="color:rgb(100,100,100);font-family:Arial;font-size:14.0014px;margin-top:5px"><table style="font-size:14.0028px;border-collapse:collapse;background-color:transparent" border="0" cellspacing="0" cellpadding="0"><tbody style="font-size:14.0042px"><tr style="font-size:14.0056px;padding-top:10px"><td style="font-size:14.007px;padding:0px 5px 0px 0px;text-align:center" align="left"><a href="https://www.linkedin.com/in/remicohenscali/" style="color:rgb(0,191,232);font-size:14.0084px;background-color:transparent" target="_blank"><img src="https://s3.amazonaws.com/images.wisestamp.com/social_icons/square/linkedin.png" style="font-size:14.0098px;border:0px;vertical-align:initial;border-radius:0px;width:16px;height:16px" width="16" height="16"></a></td><td style="font-size:14.007px;padding:0px 5px 0px 0px;text-align:center" align="left"><a href="https://twitter.com/CohenScaliRemi" style="color:rgb(0,191,232);font-size:14.0084px;background-color:transparent" target="_blank"><img src="https://s3.amazonaws.com/images.wisestamp.com/social_icons/square/twitter.png" style="font-size:14.0098px;border:0px;vertical-align:initial;border-radius:0px;width:16px;height:16px" width="16" height="16"></a> <a href="https://beta.doodle.com/rcohenscali" style="background-color:transparent;color:rgb(0,191,232);font-size:14.0084px" target="_blank"><img src="https://beta.doodle.com/dist/i/b44327677e7590e22fb6e598d6d53e2b.ico"></a></td></tr></tbody></table><br></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">2017-10-11 8:26 GMT+02:00 Rémi Cohen-Scali <span dir="ltr"><<a href="mailto:remi@jayacode.fr" target="_blank">remi@jayacode.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Ok got it! I found my error.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">However the findAll matcher is not recognized then is it possible to use it, Is there some restrictions (that are not in AST Matchers ref) ?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">For the little story, the correct matcher for getting all results is something as:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">binaryOperator(hasAncestor(<wbr>functionDecl(hasName("f"))),<wbr>hasOperatorName("=")).bind("<wbr>binop")</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">With it I got all binary ops, actually what the matcher is looking for :)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_1614641467301130506gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="color:rgb(100,100,100);font-size:14.0014px"><span style="font-size:14.0028px"><font face="monospace, monospace">*-=-=-=-=-*</font></span></div><div style="color:rgb(100,100,100);font-family:Arial;font-size:14.0014px"><span style="font-size:14.0028px">Rémi COHEN-SCALI<b> - Direction Technique </b><a href="http://jayacode.fr/" style="font-weight:bold" target="_blank">Jayacode</a></span><br style="font-size:14.0028px"></div><div style="padding:5px 0px"><a style="color:rgb(141,141,141);font-family:Arial;font-size:13px" href="http://tel+33%20665%20964%20182" target="_blank">+33 665 964 182</a> <span style="color:rgb(69,102,142);font-family:Arial;font-size:13.0013px;display:inline-block">|</span><font color="#8d8d8d" face="Arial"><span style="font-size:13px"> </span></font><span style="color:rgb(141,141,141);font-family:Arial;font-size:13.0013px;display:inline-block"><span style="font-size:13.0026px">Skype: </span></span><span style="text-align:initial;background-color:transparent"><font color="#8d8d8d" face="Arial"><span style="font-size:13.0026px">remi.cohen-scali</span></font></span></div><div style="color:rgb(100,100,100);font-family:Arial;font-size:14.0014px;margin-top:5px"><table style="font-size:14.0028px;border-collapse:collapse;background-color:transparent" border="0" cellspacing="0" cellpadding="0"><tbody style="font-size:14.0042px"><tr style="font-size:14.0056px;padding-top:10px"><td style="font-size:14.007px;padding:0px 5px 0px 0px;text-align:center" align="left"><a href="https://www.linkedin.com/in/remicohenscali/" style="color:rgb(0,191,232);font-size:14.0084px;background-color:transparent" target="_blank"><img src="https://s3.amazonaws.com/images.wisestamp.com/social_icons/square/linkedin.png" style="font-size:14.0098px;border:0px;vertical-align:initial;border-radius:0px;width:16px;height:16px" width="16" height="16"></a></td><td style="font-size:14.007px;padding:0px 5px 0px 0px;text-align:center" align="left"><a href="https://twitter.com/CohenScaliRemi" style="color:rgb(0,191,232);font-size:14.0084px;background-color:transparent" target="_blank"><img src="https://s3.amazonaws.com/images.wisestamp.com/social_icons/square/twitter.png" style="font-size:14.0098px;border:0px;vertical-align:initial;border-radius:0px;width:16px;height:16px" width="16" height="16"></a> <a href="https://beta.doodle.com/rcohenscali" style="background-color:transparent;color:rgb(0,191,232);font-size:14.0084px" target="_blank"><img src="https://beta.doodle.com/dist/i/b44327677e7590e22fb6e598d6d53e2b.ico"></a></td></tr></tbody></table><br></div></div></div></div></div></div></div></div></div></div><div><div class="h5">
<br><div class="gmail_quote">2017-10-10 22:41 GMT+02:00 Rémi Cohen-Scali <span dir="ltr"><<a href="mailto:remi@jayacode.fr" target="_blank">remi@jayacode.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi<br><br>I encounter a weird behavior on AST matchers and I'd like to ear what U think of it.<br>Let get a test file<br><br>void f()<br>{<br> int a, b, c, d;<br> a = 1;<br> b = 2;<br> c = 3;<br> d = 4;<br>}<br><br>Then query the decl matcher: <br>functionDecl(hasName("f"),hasB<wbr>ody(hasDescendant(binaryOperat<wbr>or(hasOperatorName("=")).bind(<wbr>"binop"))))<br><br>I got only the first assignmen<div class="gmail_default" style="font-size:small;display:inline">t (was expecting to get all of them).</div><div class="gmail_default" style="font-size:small;display:inline"></div><div class="gmail_default" style="font-size:small;display:inline"></div><div class="gmail_default" style="font-size:small;display:inline"></div><div class="gmail_default" style="font-size:small;display:inline"></div><br>I tried to add the findAll matcher but got an error.<br><br>functionDecl(hasName("f"),hasB<wbr>ody(hasDescendant(findAll(bina<wbr>ryOperator(hasOperatorName("="<wbr>)).bind("binop")))))<br><br>Here is the clang-query output:<br><br>clang-query> match functionDecl(hasName("f"),hasB<wbr>ody(hasDescendant(binaryOperat<wbr>or(hasOperatorName("=")).bind(<wbr>"binop"))))<br><br>Match #1:<br><br>/tmp/test.c:5:3: note: "binop" binds here<br> a = 1;<br> ^~~~~<br>/tmp/test.c:1:1: note: "root" binds here<br>void f()<br>^~~~~~~~<br>1 match.<br>clang-query> match functionDecl(hasName("f"),hasB<wbr>ody(hasDescendant(findAll(bina<wbr>ryOperator(hasOperatorName("="<wbr>)).bind("binop")))))<br>1:2: Error parsing argument 2 for matcher functionDecl.<br>1:28: Error parsing argument 1 for matcher hasBody.<br>1:36: Error parsing argument 1 for matcher hasDescendant.<br>1:50: Matcher not found: findAll<br>clang-query> <br><br><div class="gmail_default" style="font-size:small">Thanks for any help</div><span class="m_1614641467301130506HOEnZb"><font color="#888888"><br><div class="gmail_default" style="font-size:small">Rémi</div>
</font></span></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>