================================================================================ P9506 M.G.J. van den Brand & E. Visser "Generation of Formatters for Context-free Languages" Good documentation is important for the production of reusable and maintainable software. For the production of accurate documentation it is necessary that the original program text is not copied manually to obtain a typeset version. Aside of being tedious, this will invariably lead to errors. Tools that support the production of legible and accurate documentation are essential in software engineering. The production of such tools is a software engineering challenge in itself. We present an algebraic approach to the generation of tools that produce typographically effective presentations of computer programs. A specification of a formatter is generated from the context-free grammar of a programming language. These genererated formatters translate abstract syntax trees of programs into box expressions. These box expressions are translated by language independent interpreters of the box language into ASCII or TeX. The formatting rules that are generated can easily be fine tuned in order to get the desired exact formatting of programs. A practical solution for the problem of formatting comments, which occur in the original text, is also presented. Furthermore, two examples of generated formatters, for Cobol and for a process specifcation language, are discussed in some detail.