<div dir="ltr">Hi Miklos, I think applying replacements to original source file is not what I expect, it does not act as a "dialect" to me.<div><br></div><div>What I want to do gives a feeling of "AST programming" (I just made up this term). </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 2, 2020 at 5:24 PM Miklos Vajna <<a href="mailto:vmiklos@vmiklos.hu">vmiklos@vmiklos.hu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
On Wed, Sep 02, 2020 at 02:36:38PM +0800, Yafei Liu via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
> All the examples of Clang plugin and FrontendActions I've read are to get<br>
> the AST and print some information, I'm curious if I can modify the AST to<br>
> make some dialect C++ language?<br>
> <br>
> I got some examples I think is easy to do if AST could be modified:<br>
> 1. make all subclasses inherit baseclasses' friend class<br>
> 2. make all method virtual (like Java)<br>
<br>
The typical workflow is to emit fixits/replacements and then apply them,<br>
rather than modifying the AST. clang-tidy has plenty of checks which do<br>
this already.<br>
<br>
Regards,<br>
<br>
Miklos<br>
</blockquote></div>