Re: Choosing the right parser for parsing C headers

2005-02-08 Thread John Machin
Jean de Largentaye wrote: > Hi, > > I need to parse a subset of C (a header file), and generate some unit > tests for the functions listed in it. I thus need to parse the code, > then rewrite function calls with wrong parameters. What I call "shaking > the broken tree" :) I was thinking "cdecl",

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Caleb Hattingh
Jean, Paddy I use "pym" to extract bits of pascal out of delphi code for documentation purposes. You have to add some stuff to the delphi code (in your case, C header), but these are added within comment blocks, and the interesting thing is that you add python code(!) as a kind of dynamic ma

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Paddy McCarthy
Jean de Largentaye wrote: Hi, I need to parse a subset of C (a header file), and generate some unit tests for the functions listed in it. I thus need to parse the code, then rewrite function calls with wrong parameters. What I call "shaking the broken tree" :) I chose to make my UT-generator in Pyt

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Jean de Largentaye
That looks cool Roman, however, I'm behind a Corporate Firewall, is there any chance you could send me a cvs snapshot? John -- http://mail.python.org/mailman/listinfo/python-list

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Roman Yakovenko
try http://sourceforge.net/projects/pygccxml There are a few examples and nice ( for me ) documentation. Roman On Tue, 8 Feb 2005 13:35:57 +0100, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Jean de Largentaye wrote: > > > GCC-XML looks like a very interesting alternative, as Python includes > > t

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Fredrik Lundh
Jean de Largentaye wrote: > GCC-XML looks like a very interesting alternative, as Python includes > tools to parse XML. > The mini-C compiler looks like a step in the right direction for me. > I'm going to look into that. > I'm not comfortable with C++ yet, and am not sure how I'd use Pyste. to c

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Jean de Largentaye
GCC-XML looks like a very interesting alternative, as Python includes tools to parse XML. The mini-C compiler looks like a step in the right direction for me. I'm going to look into that. I'm not comfortable with C++ yet, and am not sure how I'd use Pyste. Thanks for the information guys, you've b

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Fredrik Lundh
Thomas Heller wrote: > IMO, for parsing 'real-world' C header files, nothing can beat gccxml. no free tool, at least. if a budget is involved, I'd recommend checking out the Edison Design Group stuff. -- http://mail.python.org/mailman/listinfo/python-list

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Thomas Heller
"Jean de Largentaye" <[EMAIL PROTECTED]> writes: > Hi, > > I need to parse a subset of C (a header file), and generate some unit > tests for the functions listed in it. I thus need to parse the code, > then rewrite function calls with wrong parameters. What I call "shaking > the broken tree" :)

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Miki Tebeka
Hello Jean, > - ply: > Lex / Yacc for python! Tackle the Beast! Syntax processing looks mini_c is a C compiler written using ply. You can just use it as is. http://people.cs.uchicago.edu/~varmaa/mini_c/ HTH. -- Miki Tebeka <

Re: Choosing the right parser for parsing C headers

2005-02-08 Thread Fredrik Lundh
Jean de Largentaye wrote: > I need to parse a subset of C (a header file), and generate some unit > tests for the functions listed in it. I thus need to parse the code, > then rewrite function calls with wrong parameters. What I call "shaking > the broken tree" :) > > I chose to make my UT-generat