<div dir="ltr">Using CompilerInstance is non-trivial. To make your life easier, there's LibTooling:<div><a href="http://clang.llvm.org/docs/LibTooling.html">http://clang.llvm.org/docs/LibTooling.html</a><br></div><div>
<br></div><div style>If you want a more stable interface I'd suggest you also take a look at LibClang.</div><div style><br></div><div style>Cheers,</div><div style>/Manuel</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Feb 28, 2013 at 11:18 PM, Lukas Vogel <span dir="ltr"><<a href="mailto:lukedirtwalkerdev@gmail.com" target="_blank">lukedirtwalkerdev@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi,<div><br></div><div>I try to parse c++ code, for now just very simple code like this:</div><div>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(255,255,85)">class</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(85,255,85)">Testing</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(170,170,170)">{</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(255,255,85)">public</span><span style="color:rgb(170,170,170)">:</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(85,255,85)">Testing</span><span style="color:rgb(170,170,170)">(){}</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(170,170,170)">};</span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(170,170,170)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px">
<span style="color:rgb(170,170,170)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(170,170,170)"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(170,170,170)">My Code is based on a CompilerInstance but I always get the following </span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><p style="margin:0px"><span style="font-family:monospace;font-size:9pt;color:rgb(180,9,9)">error: unknown type name 'class'</span></p><p style="margin:0px"><span style="font-family:monospace;font-size:9pt;color:rgb(180,9,9)"><br>
</span></p><p style="margin:0px"><span style="font-family:monospace;font-size:9pt;color:rgb(180,9,9)">I tried to somehow set the LangOptions but still didn't get it to work...</span></p><p style="margin:0px"><br></p>
<p style="margin:0px">
<font color="#b40909">My code is here </font><a href="https://github.com/lukedirtwalker/Envision/blob/cppimport/CppImport/src/cppimportmanager.cpp" style="font-family:arial" target="_blank">https://github.com/lukedirtwalker/Envision/blob/cppimport/CppImport/src/cppimportmanager.cpp</a> </p>
<p style="margin:0px"><br></p><p style="margin:0px">Thanks for any help :)</p></pre>
<pre style="margin-top:0px;margin-bottom:0px"></pre></div></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>