ACM Home Page
Please provide us with feedback. Feedback
Prettyprinting
Full text PdfPdf (897 KB)
Source ACM Transactions on Programming Languages and Systems (TOPLAS) archive
Volume 2 ,  Issue 4  (October 1980) table of contents
Pages: 465 - 483  
Year of Publication: 1980
ISSN:0164-0925
Author
Dereck C. Oppen  Computer Systems Laboratory, Stanford University, Stanford, CA
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 7,   Downloads (12 Months): 50,   Citation Count: 22
Additional Information:

abstract   references   cited by   index terms  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/357114.357115
What is a DOI?

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.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

1
 
2
GOLDSTEIN, I. Pretty-printing, converting list to linear structure. Artificial Intelligence Laboratory Memo. No. 279, M.I.T., Cambridge, Mass., 1973.
 
3
HEARN, A.C., ANO NORMAN, A.C. A one-pass prettyprinter. Rep. UUCS-79-112, University of Utah, Salt Lake City, Utah, 1979.
 
4
KNUTH, D.E. Tan el~silon chi--A system for technical text. Rep. STAN-CS-78-675, Computer Science Dep., Stanford Univ., Stanford, Calif., 1978.
5
 
6
DONZEAU-GOUGE, V., HUET, G., KAHN, G., LANG, R., AND LEVY, J.J. A structure-oriented program editor; A first step towards computer assisted programming. Proc. Inter. Computing Syrup., Antibes, 1975.
 
7
GORDON, H. Paragraphing computer programs. M.Sc. Thesis, Univ. of Toronto, Toronto, Ontario, Canada, 1975.
8
 
9
HUET, G., KAHN, G., AND LANe, B. The MENTOR Program Manipulation System. Unpublished manuscript, 1978.
 
10
JoY, W. Berkeley Pascal PXP implementation notes. Manuscript, Dep. of Electrical Engineering and Computer Science, Univ. of California, Berkeley, Calif., 1979.
 
11
KNVTH, D.E. BLAISE--A TEX preprocessor for Pascal. To appear.
12
13
14
 
15
SCOWEN, R., ALLIN, D., HILLMAN, A., AND SHINELL, M. SOAP--A program which documents and edits Algol60 programs. Comput. J. 14, 2 (1971), 133-135.
 
16

CITED BY  22