go ahead... be a heretic | |
PerlMonks |
Code Generationby hackdaddy (Hermit) |
on Dec 16, 2005 at 08:00 UTC ( [id://517164]=perlquestion: print w/replies, xml ) | Need Help?? |
hackdaddy has asked for the wisdom of the Perl Monks concerning the following question:
Tonight I wrote a Perl script to perform code generation the old-fashioned way by concatenating strings and pushing the strings on an array of text lines.
I used Java code as input, parsed it, and generated XML and Java code for a project at work. (Don't ask me why I am doing this, it's just what the project requires.) I had to do some mapping between function calls. The XML describes function calls but its types are much more primitive. I used a hash to map between types. Anyway, I can sense there is a better way to generate chunks of XML and Java code using object-oriented Perl. It would be nifty if I could build an Esperanto or intermediate object and then output it as XML or Java code as needed. Any ideas or code samples are appreciated. Thanks.
Back to
Seekers of Perl Wisdom
|
|