Re: Using synopsis to translate python source code to C/C++ or Java

Stefan Seefeld <[email protected]> Fri, 27 Mar 2009 11:02:35 -0400
Newsgroups gmane.comp.documentation.synopsis
Message-ID <[email protected]>
Hi Tom,

Tom Malcolmson wrote:
> Hi.
>
> It appears to me that synopsis is able to parse Python and C++.  I see
> formatters for producing documentation from the AST trees but I don't
> see formatters for producing source code.  Do they exist?
>   

No. The various language parsers in Synopsis first generate 
language-specific source representations (a C++ parse tree, a Python 
AST, etc.), and then translate that (or rather, a subset of it) into a 
common representation: the 'Abstract Semantic Graph' (ASG). This ASG is 
what most of the processors in Synopsis work on to generate 
documentation. I assume this level is enough if you want to generate API 
bindings (say), because for those you only care about the API 
declarations, which are adequatly represented in the ASG.
For full-blown code translation, however, this is not enough. You need 
to operate one level below, on the parse tree.

I think what you want is very reasonable, and in case of Python even 
straight-forward to do (in contrast to C++, for example).

If you are interested in such a feature I encourage you to submit a 
detailed feature request. And, if you are willing and able to help 
implement it, I would be glad to collaborate.

Thanks for your interest into Synopsis !

       Stefan

-- 

      ...ich hab' noch einen Koffer in Berlin...