The internal program structure of the code generator resembles the structure of the EBNF syntax. Therefore, in the following we give the EBNF syntax and the corresponding LISP functions.
The idea is to associate with each nonterminal symbol a function returning code for the corresponding construct; the returned code is appended to the already existing code. This ensures a (more or less) functional structure of the code generator. To avoid possible performance problems of the code generator, all calls to the expensive append are encapsulated in the macros doappend and addcode, where they could be replaced by cheaper nconc calls.
In this section the functions and macros of the code generator will be introduced. The descriptions of the function's parameters will not be given, so the reader should consult the source code, although the variable names should be self-explaining.
The source of the code generator has been written in a very functional style using only a small subset of COMMON LISP, having in mind a simple reimplementation of the code generator in RELFUN. Thus, we make extensive use of CONDs instead of using ecase, jump tables, and other specialities COMMON LISP is offering.