The naalaa compiler can translate from naalaa basic code to Java. This is, obviously, how it creates Java applets. As I had already written all the parsing stuff, it was really easy to let the compiler spit out Java code instead of naalaa system calls and bytecode.
I might be a bit (or a lot) naive now. But if I wanted to write a pure translator from scratch, my first attempt would probably be to write something like an advanced search and replace program. I know that Markus Mangold (author of the EGSL interpreter) has been experimenting with a BASIC to Pascal translator with this approach, and it seems to be working quite well.
How is it usually done? Need it be as complex as a compiler (/bytecode generator)?