Discussion:
[GCC-XML] gccxml parsing help
Mahesh V
2014-01-03 11:49:21 UTC
Permalink
Hello Good Folks,

I am a newbie.

Would you please point me to a python sample code which can parse the xml
output file generated using gccxml?

I have a .h file (c programming language) as shown below
#ifndef _TEST_TYPE_DEF_H_
#define _TEST_TYPE_DEF_H_
typedef enum {
TYPE_THING_A,
TYPE_THING_B,
} ncfg_test_type_thing_t;
typedef struct {
test_type_thing_t thing;
int val;
int with_cheese;
} test_type_t;
#endif // _TEST_TYPE_DEF_H_

I parsed it using the gccxml with the following command
gccxml def.h -fxml=./aaa.xml

The resultant xml file is huge and I am lost in getting the file parsed.
what I need is names of the types (test_type_t is a struct, val is int,
with_cheese is int) etc as output. Any pointers will be helpful.

thanks
Mahesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gccxml.org/pipermail/gccxml/attachments/20140103/7aa0d3c0/attachment.htm>
Jakub Zytka
2014-01-03 12:14:15 UTC
Permalink
On Fri, 3 Jan 2014 17:19:21 +0530
Post by Mahesh V
Hello Good Folks,
I am a newbie.
Would you please point me to a python sample code which can parse the
xml output file generated using gccxml?
check out pygccxml (and possibly pyplusplus)
Mahesh V
2014-01-03 12:46:30 UTC
Permalink
thanks. but If I am not mistaken, the examples talk about namespaces and
more on c++ notations. Can I parse plain vanilla C header files with it?
Post by Jakub Zytka
On Fri, 3 Jan 2014 17:19:21 +0530
Post by Mahesh V
Hello Good Folks,
I am a newbie.
Would you please point me to a python sample code which can parse the
xml output file generated using gccxml?
check out pygccxml (and possibly pyplusplus)
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.gccxml.org/mailman/listinfo/gccxml
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gccxml.org/pipermail/gccxml/attachments/20140103/d9eaff85/attachment.htm>
Loading...