FelixGeator:

It's certainly possible, though I've not written exactly that. One thing I do every once in a while is to write a program that will read a spreadsheet (that define simple requirements) and use it to generate a program. For example, on a previous job I was asked to create a parser for a horribly complicated ASCII report and convert it into a set of flat files suitable to import into a database.

I told them "OK, if you give me an Excel spreadsheet describing exactly what you want in the format I specify, I'll give you a program that will do what you want." The spreadsheet was pretty simple: the first page described the input file & fields, the second page described the output file & fields, and the third page specified how to map and transform the input fields into the output fields. Perl wasn't installed on the destination machine, so my program wrote a C++ program that did the work. I also gave them the perl program so if they wanted simple changes, they could do it themselves.

That program was very useful, as it saved me a great deal of trouble on that project (in fact, they used it for several other projects too, so it saved me a *lot* of headaches). For years afterwards, I would get requests to add another feature (transformation type) to the perl program. For example, they wanted to generate flat files to send to the mainframe, so they asked for a TO_EBCDIC transformation so they could output COMP-3 fields to the mainframe.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


In reply to Re: Programs that write programs by roboticus
in thread Programs that write programs by FelixGeator

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.