Prettyprinting

57Citations
Citations of this article
33Readers
Mendeley users who have this article in their library.

Abstract

An algorithm for prettyprinting is given. For an input stream of length n and an output device with linewidth m, the algorithm requires time O(n) and space O(m). The algorithm is described in terms of two parallel processes: the first scans the input stream to determine the space required to print logical blocks of tokens; the second uses this information to decide where to break lines of text; the two processes communicate by means of a buffer of size O(m). The algorithm does not wait for the entire stream to be input, but begins printing as soon as it has received a full line of input. The algorithm is easily implemented. © 1980, ACM. All rights reserved.

Cite

CITATION STYLE

APA

Oppen, D. C. (1980). Prettyprinting. ACM Transactions on Programming Languages and Systems (TOPLAS), 2(4), 465–483. https://doi.org/10.1145/357114.357115

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free