As you have probably guessed from the section title, the processing of DSL's proceeds exactly as for general purpose languages.The lexical analysis splits the text based on the special characters: I find it helpful to think of the AST as the in-memory representation of the instructions for the next processing step.Back then, it was practically unheard of to do this.

dating dummies-11

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.

A regular expression is a series of commands to find a substring of a larger string based on its shape rather than the exact text - so it was pattern matching for text.

A regular expression is made up of a number of actions - basically telling the interpreter what to do to find the string.

At that time, "machine" meant a CPU instruction set - so this was machine operation code being generated.

Having learnt all compiling languages like FORTRAN and PL/I, my second job - way before the PC, let alone the dreaded CASE tools - was to build a code generator to create CRUD applications.

We're interested in code generators, but the regular expression handler in my editor is interpreted; the same AST works equally well.

Each node in the AST is an instance of a class, with qualifying attributes (e.g.

Something like this: (If you know regular expression, please forgive the conversion of '.*' into 'rest Of Line' - it would be strictly correct as a 'zero Or More' plus 'any Character' combination.) While lengthy regular expressions demand patience and humility to debug, in their domain (pattern-based text searching) they are sharper and faster than the general-purpose alternative.

This is characteristic of a good DSL: its conciseness aids thinking because there is a direct correspondence between how an expert thinks and the symbols of the DSL.

In thousands of lines, we often want to find where the initialization is finished for a particular run, so there is a line like: The '^' matches the beginning of the line and then the characters "21:" select the 9pm timeframe.