Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1007/978-3-642-37036-6_6guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
Article

FliPpr: a prettier invertible printing system

Published: 16 March 2013 Publication History
  • Get Citation Alerts
  • Abstract

    When implementing a programming language, we often write a parser and a pretty-printer. However, manually writing both programs is not only tedious but also error-prone; it may happen that a pretty-printed result is not correctly parsed. In this paper, we propose FliPpr, which is a program transformation system that uses program inversion to produce a CFG parser from a pretty-printer. This novel approach has the advantages of fine-grained control over pretty-printing, and easy reuse of existing efficient pretty-printer and parser implementations.

    References

    [1]
    Baker, B. S.: Composition of Top-down and Bottom-up Tree Transductions. Information and Control 41(2), 186-213 (1979)
    [2]
    Boulton, R. J.: Syn: A Single Language for Specifiying Abstract Syntax Tress, Lexical Analysis, Parsing and Pretty-Printing. Technical Report UCAM-CL-TR-390, University of Cambridge Computer Laboratory (1996)
    [3]
    Brabrand, C., Møller, A., Schwartzbach, M. I.: Dual Syntax for XML Languages. Inf. Syst. 33(4-5), 385-406 (2008)
    [4]
    Duregård, J., Jansson, P.: Embedded Parser Generators. In: Haskell 2011: Proceedings of the 2011 ACM SIGPLAN Haskell Symposium, pp. 107-117. ACM (2011)
    [5]
    Duregård, J., Jansson, P., Wang, M.: Feat: Functional Enumeration of Algebraic Types. In: Haskell 2012: Proceedings of the 2012 ACM SIGPLAN Haskell Symposium, pp. 61-72. ACM (2012)
    [6]
    Foster, J. N., Greenwald, M. B., Moore, J. T., Pierce, B.C., Schmitt, A.: Combinators for Bidirectional Tree Transformations: A Linguistic Approach to the View-Update Problem. ACM Trans. Program. Lang. Syst. 29(3) (2007)
    [7]
    Foster, J. N., Pilkiewicz, A., Pierce, B.C.: Quotient Lenses. In: ICFP 2008: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, pp. 383-396. ACM (2008)
    [8]
    Frost, R. A., Hafiz, R., Callaghan, P.: Parser Combinators for Ambiguous Left-Recursive Grammars. In: Hudak, P., Warren, D. S. (eds.) PADL 2008. LNCS, vol. 4902, pp. 167-181. Springer, Heidelberg (2008)
    [9]
    Fülöp, Z., Vogler, H.: Syntax-Directed Semantics: Formal Models Based on Tree Transducers, 1st edn. Springer-Verlag New York, Inc., Secaucus (1998)
    [10]
    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)
    [11]
    Jansson, P., Jeuring, J.: Polytypic Data Conversion Programs. Sci. Comput. Program. 43(1), 35-75 (2002)
    [12]
    Jonsson, P. A., Nordlander, J.: Positive Supercompilation for a Higher Order Callby-Value Language. In: POPL 2009: Proceedings of the 36th ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, pp. 277-288. ACM (2009)
    [13]
    Kobayashi, N., Tabuchi, N., Unno, H.: Higher-Order Multi-Parameter Tree Transducers and Recursion Schemes for Program Verification. In: POPL 2010: Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 495-508. ACM (2010)
    [14]
    Kühnemann, A., Glück, R., Kakehi, K.: Relating Accumulative and Nonaccumulative Functional Programs. In: Middeldorp, A. (ed.) RTA 2001. LNCS, vol. 2051, pp. 154-168. Springer, Heidelberg (2001)
    [15]
    Matsuda, K., Mu, S.-C., Hu, Z., Takeichi, M.: A Grammar-Based Approach to Invertible Programs. In: Gordon, A. D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 448-467. Springer, Heidelberg (2010)
    [16]
    Might, M., Darais, D., Spiewak, D.: Parsing with Derivatives: A Functional Pearl. In: ICFP 2011: Proceeding of the 16th ACM SIGPLAN International Conference on Functional Programming, pp. 189-195. ACM (2011)
    [17]
    Rendel, T., Ostermann, K.: Invertible Syntax Descriptions: Unifying Parsing and Pretty Printing. In: Haskell 2010: Proceedings of the 2010 ACM SIGPLAN Haskell Symposium, pp. 1-12. ACM (2010)
    [18]
    Sands, D.: Proving the Correctness of Recursion-Based Automatic Program Transformations. Theor. Comput. Sci. 167(1&2), 193-233 (1996)
    [19]
    Søndergaard, H., Sestoft, P.: Non-Determinism in Functional Languages. Comput. J. 35(5), 514-523 (1992)
    [20]
    Sørensen, M. H., Glück, R., Jones, N. D.: A Positive Supercompiler. J. Funct. Program. 6(6), 811-838 (1996)
    [21]
    Wadler, P.: Deforestation: Transforming Programs to Eliminate Trees. Theor. Comput. Sci. 73(2), 231-248 (1990)
    [22]
    Wadler, P.: A Prettier Printer. In: Gibbons, J., de Moor, O. (eds.) The Fun of Programming. Palgrave Macmillan (2003)

    Cited By

    View all
    • (2023)Embedding by UnembeddingProceedings of the ACM on Programming Languages10.1145/36078307:ICFP(1-47)Online publication date: 31-Aug-2023
    • (2021)Haskell⁻¹: automatic function inversion in HaskellProceedings of the 14th ACM SIGPLAN International Symposium on Haskell10.1145/3471874.3472982(41-55)Online publication date: 18-Aug-2021
    • (2020)Sparcl: a language for partially-invertible computationProceedings of the ACM on Programming Languages10.1145/34090004:ICFP(1-31)Online publication date: 3-Aug-2020
    • Show More Cited By

    Index Terms

    1. FliPpr: a prettier invertible printing system
      Index terms have been assigned to the content through auto-classification.

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image Guide Proceedings
      ESOP'13: Proceedings of the 22nd European conference on Programming Languages and Systems
      March 2013
      613 pages
      ISBN:9783642370359

      Sponsors

      • Sapienza: Sapienza University of Rome

      In-Cooperation

      • EAPLS: European Association for Programming Languages and Systems
      • EATCS: European Association for Theoretical Computer Science
      • European Association of Software Science and Technology

      Publisher

      Springer-Verlag

      Berlin, Heidelberg

      Publication History

      Published: 16 March 2013

      Qualifiers

      • Article

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)0
      • Downloads (Last 6 weeks)0

      Other Metrics

      Citations

      Cited By

      View all
      • (2023)Embedding by UnembeddingProceedings of the ACM on Programming Languages10.1145/36078307:ICFP(1-47)Online publication date: 31-Aug-2023
      • (2021)Haskell⁻¹: automatic function inversion in HaskellProceedings of the 14th ACM SIGPLAN International Symposium on Haskell10.1145/3471874.3472982(41-55)Online publication date: 18-Aug-2021
      • (2020)Sparcl: a language for partially-invertible computationProceedings of the ACM on Programming Languages10.1145/34090004:ICFP(1-31)Online publication date: 3-Aug-2020
      • (2020)Invertible Bidirectional Metalogical Translation Between Prolog and RuleML for Knowledge Representation and QueryingRules and Reasoning10.1007/978-3-030-57977-7_8(112-128)Online publication date: 29-Jun-2020
      • (2018)Embedding invertible languages with binders: a case of the FliPpr languageACM SIGPLAN Notices10.1145/3299711.324275853:7(158-171)Online publication date: 17-Sep-2018
      • (2018)Embedding invertible languages with binders: a case of the FliPpr languageProceedings of the 11th ACM SIGPLAN International Symposium on Haskell10.1145/3242744.3242758(158-171)Online publication date: 17-Sep-2018
      • (2018)Synthesizing quotient lensesProceedings of the ACM on Programming Languages10.1145/32367752:ICFP(1-29)Online publication date: 30-Jul-2018
      • (2016)Parsing and reflective printing, bidirectionallyProceedings of the 2016 ACM SIGPLAN International Conference on Software Language Engineering10.1145/2997364.2997369(2-14)Online publication date: 20-Oct-2016
      • (2013)Correct-by-construction pretty-printingProceedings of the 2013 ACM SIGPLAN workshop on Dependently-typed programming10.1145/2502409.2502410(1-12)Online publication date: 24-Sep-2013

      View Options

      View options

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media