<div dir="ltr">Hi Alex, <div>I can probably look into it if I have time and will feel myself confident enough. I've started learning Clang just recently (and my background is HW design, not programming).</div><div><br></div><div>Meanwhile I've found a workaround to do what I've needed originally:</div><div>Instead of printing nodes in a special way, I create Replacements for them, then use a temporary Rewriter to apply replacements and get back text I wanted to print.</div><div><br></div><div>Probably it was supposed to be always done like that? </div><div><br></div><div>The only problem is the case when I don't have parts of AST in original source code. For example when I deal with template instantiations. In that case I will have to emit implicit template specializations in overlay filesystem, reparse TU again, and then create replacements for nodes of interest. </div><div><br></div><div>So If I had a capability to customize AST pretty-printer, I won't need to re-parse source code multiple times.</div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-10-18 16:30 GMT-07:00 Alex L <span dir="ltr"><<a href="mailto:arphaman@gmail.com" target="_blank">arphaman@gmail.com</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 Roman,<div class="gmail_extra"><br><div class="gmail_quote"><span class="">On 18 October 2017 at 14:35, Roman Popov via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">In <span style="font-size:12.8px">StmtPrinter there is a PrintHelper that can be used to override printing of some nodes. </span><span style="font-size:12.8px">I guess </span><span style="font-size:12.8px">PrintHelper was introduced for someone like me that wanted to override some StmtPrinter visitors.</span><div><span style="font-size:12.8px">But </span><span style="font-size:12.8px">DeclPrinter does not supports </span><span style="font-size:12.8px">PrintHelper for some reason.</span></div></div></blockquote><div><br></div></span><div>It's possible that nobody else needed a customized DeclPrinter before, so it wasn't necessary to add a helper for it.</div><div>I think that it would make sense to add a helper class for DeclPrinter if there's a good enough justification for it. Would you be interested in working on a patch for such a helper class?</div><div><br></div><div>Alex</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class=""><div dir="ltr"><div><div><br></div></div></div><div class="m_-7650353939905087329gmail-HOEnZb"><div class="m_-7650353939905087329gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-10-18 12:53 GMT-07:00 Roman Popov <span dir="ltr"><<a href="mailto:ripopov@gmail.com" target="_blank">ripopov@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello, <div>I want to redefine some visitors in DeclPrinter and StmtPrinter, but they are not exported over Clang API. Why is that?<div><br></div><div>Currently I have to copy-paste them into my tool. But this unfortunately leads to some duplication.</div><span class="m_-7650353939905087329gmail-m_-7747411952940611803HOEnZb"><font color="#888888"><div><br></div><div>-Roman</div></font></span></div></div>
</blockquote></div><br></div>
</div></div><br></span>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>
</blockquote></div><br></div></div>