My BNF -> parser assembler translator works! 2005-04-22


As part of my parser assembler work, I've gotten my BNF to parser assembler translator to translate it's own BNF to parser assembler equivalent to it's own parser... In other words, it's successfully bootstrapped.

There are still some holes to plug, and the code is a real mess, but this means that the BNF generator is somewhat usable... Saves a lot of work - the BNF for the BNF parser is around 60 lines including whitespace, while the generated "assembly" is 340 lines. The 60 lines include trigger annotations and some error handling. That brings the total for the BNF tool to 600 lines (BNF + C++) - not bad, though it'll easily grow a few hundred lines as I clean up the code and turn it into a bit more polished application (currently it only reads from standard in and writes to standard out, for instance...). There's also certainly room for generating more optimal "assembly".

If I get time I'll post the code this weekend or next (depending on whether I actually get myself to read for my exam on Monday).


blog comments powered by Disqus