<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Sun, Aug 30, 2015 at 9:35 PM Daniel Dilts <<a href="mailto:diltsman@gmail.com">diltsman@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm manipulating the token stream in my action.  I don't believe that that is possible in AST matchers.</div></blockquote><div><br></div><div>Yep, then just implement your own FrontendActionFactory - shouldn't be more than 10 LOC :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 30, 2015 at 7:25 AM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><span><div dir="ltr">On Thu, Aug 27, 2015 at 7:40 PM Daniel Dilts <<a href="mailto:diltsman@gmail.com" target="_blank">diltsman@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I guess that I am doing something wrong.  This is my code:</div><div><br></div><div>  <font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2">RefactoringTool</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> tool(optionsParser.getCompilations(), optionsParser.getSourcePathList());</font></font></div><div><font face="Consolas" size="2"><font face="Consolas" size="2">
</font></font><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2"><font color="#2b91af" face="Consolas" size="2"> MyAction</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> action{tool};</font></font><font face="Consolas" size="2"><font face="Consolas" size="2">
</font></font></div><div><font face="Consolas"> </font><font color="#0000ff" size="2"><font color="#0000ff" size="2"><font color="#0000ff" face="Consolas" size="2">auto</font></font></font><font size="2"><font face="Consolas" size="2"> a = tool.runAndSave(newFrontendActionFactory(&action).get());</font></font></div><div><font face="Consolas"><br></font></div><div><font face="Consolas">I am getting an error 'newASTConsumer': is not a member of 'MyAction'.  It seems to want some kind of action factory, not an action.</font></div></div></blockquote><div><br></div></span><div>This doesn't work, because we need to be able to create multiple actions - if you want to pass something to the action, you need to implement your own FrontendActionFactory.</div><div>The question is why you need your own action - usually you'll want to use an ASTMatchFinder with your own callback, in which case you hand the tool to the callback, register the callback, and then use newFrontendActionFactory(&match_finder).</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 26, 2015 at 9:19 PM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">You hand the refactoring tool pointer to the Frontend action factory, which then hands it to the Frontend action. </p>
<br><div class="gmail_quote"><span><div dir="ltr">On Wed, Aug 26, 2015, 6:29 PM Daniel Dilts via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><div dir="ltr"><div>I have a custom FrontendAction that I want to run using RefactoringTool::runAndSave().  runAndSave() takes a FrontendActionFactory and doesn't appear to have a way to pass parameters to the produced action.</div><div><br></div><div>How does one get the replacements list from RefactoringTool::getReplacements() into their FrontendAction?</div></div></span>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>
</blockquote></div><br></div>
</blockquote></span></div></div>
</blockquote></div><br></div>
</blockquote></div></div>