<div dir="ltr">Hi Michka,<div><br></div><div>Oh, I see. Thank you for clarifying that. :)<div class="gmail_extra"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Ranadeep</span><br></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Oct 3, 2016 at 1:58 AM, Michka Popoff <span dir="ltr"><<a href="mailto:michkapopoff@gmail.com" target="_blank">michkapopoff@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 style="word-wrap:break-word">Right, I did not realise you wanted information about variables defined inside the function’s body.<div><br></div><div>I think this can not be done with CastXML (GCCXML didn’t allow this too).</div><div>CastXML and GCCXML were written to generate XML files containing enough</div><div>information to generate bindings to other languages; the content of functions</div><div>is not of interest for that goal.</div><div><br></div><div>Of course if you want to do c++ analysis on these variables, castxml could</div><div>probably be extended to output that information. Not sure how much</div><div>work that would be though</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Michka</div></font></span><div><div class="h5"><div><div><br></div><div><br><div><blockquote type="cite"><div>On 2 Oct 2016, at 19:51, Ranadeep Biswas <<a href="mailto:ranadeep@cmi.ac.in" target="_blank">ranadeep@cmi.ac.in</a>> wrote:</div><br class="m_7391841479789198434Apple-interchange-newline"><div><div dir="ltr">Hi Michka,<div><br></div><div>Thanks for the documentations. But I am still stuck.</div><div>Can you tell me how to extract information for variables inside of a function? Consider this simple c++ code.</div><div><br></div><div>int f(){</div><div>  int a = 3;</div><div>  return a;</div><div>}</div><div><br></div><div>how to extract information about variable a?</div><div><br></div><div>Thanks,</div><div class="gmail_extra"><div class="m_7391841479789198434gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><span style="font-size:12.8px">Ranadeep</span></div></div></div></div></div></div></div></div><div class="gmail_extra">
<br><div class="gmail_quote">On Sat, Oct 1, 2016 at 9:39 PM, Michka Popoff <span dir="ltr"><<a href="mailto:michkapopoff@gmail.com" target="_blank">michkapopoff@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 style="word-wrap:break-word">Hi<div><br></div><div>There are a bunch of pygccxml examples here:</div><div><a href="http://pygccxml.readthedocs.io/en/develop/examples.html" target="_blank">http://pygccxml.readthedocs.io<wbr>/en/develop/examples.html</a></div><div><br></div><div>A simple example that almost looks like yours would be this one:</div><div><a href="http://pygccxml.readthedocs.io/en/develop/examples/variables/example.html" target="_blank">http://pygccxml.readthedocs.io<wbr>/en/develop/examples/variables<wbr>/example.html</a></div><div><br></div><div>Hope this helps you getting started.</div><span class="m_7391841479789198434HOEnZb"><font color="#888888"><div><br></div><div>Michka</div></font></span><div><div class="m_7391841479789198434h5"><div><br><div><blockquote type="cite"><div>On 1 Oct 2016, at 18:05, Ranadeep Biswas <<a href="mailto:ranadeep@cmi.ac.in" target="_blank">ranadeep@cmi.ac.in</a>> wrote:</div><br class="m_7391841479789198434m_-6704737580332629070Apple-interchange-newline"><div><div dir="ltr">Hi Matt,<div><br></div><div>Yes, I have tried Pygccxml. But I would prefer not to use Python.<div>But since that you mentioned pygccxml, can you give me an pygccxml example to parse x and y from that previous c++ code?</div><div>And if possible an example of castxml also to parse x and y. If trimming is not possible I am okay with that.</div><div><br></div><div>Thanks,</div></div><div class="gmail_extra"><div><div class="m_7391841479789198434m_-6704737580332629070gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><span style="font-size:12.8000001907349px">Ranadeep</span><br></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Sat, Oct 1, 2016 at 8:46 PM, Matt <span dir="ltr"><<a href="mailto:mattator@gmail.com" target="_blank">mattator@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
You can filter the results with pygccxml.<br>
<div><div class="m_7391841479789198434m_-6704737580332629070h5"><br>
2016-10-01 13:50 GMT+02:00 Ranadeep Biswas <<a href="mailto:ranadeep@cmi.ac.in" target="_blank">ranadeep@cmi.ac.in</a>>:<br>
> Hello all,<br>
><br>
> I am doing this project that needs to parse a c/c++ program and generate its<br>
> control flow graph so that I can do some analysis on it. Can this be done<br>
> using castxml?<br>
><br>
> I tried to use castxml to generate xml output to build the CFG, but I can<br>
> not generate the output as per my need. I could not find any good<br>
> documentations. May be I am missing something.<br>
><br>
> Consider this very simple c++ program.<br>
><br>
> // foo.cpp<br>
> int main(){<br>
>   int x, y;<br>
>   x = 0;<br>
>   y = x + 3;<br>
>   return 0;<br>
> }<br>
><br>
> now I run `castxml --castxml-cc-gnu g++ --castxml-gccxml foo.cpp`. It<br>
> generates `foo.xml` file, but xml file contains a lot of other tags. But I<br>
> don't find tags for variable x and y. Also is it possible to trim the<br>
> output, so that I can get tags for only main, x, y and relevant types?<br>
><br>
> Thanks,<br>
><br>
> Ranadeep<br>
> MSc CS 2nd year<br>
> Chennai Mathematical Institute<br>
><br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> CastXML mailing list<br>
> <a href="mailto:CastXML@public.kitware.com" target="_blank">CastXML@public.kitware.com</a><br>
> <a href="http://public.kitware.com/mailman/listinfo/castxml" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/castxml</a><br>
><br>
</blockquote></div><br></div></div>
______________________________<wbr>_________________<br>CastXML mailing list<br><a href="mailto:CastXML@public.kitware.com" target="_blank">CastXML@public.kitware.com</a><br><a href="http://public.kitware.com/mailman/listinfo/castxml" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/castxml</a><br></div></blockquote></div><br></div></div></div></div></blockquote></div><br></div></div>
</div></blockquote></div><br></div></div></div></div></div></blockquote></div><br></div></div></div>