<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 28, 2013 at 11:42 AM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, May 28, 2013 at 11:31 AM, steveneliuk <span dir="ltr"><<a href="mailto:s.eliuk@samsung.com" target="_blank">s.eliuk@samsung.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Clang parses and constructs an AST quickly & effectively... likewise provides<br>
wonderful tools for traversing the AST with ease. Utilizing these tools<br>
provides a lot of the functionality required in the WebCL validator<br>
<br>
Matchers provide a nice way to quickly navigate to nodes of interest, but<br>
the modifications and consistency of the AST is not achievable through<br>
matchers.<br></blockquote><div><br></div></div><div>Consistency of the AST is significantly harder to achieve through direct AST manipulation than through source rewriting. There are various forms of implicitly-added AST nodes that you would need to create, and you would need to ensure that your nodes have appropriate type, value kind, and so on. None of this is necessary if you use the rewrite interface.</div>
<div class="im">
<div><br></div></div></div></blockquote><div><br></div><div style>This kind of transformation may be tractable for the subset of C-like language constructs that OpenCL/WebCL needs (i.e., not needing to deal with the full generality of C++).</div>
<div style><br></div><div style>-- Sean Silva </div></div></div></div>