On 12/21/06, Marvin Humphrey <[EMAIL PROTECTED]> wrote:
On Dec 18, 2006, at 11:08 PM, David Balmain wrote:
> I need to think a little more about this but a code generator seems
> like the best way to go so +1.
While you were away I wrote one in Perl called "boilerplater.pl" and
integrated it into KinoSearch. The implementation turned out to be
somewhat more elaborate than I'd originally planned, because it
parses all header files and builds a model of the entire object
hierarchy before generating any code. However, once it was mostly
finished, all of a sudden everything else got a lot easier. :)
Note that because this is a code generator which produces
deterministic output directly from C source code, Perl is only
required on the developer's system (and there are no dependencies
other than Perl 5.6). I thought about using Ruby or Java, because I
didn't want to appear partisan, but oh well. :) It could be re-
implemented if need be, though there's a lot of the kind of text
wrangling which is Perl's strong suit.
Actually, Perl would me my preference. I think it is probably the most
ubiquitous and I have no problem with it being a requirement on the
developers machine.
Here's some generated code, for the TopDocCollector class:
<snip>generated code links</snip>
This looks good. Does this take away the need to bootstrap the objects
on start up? Maybe you cover this in a different email. I'll check
now. It's looking very cool so far.
--
Dave Balmain
http://www.davebalmain.com/