Re: Re: software design clarification

"Roman Yakovenko" <[email protected]> Tue, 8 May 2007 22:05:33 +0300
Newsgroups gmane.comp.documentation.synopsis
Message-ID <[email protected]>
On 5/8/07, Stefan Seefeld <[email protected]> wrote:
> > I am working exactly on this functionality for pygccxml project. Today
> > it is based on GCCXML parser. I hope in few month from now, synopsis
> > backend will be also available.
>
> Have you had a look at Synopsis' processor / pipeline design ? I'd
> be curious about how useful you find it as a means to drive any source
> transformation.

No I didn't. I promise you to find the time and to take a look on it. Can you
create small list for places I should look at?

>From my side I can tell you that source-to-source transformation is
difficult process. Py++ introduces two type of trees:
* declarations tree - something very similar to AST, but one that
keeps much more information
* code creators tree - this one keeps objects, which creates code.
They have to take into account information from declarations tree and
code creators tree.

The generated code should meet some standards. In case of Py++ - I
just cannot afford to generate all code into single file, more over it
should generate "include" directives only if the code in the file uses
the functionality.

I wrote some document that explains Py++ architecture:
http://language-binding.net/pyplusplus/documentation/architecture.html

I hope you find it useful.

> The reason I ask is because I can see yet a different interaction between
> Synopsis and Py++ (and GCCXML, for that matter):

I am curious - what do you mean?

> What if Py++ itself used Synopsis' pipeline language (and thus, scripting frontend),
> to drive the introspection as well as the code generation ?

Good C++ parser is critical for s-2-s translators, but this is not enough.
pygccxml contains type traits - the functionality very similar to
boost::type_traits.
It is a must.

> And, as Nathaniel suggests, we could try to hook up gccxml (and may be elsa)
> as alternative C++ parsers. Obviously, the low level bits will differ a lot
> (i.e. there is no equivalent of Synopsis's parse tree), but may be for the
> AST generation it wouldn't make a difference.

This is the subject I am working right now. I am constructing
declarations tree ( AST ) from Synopsis and GCC-XML. From my
experience till now, the trees are very very different. GCCXML
provides much more information.

Also I think it is up to you to decide where Synopsis is going: to be
high quality C++ parser or thin wrapper around existing ones. (
Assumption: you will not have time to implement both of them :-) ).

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/