The short answer is: I didn't want to be tied to Perl; AppML can generate code in any programming language. (Although Perl is the first one.)

Here's AppML output:

nferraz@debian:~/appml$ ./appml.pl xml/sample.xml meta/db/create.tmpl -> sample/db/create.sql meta/db/view.tmpl -> sample/db/view.sql meta/db/stats.tmpl -> sample/db/stats.sql meta/db/drop.tmpl -> sample/db/drop.sql meta/pl/base.tmpl -> sample/lib/sample.pm meta/pl/base_cdbi.tmpl -> sample/lib/sample/cdbi.pm meta/pl/cdbi.tmpl -> sample/lib/sample/cdbi/contact.pm meta/templates/header.tmpl -> sample/templates/inc/header.tt2 meta/templates/menu.tmpl -> sample/templates/inc/menu.tt2 meta/templates/stats.tmpl -> sample/templates/inc/stats.tt2 meta/templates/footer.tmpl -> sample/templates/inc/footer.tt2 meta/templates/frm.tmpl -> sample/templates/contact/frm_contact.tt2 meta/templates/detail.tmpl -> sample/templates/contact/detail_contact. +tt2 meta/templates/list.tmpl -> sample/templates/contact/list_contact.tt2 meta/templates/tbl.tmpl -> sample/templates/contact/tbl_contact.tt2 meta/doc/install.tmpl -> sample/doc/INSTALL meta/doc/plan.tmpl -> sample/doc/sample.html meta/doc/dot.tmpl -> sample/doc/sample.dot meta/data/strings.tmpl -> sample/data/sample.txt
As you can see, the source metafiles are divided in directories: These metafiles are nothing more than text templates, used to generate code; if I wanted to generate Java code, I would probably create a new directory to store Java metafiles.

In reply to Re^2: Code Generation in Perl by nferraz
in thread Code Generation in Perl by nferraz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.