Subject: Re: best way to write a source code generator?
From: rpw3@rpw3.org (Rob Warnock)
Date: Fri, 22 Sep 2006 00:39:51 -0500
Newsgroups: comp.lang.lisp
Message-ID: <nP-dneLxNZ666o7YnZ2dnUVZ_oSdnZ2d@speakeasy.net>
Frank Buss  <fb@frank-buss.de> wrote:
+---------------
| If I want to create Java files and files in other languages like this:
| ..
| How do I write a generator for this in Lisp? I've started with this:
| ..
| But then it starts getting ugly: ...
...
| Lots of formats and difficult to read code, because of mixed target
| language code within format strings and Lisp code, which is difficult to
| maintain. How can I improve this?
+---------------

Take a look at Aubrey Jaffer's "Schlep":

    http://www-swiss.ai.mit.edu/~jaffer/Docupage/schlep.html

Yes, I know it's from Scheme to C, not CL to Java, and the weird
Hungarian typing is a turnoff [IMHO], though I once made the beginnings
of adding CL-style typing decorations, but he spent a lot of effort
trying to get the resulting generated C code be readable, properly
indented, etc. [And IMHO he did fairly well.]

You might find a useful idea or two in there [or not, YMMV]...


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607