Compiler Design Using Template “Meta-Programming”
Dr. Christian Trefftz, firstname.lastname@example.org
Compiler design is a well researched area of computer science. Typically, compiler designers use a parser generator framework like YACC or PCCTS to construct lexer, scanner, parser, and abstract syntax tree. With the arrival of expression templates and template meta-programming, it is possible to construct a parser by simply using the template meta-programming technique. The Spirit library is an object-oriented recursive-decent parser implemented in C++ using expression templates and meta-programming. In Spirit the parser is constructed at compile time using a combination of primitive parsers and fusing them through template meta-programming. TinyPascal is a practical application of the Spirit framework.
Gerzic, Amer, "Compiler Design Using Template “Meta-Programming”" (2007). Technical Library. 19.