Re: Read C++ enum in python

2009-08-19 Thread Brian
pygccxml http://www.language-binding.net/pygccxml/pygccxml.html It uses gccxml to compile your source code into xml, and then makes all of your source code available to you via a high level and convenient query interface in python. On Tue, Aug 18, 2009 at 5:03 PM, Ludo < olivier.anospamrnospamnno

Re: Read C++ enum in python

2009-08-19 Thread Mark Tolonen
"Mark Tolonen" wrote in message news:h6g9ig$vh...@ger.gmane.org... [snip] This is what 3rd party library pyparsing is great for: begin code-- from pyparsing import * # sample string with enums and other stuff sample = ''' stuff before enum hello { Zero,

Re: Read C++ enum in python

2009-08-19 Thread Ludo
Neil Hodgson a écrit : For some headers I tried it didn't work until the .* was changed to a non-greedy .*? to avoid removing from the start of the first comment to the end of the last comment. file_data = ' '.join(re.split(r'\/\*.*?\*\/', file_data)) Thank you ! I adopt it ! Cheers. -- h

Re: Read C++ enum in python

2009-08-19 Thread Bill Davy
"Mark Tolonen" wrote in message news:mailman.89.1250666942.2854.python-l...@python.org... > > "MRAB" wrote in message > news:4a8b3e2d.7040...@mrabarnett.plus.com... >> Ludo wrote: >>> Hello, >>> >>> I work in a very large project where we have C++ packages and pieces of >>> python code. >>> >>

Re: Read C++ enum in python

2009-08-19 Thread Neil Hodgson
AggieDan04: > file_data = open(filename).read() > # Remove comments and preprocessor directives > file_data = ' '.join(line.split('//')[0].split('#')[0] for line in > file_data.splitlines()) > file_data = ' '.join(re.split(r'\/\*.*\*\/', file_data)) For some headers I tried it didn't work unti

Re: Read C++ enum in python

2009-08-19 Thread Mark Tolonen
"MRAB" wrote in message news:4a8b3e2d.7040...@mrabarnett.plus.com... Ludo wrote: Hello, I work in a very large project where we have C++ packages and pieces of python code. I've been googleing for days but what I find seems really too complicated for what I want to do. My business is,

Re: Read C++ enum in python

2009-08-18 Thread AggieDan04
On Aug 18, 6:03 pm, Ludo wrote: > Hello, > > I work in a very large project where we have C++ packages and pieces of > python code. > > I've been googleing for days but what I find seems really too > complicated for what I want to do. > > My business is, in python, to read enum definitions provide

Re: Read C++ enum in python

2009-08-18 Thread MRAB
Ludo wrote: Hello, I work in a very large project where we have C++ packages and pieces of python code. I've been googleing for days but what I find seems really too complicated for what I want to do. My business is, in python, to read enum definitions provided by the header file of an c+

Read C++ enum in python

2009-08-18 Thread Ludo
Hello, I work in a very large project where we have C++ packages and pieces of python code. I've been googleing for days but what I find seems really too complicated for what I want to do. My business is, in python, to read enum definitions provided by the header file of an c++ package. Of