Code Generation for Dummies Matthew Fowler New Technology / enterprise, When I was a lad, code generation referred to the final phase of a compiler.Having digested your source code, the compiler would pump out the "code" for the target machine.
Back then, it was practically unheard of to do this.
These days, 'code generation' is so well established that Wikipedia has a new meaning for it - i.e.
"source code generation" rather than "machine code generation"...
and it has all sorts of new terms and ideas swirling around it.
It turns out that there are fundamental similarities between the old and new versions "code generation, and comparing them helps us understand the similarities.
It is a good place to start to understand today's code generation landscape.
I'm going to start by drilling down into old "code generation" and compare it relationship to DSLs and modelling ... Using this common basis, I'll explain the reason behind the recent fashion for "XML with everything" and the de-facto standard approach to defining languages in XML.
Finally, I will actually describe the first steps in code generation.
Something Old A compiler runs through a number of phases in processing an input language program: The two main tool-sets I know of to help with compiler construction are the LEX/YACC pair from UNIX and ANTLR.