A language‐independent prettyprinter

Matti O. Jokinen · Software Practice and Experience · 1989

Abstract A general‐purpose prettyprinting program is presented. The input to the prettyprinter is a linear stream composed of visible symbols and elementary formatting instructions. The user can specify a set of alternative formats and the precedence of the alternatives. The prettyprinter attempts to select automatically the ‘best’ layout that fits on the bounded horizontal space available on the output medium. The prettyprinter is implemented as a library module, which makes it more flexible than many traditional prettyprinters that are written as main programs. For instance, formatted expressions can be mixed with plain text or displayed interactively on the user's terminal, and the application program can use several prettyprinters simultaneously.

Read the paper · More papers on PaperTik