Super Tiny Compiler
Nice, but it needs to say up front what it does (i.e., compile a Lisp-ish PL to a C-ish PL).<p>EDIT. After a bit of analysis:<p>The <i>lexer</i> is basically a state machine. Each kind of token consists entirely of characters in a single class, so the usual state machine is modified to give some states a while loop that goes through characters until the token ends.<p>The <i>parser</i> is basically recursive-descent. The grammar is awfully simple, so only one parsing function (walk) is needed.<p>The <i>transformer</i> traverses the AST, identifies function calls, and produces a new AST with function calls marked. I'm not sure why the transformer is written as a separate piece of code. It seems to me that the functionality it adds could easily be integrated into either the parser or the code generator. And then the compiler would be even tinier.<p>And the <i>code generator</i> traverses the transformed AST and spits out C-like code.