Re: [C++-sig] pyste, gccxml and boost ublas, random number generator etc

Stefan Seefeld <[email protected]>
Newsgroups gmane.comp.documentation.synopsis
Message-ID <[email protected]>
Hi Roman,

Roman Yakovenko wrote:
> Hi. First of all I am unable to subscribe to synopsis list. I got "The
> requested URL
> /mailinglists.html was not found on this server" error.

Where did you see this URL ?
The correct address is http://synopsis.fresco.org/contact.html.

>>I couldn't quite figure out what the goal of pygccxml and pyplusplus is,
>>and how that relates to synopsis. gccxml is a C/C++ parser, and synopsis
>>contains a C/C++ parser, too, so I can see that in some cases where software
>>depends on gccxml it may make sense to replace that with synopsis.
>>
> 
> 
> Small explanation: pygccxml consist from 2 parts: parser and classes
> that describes
> C++ declarations. Lets call them declarations classes.
> The only parser that exists today is one based on GCC-XML. 
> pyplusplus is code generator that does not envolved in parsing C++
> source files at all.
> pyplusplus describes its interface to user in terms of pygccxml
> declarations classes.
> So, theoretically, user could create declarations from some program
> database and then
> pass them to pyplusplus code generator. 

As far as the scope is concerned, that sounds indeed a lot like synopsis.

>>However, from my little understanding it appears that pygccxml is - in terms
>>of scope - more equivalent to synopsis as a whole, i.e. source code introspection.
>>Why would you want to run on top of synopsis, then ?
> 
> I think, and please correct me if I am wrong, that synopsis is too low level. 
> I , as code generator user, really do not want to deal with Parse Tree and AST. 
> pygccxml provides you with high view - declarations. Why synopsis? -
> cross platform, written in python, responsive and open mind author. It
> uses boost.wave for prepossessing. And it seems to me that it based on
> OpenC++ project, right? So it has all components to be good C++
> parser.

Have you looked at the synopsis AST (http://synopsis.fresco.org/docs/Tutorial/ast.html) ?
Is this not exactly what you are describing, i.e. a list of all declarations ?

As far as code generation is concerned, I don't think this is quite enough, though.
It might be enough for language bindings, where you create entirely new code.
And even there users may plug in specific generators for particular types, requiring
some type analysis.
But there are other cases where you want to modify existing code. There you do
need the parse tree or you won't be able to reproduce the original code at all.

Synopsis thus offers a variety of 'views' (representations) for the parsed code,
and users choose the most suitable one to operate on.

>>What is the advantage of
>>mapping synopsis' own internal representations to pygccxml, of you could do
>>the same introspection more efficiently inside synopsis ?
> 
> 
> I believe that I can add an other parser to pygccxml, without changing
> 1 line of code in pyplusplus. "efficiently" is not an issue here.

Ok.

>>What advantage does pygccxml have over synopsis that suggests such an additional
>>step ?
> 
> 
> pyplusplus already use pygccxml declarations classes in its interface.
> This is the only
> advantage.

Ok.
As far as synopsis is concerned, I'm planning to add a high level API
for code generation that uses the existing pipeline infrastructure
(http://synopsis.fresco.org/docs/Tutorial/pipeline.html) as that paradigm
appears to be very powerful and flexible.
In fact, as I suggested on the boost.python list, I would like to experiment
with pyste to see whether that could be modified so users gain the same
flexibility by chaining together code generating 'processors' (keeping the
current UI as the 'default pipeline' for backward compatibility.

>>>By the way pygccxml almost 80 unittests. So If I add synopsis as
>>>back-end, I could be sure I did it right.
>>
>>That's good. What do these tests cover ?
> 
> 
> Almost every aspect of declarations reading. As input I give C++
> source file, as output I get
> C++ declarations. Testers checks that I got all expected declarations.

I see.

Regards,
		Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.