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
"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,
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
"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.
>>>
>>
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
"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,
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
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+