You will want to have a look at Chapter 17, Template Driven Code Generation, in the "Advanced Perl Programming" book. This uses a C like language to specify object models to generate C++ headers and SQL statements.

The classical reference for this type of stuff is of course: Little Languages. In: More Programming Pearls: Confessions of a Coder. John Bentley. Association for Computing Machinery, 1988. (BTW, if anyone out there has a copy of this book that he wants to sell, I would really, really like to buy it!)

Another really easy syntax to set things like this up would be a LISP like (prefix) syntax (e.g., like Excel functions do it). You can easily parse this stuff and implement it by functions that you call from a central dispatcher.

As for verbosity, it seems that all XML based stuff is incredibly verbose, so I doubt that this is such a good choice. Besides that, people who can write XML will be able to handle a CGI form, too. You will need a syntax simpler than that, IMHO. As mentioned above, I really like this Excel function like syntax - it is easy to implement, and users have got used to it.

Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com


In reply to Re: XML to CGI form by clemburg
in thread XML to CGI form by BastardOperator

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.