<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 19, 2014 at 4:54 PM, Xiaohui Chen <span dir="ltr"><<a href="mailto:xchen422@uwo.ca" target="_blank">xchen422@uwo.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi there:<br><br>suppose i have already built the AST of the following compound Stmt,  i will traversal this <br> AST twice,<br><br>{<br>        .......       // A<br>        .......       //  B<br>}<br><br>in the first traverse, i use  Rewrite.<span>InsertText </span> to  insert "int var" between A and B,<br><br>in the second traverse, can i use visitvardecl method to visit "int var"?<br></blockquote><div><br></div><div><span style="font-size:13px">Not sure, if this answers your question (given all the unrelated text you are quoting) but towards the end of the tutorial video of </span><span style="font-size:13px;color:rgb(84,84,84);line-height:18.2000007629395px">Manuel </span><span style="font-size:13px;font-weight:bold;color:rgb(84,84,84);line-height:18.2000007629395px">Klimek, </span><a href="https://www.youtube.com/watch?v=VqCkCDFLSsc" target="_blank" style="font-size:13px">https://www.youtube.com/watch?v=VqCkCDFLSsc</a><span style="font-size:13px">, Richard answers the question. The inserted rewrites are not affecting your ast, thus new matches/visits will not see your rewrite, unless you rebuild the AST with the rewritten code (text).</span><br></div><div><br></div><div><br></div></div>
</div></div>