This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
Syntax-Directed Pretty Printing-A First Step Towards a Syntax-Directed Editor
March 1983 (vol. 9 no. 2)
pp. 119-127
L.F. Rubin, Prime Computer, Inc.
A language-independent syntax-directed pretty printer has been implemented as the first step towards building a language-independent syntax-directed editor. The syntax-directed pretty printer works in two phases: the grammar processing phase and the program processing phase. In the grammar processing stage, a grammar which contains a context-free grammar and information for the parser and pretty printer is processed and all files needed by the second phase are written. With these files, the syntax-directed pretty printer works for the language of the grammar. The syntax-directed editor would use the same grammar processing phase to construct the files needed to make it work for a specific language. In the program processing phase, programs in the language of the grammar are parsed and parse trees are built. If syntax errors are found, error messages are produced and error recovery is done. The parse trees are pretty printed according to the pretty printer specifications given in the grammar, resulting in well-indented, syntactically clear programs.
Index Terms:
syntax-directed editor, Editor generator, formatter, language-independence, pretty printer, programming environments
Citation:
L.F. Rubin, "Syntax-Directed Pretty Printing-A First Step Towards a Syntax-Directed Editor," IEEE Transactions on Software Engineering, vol. 9, no. 2, pp. 119-127, March 1983, doi:10.1109/TSE.1983.236456
Usage of this product signifies your acceptance of the Terms of Use.