<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div></div><div><br></div><div>Branch management (except for the branching itself) would have to be completely managed by the client, but this is a minor hurt compared to what it is right now.</div><div><br></div><div>As a side-effect of using C++ to make instruction handlers, such a solution could almost be a drop-in replacement for existing interpreters.</div><div><br></div><div>So this is what I'd like to be able to compile with Clang: snippets of C++, with a few symbols declared beforehand.</div><div><br></div><div>Félix</div><div><br><div><div><div>Le 2011-02-21 à 23:35:55, Chris Lattner a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On Feb 21, 2011, at 6:31 PM, Félix Cloutier wrote:<br><br><blockquote type="cite">Hello guys,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I'd like to use Clang to parse snippets of (and emit bytecode for) C++ code that come from larger files that don't contain only C++, but looking at the clang interpreter example, either I didn't get it, or it looks like the driver expects only files, and not strings or char buffers.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Is there a simple way to achieve this? Do I have to split my input into small files and pass them to clang, or is there a better way?<br></blockquote><br>It depends on exactly what you're trying to achieve.  LLDB uses clang to parse individual expressions, and does this by hooking into various name lookup routines to dynamically/lazily populate symbol tables from debug info.<br><br>This is all possible, but it's a nontrivial amount of work.<br><br>-Chris</div></blockquote></div><br></div></div></body></html>