Friday, August 05, 2005

A Boo code generator in Boo ;)

Its most commonly known to .NET developers as "CodeDom", a language abstracted way to generate code in another language. ;)

I started rewriting Boo.Lang.CodeDom in Boo; the original was in C#, and had numerous bugs. I'm actually kind of suprised that it worked at all, but it seems the samples that shipped with Boo never really touched the broken functionality. To make sure this doesn't happen I've written a unit test for each and every expression and statement that can be generated by System.CodeDom, and about 34 of 39 unit tests are working.

I've been using the Boo.Lang.Compiler API to 'bind' CodeDom elements to Boo's AST, so it will always generate proper Boo syntax.

I'm a bit of the way there, and when I'm done, well... .... eh.

And to think, all this came out of me trying to fix an annoying bug in the C# version of Boo.Lang.CodeDom ;)

No comments: