I don't think you defined your problem well enough to get detailed advice.
Some points are quite unclear:
- What is Esperanto ? (I assume you don't mean the spoken language)
- Did you actually write code that parses Java ? Using a module ? A full parser or some partial regex-hack ?
Anyways, an intermediate representation for Java code, like for any code really, is a syntax tree. For XML, a good internal representation is the one used by Perl's modules - if your XML isn't too sophisticated, the HoAoH(...) approach of XML::Simple may be what you're looking for. | [reply] |
When I said Esperanto, I meant figuratively an intermediate class that can output both XML and Java.
I am parsing the method signatures of a Java class and creating XML that describes the signature. I am also creating Java from the signatures to create Java code for another Java class.
| [reply] |
If you use XML as the "Esperanto" the generation of the XML version is fairy simple and with tools like XML::TreeBuilder and XML::Twig, parsing the "Esperanto" (XML) is easy and, very likely, given a good design for the XML, the Java drops out easily too.
DWIM is Perl's answer to Gödel
| [reply] |