<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, May 28, 2015 at 5:51 PM Richard <<a href="mailto:legalize@xmission.com">legalize@xmission.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
In article <<a href="mailto:1432806087.2498925.280264065.1368E918@webmail.messagingengine.com" target="_blank">1432806087.2498925.280264065.1368E918@webmail.messagingengine.com</a>>,<br>
Gabor Kozar <<a href="mailto:kozargabor@fastmail.fm" target="_blank">kozargabor@fastmail.fm</a>> writes:<br>
<br>
> I don't think you'd really be able to do this with matchers without<br>
> major modifications to the matcher architecture.<br>
<br>
Why do you say that? All the information is available from within<br>
CompoundStmt provided I have the other two matchers. That's what I<br>
currently do now in the callback -- walk the CompoundStmt looking for<br>
the two consecutive statements that match my criteria (simplified and<br>
hard-coded for my case):<br></blockquote><div><br></div><div>It sounds like we could implement an isnext matcher via the parent map:</div><div>hasPreviousNode(m):</div><div> parent = getParentFromParentMap()</div><div> loop over the compound statements children until we find the current node</div><div> return value of m on previous node</div><div><br></div><div>Patches welcome :)</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
CompoundStmt::const_body_iterator BeforeIt = Compound->body_begin();<br>
CompoundStmt::const_body_iterator AfterIt = Compound->body_begin();<br>
for (++AfterIt;<br>
AfterIt != Compound->body_end() && *BeforeIt != Ret;<br>
++BeforeIt, ++AfterIt) {<br>
if (auto *If = dyn_cast<IfStmt>(*BeforeIt)) {<br>
if (*AfterIt == Ret) {<br>
// ...<br>
}<br>
}<br>
}<br>
<br>
PS: Mail filters are blocking my messages, so ignore this, its<br>
only for them. Lorem ipsum dolor sit amet, consectetur adipiscing<br>
elit. Phasellus consequat ullamcorper mollis. Sed blandit semper tortor<br>
ultricies dictum. Proin hendrerit et quam in sagittis. Maecenas vel<br>
blandit ante, in auctor sem. Phasellus condimentum leo vel finibus<br>
viverra. Duis fermentum sollicitudin est, ac iaculis lectus auctor vel.<br>
Nam condimentum nulla feugiat, venenatis nibh a, elementum nulla. Nulla<br>
vitae malesuada eros. Nulla cursus maximus ligula non hendrerit.<br>
<br>
Curabitur lobortis nulla vel sapien posuere, id aliquam orci<br>
bibendum. Vestibulum at vulputate risus. Proin in purus commodo,<br>
tempus lectus vitae, faucibus nunc. Aenean congue faucibus elit, sit<br>
amet facilisis nibh ultrices eget. Nam pulvinar leo ac nunc ultricies,<br>
nec tincidunt nulla tincidunt. Etiam placerat felis tellus, ut ultricies<br>
nunc ultricies quis. In placerat sapien nec ultricies mattis. Integer<br>
sed tempor orci, ac imperdiet orci. Integer ac augue et augue convallis<br>
faucibus.<br>
--<br>
"The Direct3D Graphics Pipeline" free book <<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__tinyurl.com_d3d-2Dpipeline&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=ZobpPJeP9qlzV50CJ3j_1tQpyEShxCX4TOqKnxGU-kQ&s=AqPjqrgE144gKsOuy-rJH8yTIzcf4K4MXCZ5wgTp6Nw&e=" rel="noreferrer" target="_blank">http://tinyurl.com/d3d-pipeline</a>><br>
The Computer Graphics Museum <<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__ComputerGraphicsMuseum.org&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=ZobpPJeP9qlzV50CJ3j_1tQpyEShxCX4TOqKnxGU-kQ&s=5AM0POUSFf46duasIsxm_-ti2VCdDUTBhyOrTbV2csA&e=" rel="noreferrer" target="_blank">http://ComputerGraphicsMuseum.org</a>><br>
The Terminals Wiki <<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__terminals.classiccmp.org&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=ZobpPJeP9qlzV50CJ3j_1tQpyEShxCX4TOqKnxGU-kQ&s=K33el6gIKhr_OjduM7fG63uumRlQUpWFRQJn_hIft-c&e=" rel="noreferrer" target="_blank">http://terminals.classiccmp.org</a>><br>
Legalize Adulthood! (my blog) <<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__LegalizeAdulthood.wordpress.com&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=ZobpPJeP9qlzV50CJ3j_1tQpyEShxCX4TOqKnxGU-kQ&s=9r1osyisA2cjAbuhW4jWfRwfW_9-ZK0qZPc0COZWlGE&e=" rel="noreferrer" target="_blank">http://LegalizeAdulthood.wordpress.com</a>><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>