<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi<div class=""><br class=""></div><div class="">There are a bunch of pygccxml examples here:</div><div class=""><a href="http://pygccxml.readthedocs.io/en/develop/examples.html" class="">http://pygccxml.readthedocs.io/en/develop/examples.html</a></div><div class=""><br class=""></div><div class="">A simple example that almost looks like yours would be this one:</div><div class=""><a href="http://pygccxml.readthedocs.io/en/develop/examples/variables/example.html" class="">http://pygccxml.readthedocs.io/en/develop/examples/variables/example.html</a></div><div class=""><br class=""></div><div class="">Hope this helps you getting started.</div><div class=""><br class=""></div><div class="">Michka</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 1 Oct 2016, at 18:05, Ranadeep Biswas <<a href="mailto:ranadeep@cmi.ac.in" class="">ranadeep@cmi.ac.in</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Matt,<div class=""><br class=""></div><div class="">Yes, I have tried Pygccxml. But I would prefer not to use Python.<div class="">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 class="">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 class=""><br class=""></div><div class="">Thanks,</div></div><div class="gmail_extra"><div class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><div class=""><span style="font-size:12.8000001907349px" class="">Ranadeep</span><br class=""></div></div></div></div></div></div></div></div></div></div>
<br class=""><div class="gmail_quote">On Sat, Oct 1, 2016 at 8:46 PM, Matt <span dir="ltr" class=""><<a href="mailto:mattator@gmail.com" target="_blank" class="">mattator@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br class="">
<br class="">
You can filter the results with pygccxml.<br class="">
<div class=""><div class="h5"><br class="">
2016-10-01 13:50 GMT+02:00 Ranadeep Biswas <<a href="mailto:ranadeep@cmi.ac.in" class="">ranadeep@cmi.ac.in</a>>:<br class="">
> Hello all,<br class="">
><br class="">
> I am doing this project that needs to parse a c/c++ program and generate its<br class="">
> control flow graph so that I can do some analysis on it. Can this be done<br class="">
> using castxml?<br class="">
><br class="">
> I tried to use castxml to generate xml output to build the CFG, but I can<br class="">
> not generate the output as per my need. I could not find any good<br class="">
> documentations. May be I am missing something.<br class="">
><br class="">
> Consider this very simple c++ program.<br class="">
><br class="">
> // foo.cpp<br class="">
> int main(){<br class="">
>   int x, y;<br class="">
>   x = 0;<br class="">
>   y = x + 3;<br class="">
>   return 0;<br class="">
> }<br class="">
><br class="">
> now I run `castxml --castxml-cc-gnu g++ --castxml-gccxml foo.cpp`. It<br class="">
> generates `foo.xml` file, but xml file contains a lot of other tags. But I<br class="">
> don't find tags for variable x and y. Also is it possible to trim the<br class="">
> output, so that I can get tags for only main, x, y and relevant types?<br class="">
><br class="">
> Thanks,<br class="">
><br class="">
> Ranadeep<br class="">
> MSc CS 2nd year<br class="">
> Chennai Mathematical Institute<br class="">
><br class="">
><br class="">
</div></div>> ______________________________<wbr class="">_________________<br class="">
> CastXML mailing list<br class="">
> <a href="mailto:CastXML@public.kitware.com" class="">CastXML@public.kitware.com</a><br class="">
> <a href="http://public.kitware.com/mailman/listinfo/castxml" rel="noreferrer" target="_blank" class="">http://public.kitware.com/<wbr class="">mailman/listinfo/castxml</a><br class="">
><br class="">
</blockquote></div><br class=""></div></div>
_______________________________________________<br class="">CastXML mailing list<br class=""><a href="mailto:CastXML@public.kitware.com" class="">CastXML@public.kitware.com</a><br class="">http://public.kitware.com/mailman/listinfo/castxml<br class=""></div></blockquote></div><br class=""></div></body></html>