Re: Re: source-to-source translators

"Eric M. Hopper" <[email protected]>
Newsgroups gmane.comp.documentation.synopsis
Organization Omnifarious Software
Message-ID <[email protected]>
On Thu, 2005-06-16 at 22:54 -0400, Stefan Seefeld wrote:

> > In a sense, it does source (C++) to source (C++ again) translation of
> > templates to working C++ code.
> 
> Sure, but what relevance does that have for source-to-source translation
> in the context of synopsis ?


For example, you could create a generic template-like language for
expressing source files in one language in terms of abstract semantic
constructs in Synopsis' parse tree.  Ugly example for something
attempting to translate to Python:


sub translate_class(c) ^indent_to_current(
[class ^translaterate_identifier(c.name) ( ^commalist( transliterate( base.name for base in c.bases ) ) ):
^add_indent(emit_memfunction(func) for func in c.memberfunc)


etc...

That looks kinda ugly, but I think you see what I mean.  This would
allow you to create custom ways of implementing particular language
features in one language that don't have a good mapping into another
language.  For example, what do you do with non-virtual C++ functions
when you translate them to Python?

I guess that relates to some of the XSLT ideas being thrown around
before.

Have fun (if at all possible),
-- 
The best we can hope for concerning the people at large is that they
be properly armed.  -- Alexander Hamilton
-- Eric Hopper ([email protected]  http://www.omnifarious.org/~hopper) --

_______________________________________________
Synopsis-devel mailing list
[email protected]
http://lists.fresco.org/cgi-bin/listinfo/synopsis-devel
signature.asc (application/pgp-signature, 185 B)
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQBCtYdBjtsvlOwvazYRAtzQAJ47teZF+Czy3tnpxJ0VBpwpJmz3GQCfWG28
I4GxqsvfZ5zsJyQNyGVqBiY=
=9aUC
-----END PGP MESSAGE-----
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.