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. --

Re: Read C++ enum in python

2009-08-19 Thread Mark Tolonen
Mark Tolonen metolone+gm...@gmail.com 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

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

Re: Read C++ enum in python

2009-08-19 Thread AggieDan04
On Aug 18, 6:03 pm, Ludo olivier.anospamrnospamnnospamanospamenosp...@affaires.net 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

Re: Read C++ enum in python

2009-08-19 Thread Mark Tolonen
MRAB pyt...@mrabarnett.plus.com 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

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 until

Re: Read C++ enum in python

2009-08-19 Thread Bill Davy
Mark Tolonen metolone+gm...@gmail.com wrote in message news:mailman.89.1250666942.2854.python-l...@python.org... MRAB pyt...@mrabarnett.plus.com 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

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