|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Vreda Pieterse , Derrick G. Kourie , Andrew Boake, A case for contemporary literate programming, Proceedings of the 2004 annual research conference of the South African institute of computer scientists and information technologists on IT research in developing countries, p.2-9, October 04-06, 2004, Stellenbosch, Western Cape, South Africa
|
|
|
|
|
|
Daniel C. Wang , Andrew W. Appel , Jeff L. Korn , Christopher S. Serra, The Zephyr abstract syntax description language, Proceedings of the Conference on Domain-Specific Languages on Conference on Domain-Specific Languages (DSL), 1997, p.17-17, October 15-17, 1997, Santa Barbara, California
|
|
|
Rickard E. Faith , Lars S. Nyland , Jan F. Prins, KHEPERA: a system for rapid implementation of domain specific languages, Proceedings of the Conference on Domain-Specific Languages on Conference on Domain-Specific Languages (DSL), 1997, p.19-19, October 15-17, 1997, Santa Barbara, California
|
|
|
|
|
|
|
|
|
Stoney Jackson , Premkumar Devanbu , Kwan-Liu Ma, Stable, flexible, peephole pretty-printing, Science of Computer Programming, v.72 n.1-2, p.40-51, June, 2008
|
|
|
|
|
|
|
|