[Journal - .NET Console Revamp]

.NET Console Revamp

Sunday, May 22, 2005

Finally! I've managed to write a tokenizer, and a parser, and reworked .NET Console to use a syntax tree.

The old version would do everything directly on strings, splitting, trimming, balancing parens, quotes, and escapes like there was no tomorrow, in between chatting with System.Reflection. Talk about separation of concerns. While .NET Console had started out innocently enough, more and more features (ahem, language support) got added, and it's a miracle it worked so well.

But it's mostly a good thing to "throw one away", and it's been so in this case. With the tokenizer done, the parser wasn't all that hard to write. The evaluation engine was easiest to implement. It's a good deal smaller than the old stuff, while reusing some existing code (like that for overload resolution and more general .NET Console goodies). I got all of the quirks right in a short time.

See the project page for more.