Skip to main content

A Pretty Good Formatting Pipeline

  • Conference paper
Software Language Engineering (SLE 2013)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 8225))

Included in the following conference series:

Abstract

Proper formatting makes the structure of a program apparent and aids program comprehension. The need to format code arises in code generation and transformation, as well as in normal reading and editing situations. Commonly used pretty-printing tools in transformation frameworks provide an easy way to produce indented code that is fairly readable for humans, without reaching the level of purpose-built reformatting tools, such as those built into IDEs. This paper presents a library of pluggable components, built to support style-based formatting and reformatting of code, and to enable further experimentation with code formatting.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. van den Brand, M.G.J., Visser, E.: Generation of formatters for context-free languages. ACM Transactions on Software Engineering and Methodology 5(1), 1–41 (1996)

    Article  Google Scholar 

  2. Chitil, O.: Pretty printing with lazy dequeues. ACM Trans. Program. Lang. Syst. 27, 163–184 (2005)

    Article  Google Scholar 

  3. Coutaz, J.: A layout abstraction for user-system interface. SIGCHI Bull. 16(3), 18–24 (1985), http://doi.acm.org/10.1145/1044201.1044202

    Article  Google Scholar 

  4. Flatt, M.: PLT: Reference: Racket. Tech. Rep. PLT-TR-2010-1, PLT Inc (2010), http://racket-lang.org/tr1/

  5. Hughes, J.: The design of a pretty-printing library. In: Jeuring, J., Meijer, E. (eds.) AFP 1995. LNCS, vol. 925, pp. 53–96. Springer, Heidelberg (1995)

    Chapter  Google Scholar 

  6. Jackson, S., Devanbu, P., Ma, K.L.: Stable, flexible, peephole pretty-printing. Science of Computer Programming 72(1-2), 40–51 (2008)

    Article  MathSciNet  Google Scholar 

  7. James, R.P., Sabry, A.: Yield: Mainstream delimited continuations. In: First International Workshop on the Theory and Practice of Delimited Continuations, TPDC 2011 (May 2011)

    Google Scholar 

  8. de Jonge, M.: A pretty-printer for every occasion. In: Ferguson, I., Gray, J., Scott, L. (eds.) Proceedings of the 2nd International Symposium on Constructing Software Engineering Tools (CoSET 2000), University of Wollongong, Australia, pp. 68–77 (June 2000)

    Google Scholar 

  9. Kiselyov, O., Peyton-Jones, S., Sabry, A.: Lazy v. Yield: Incremental, linear pretty-printing. In: Jhala, R., Igarashi, A. (eds.) APLAS 2012. LNCS, vol. 7705, pp. 190–206. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  10. Klint, P., van der Storm, T., Vinju, J.: Rascal: A domain specific language for source code analysis and manipulation. In: SCAM 2009: Proceedings of the 2009 Ninth IEEE International Working Conference on Source Code Analysis and Manipulation, pp. 168–177. IEEE Computer Society, Washington, DC (2009)

    Chapter  Google Scholar 

  11. McKeeman, W.M.: Algorithm 268: Algol 60 reference language editor. Commun. ACM 8(11), 667–668 (1965)

    Article  Google Scholar 

  12. Miara, R.J., Musselman, J.A., Navarro, J.A., Shneiderman, B.: Program indentation and comprehensibility. Commun. ACM 26(11), 861–867 (1983)

    Article  Google Scholar 

  13. Okasaki, C.: Purely Functional Data Structures. Cambridge University Press (1999)

    Google Scholar 

  14. Oppen, D.C.: Prettyprinting. ACM Trans. Program. Lang. Syst. 2, 465–483 (1980)

    Article  Google Scholar 

  15. Reiss, S.P.: Automatic code stylizing. In: 22nd IEEE/ACM International Conference on Automated Software Engineering (ASE), Atlanta, Georgia, pp. 74–83 (November 2007)

    Google Scholar 

  16. Swierstra, S.D.: Linear, online, functional pretty printing (corrected and extended version). Tech. Rep. UU-CS-2004-025a, Department of Information and Computing Sciences, Utrecht University (2004)

    Google Scholar 

  17. Swierstra, S.D., Chitil, O.: Linear, bounded, functional pretty-printing. Journal of Functional Programming 19(1), 1–16 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  18. Wadler, P.: A prettier printer. In: Gibbons, J., de Moor, O. (eds.) The Fun of Programming. Cornerstones of Computing. Palgrave Macmillan (June 2005)

    Google Scholar 

  19. Wadler, P., Taha, W., Macqueen, D.: How to add laziness to a strict language without even being odd. In: Workshop on Standard ML, Baltimore, Maryland (1998)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer International Publishing Switzerland

About this paper

Cite this paper

Bagge, A.H., Hasu, T. (2013). A Pretty Good Formatting Pipeline. In: Erwig, M., Paige, R.F., Van Wyk, E. (eds) Software Language Engineering. SLE 2013. Lecture Notes in Computer Science, vol 8225. Springer, Cham. https://doi.org/10.1007/978-3-319-02654-1_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-02654-1_10

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-02653-4

  • Online ISBN: 978-3-319-02654-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics