<html><head><style>
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}

p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst, p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle, p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
</style></head><body><div style="font-family:Calibri,'Segoe UI',Meiryo,'Microsoft YaHei UI','Microsoft JhengHei UI','Malgun Gothic','Khmer UI','Nirmala UI',Tunga,'Lao UI',Ebrima,sans-serif;font-size:16px">
<div>I work with clang as a source-to-source translator myself, and typically use its Rewriter class to modify statements in the clang buffer representing the original code.  At the end of the translation unit I just print out the “rewritten text” as reported by the Rewriter.</div>
<div> </div><div>--John</div><div><div> </div><div>=======================<br>John Stratton, Ph.D.<br>Senior Architect<br>MulticoreWare</div><div> </div></div>       <div style="border-top-color:rgb(225,225,225);border-top-width:1px;border-top-style:solid">
                <strong>From:</strong> Miguel Aguilar <<a href="mailto:miguel.aguilar@ice.rwth-aachen.de">miguel.aguilar@ice.rwth-aachen.de</a>><br>              <strong>Sent:</strong> January 22, 2013 3:45 AM<br>           <strong>To:</strong> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
                <strong>Subject:</strong> [cfe-dev] Statement replacement<br> </div>    <div> </div>Hi,<br>
<br>
I would like to know the approaches that clang offers in order to replace one statement to another within the body of a C++ method.<br>
<br>
I don't want to change the original code but just the body of the method in the memory and then from that emit a new source file.<br>
<br>
Thanks,<br>
<br>
Miguel<br>
______________________________<u></u>_________________<br>
cfe-dev mailing list<br>
<a tabindex="-1" href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a tabindex="-1" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><br>
</div></body></html>