Skip to main content

Parsing in a Broad Sense

  • Conference paper

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

Abstract

Having multiple representations of the same instance is common in software language engineering: models can be visualised as graphs, edited as text, serialised as XML. When mappings between such representations are considered, terms “parsing” and “unparsing” are often used with incompatible meanings and varying sets of underlying assumptions. We investigate 12 classes of artefacts found in software language processing, present a case study demonstrating their implementations and state-of-the-art mappings among them, and systematically explore the technical research space of bidirectional mappings to build on top of the existing body of work and discover as of yet unused relationships.

Keywords

  • Parsing
  • unparsing
  • pretty-printing
  • model synchronisation
  • technical space bridging
  • bidirectional model transformation

This is a preview of subscription content, access via your institution.

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques and Tools. Addison-Wesley (1985)

    Google Scholar 

  2. Hughes, J.: The Design of a Pretty-printing Library. In: AFP, pp. 53–96 (1995)

    Google Scholar 

  3. van den Brand, M.G.J., Visser, E.: Generation of Formatters for Context-Free Languages. ACM TOSEM 5(1), 1–41 (1996)

    CrossRef  Google Scholar 

  4. Ruckert, M.: Conservative Pretty-Printing. SIGPLAN Notices 23(2), 39–44 (1996)

    Google Scholar 

  5. Wadler, P.: A Prettier Printer (1997), http://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf

  6. de Jonge, M.: Pretty-Printing for Software Reengineering. In: ICSM. IEEE (2002)

    Google Scholar 

  7. van den Brand, M.G.J., Kooiker, A.T., Veerman, N.P., Vinju, J.J.: An Architecture for Context-sensitive Formatting. In: ICSM 2005 (2005)

    Google Scholar 

  8. Arnoldus, B., van den Brand, M., Serebrenik, A.: Less is More: Unparser-Completeness of Metalanguages for Template Engines. In: GPCE, pp. 137–146 (2011)

    Google Scholar 

  9. Bagge, A.H., Hasu, T.: A Pretty Good Formatting Pipeline. In: Erwig, M., Paige, R.F., Van Wyk, E. (eds.) SLE 2013. LNCS, vol. 8225, pp. 177–196. Springer, Heidelberg (2013)

    CrossRef  Google Scholar 

  10. Danielsson, N.A.: Correct-by-construction Pretty-printing. In: DTP. ACM (2013)

    Google Scholar 

  11. Matsuda, K., Wang, M.: FliPpr: A Prettier Invertible Printing System. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 101–120. Springer, Heidelberg (2013)

    Google Scholar 

  12. Stevens, P.: A Landscape of Bidirectional Model Transformations. In: Lämmel, R., Visser, J., Saraiva, J. (eds.) GTTSE 2007. LNCS, vol. 5235, pp. 408–424. Springer, Heidelberg (2008)

    Google Scholar 

  13. Bohannon, A., Foster, J.N., Pierce, B.C., Pilkiewicz, A., Schmitt, A.: Boomerang: Resourceful Lenses for String Data. In: POPL 2008, pp. 407–419. ACM (2008)

    Google Scholar 

  14. Zaytsev, V.: The Grammar Hammer of 2012. ACM CoRR 1212.4446, 1–32 (2012)

    Google Scholar 

  15. Brabrand, C., Møller, A.: Dual Syntax for XML Languages. In: Bierman, G., Koch, C. (eds.) DBPL 2005. LNCS, vol. 3774, pp. 27–41. Springer, Heidelberg (2005)

    CrossRef  Google Scholar 

  16. Duregård, J., Jansson, P.: Embedded Parser Generators. In: Haskell. ACM (2011)

    Google Scholar 

  17. Boulton, R.: Syn: A Single Language for Specifying Abstract Syntax Trees, Lexical Analysis, Parsing and Pretty-printing. University of Cambridge (1996)

    Google Scholar 

  18. Rendel, T., Ostermann, K.: Invertible Syntax Descriptions: Unifying Parsing and Pretty Printing. In: Haskell 2010, pp. 1–12. ACM (2010)

    Google Scholar 

  19. de Jonge, M., Visser, E.: An Algorithm for Layout Preservation in Refactoring Transformations. In: Sloane, A., Aßmann, U. (eds.) SLE 2011. LNCS, vol. 6940, pp. 40–59. Springer, Heidelberg (2012)

    CrossRef  Google Scholar 

  20. Zaytsev, V.: Case Studies in Bidirectionalisation. In: TFP 2014, pp. 51–58 (2014)

    Google Scholar 

  21. Bagge, A.H., Zaytsev, V.: Workshop on Open and Original Problems in Software Language Engineering. In: WCRE 2013, pp. 493–494. IEEE (2013)

    Google Scholar 

  22. 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 TOPLAS 29 (May 2007)

    Google Scholar 

  23. Czarnecki, K., Foster, J.N., Hu, Z., Lämmel, R., Schürr, A., Terwilliger, J.F.: Bidirectional Transformations: A Cross-Discipline Perspective. In: Paige, R.F. (ed.) ICMT 2009. LNCS, vol. 5563, pp. 260–283. Springer, Heidelberg (2009)

    CrossRef  Google Scholar 

  24. Klint, P., van der Storm, T., Vinju, J.: EASY Meta-programming with Rascal. In: Fernandes, J.M., Lämmel, R., Visser, J., Saraiva, J. (eds.) GTTSE 2009. LNCS, vol. 6491, pp. 222–289. Springer, Heidelberg (2011)

    Google Scholar 

  25. McCarthy, J.: The Inversion of Functions Defined by Turing Machines. In: Automata Studies, pp. 177–181 (1956)

    Google Scholar 

  26. Meertens, L.: Designing Constraint Maintainers for User Interaction (June 1998)

    Google Scholar 

  27. Richter, H.: Noncorrecting Syntax Error Recovery. ACM TOPLAS 7(3), 478–489 (1985)

    CrossRef  MATH  Google Scholar 

  28. Cox, A., Clarke, C.: Syntactic Approximation Using Iterative Lexical Analysis. In: IWPC 2003, pp. 154–163 (2003)

    Google Scholar 

  29. Murphy, G.C., Notkin, D.: Lightweight Lexical Source Model Extraction. ACM TOSEM 5(3), 262–292 (1996)

    CrossRef  Google Scholar 

  30. Zarwin, Z., Sottet, J.S., Favre, J.M.: Natural Modeling: Retrospective and Perspectives an Anthropological Point of View. In: XM 2012, pp. 3–8. ACM (2012)

    Google Scholar 

  31. Johnson, S.C.: YACC—Yet Another Compiler Compiler. Computer Science Technical Report 32, AT&T Bell Laboratories (1975)

    Google Scholar 

  32. van der Storm, T., Cook, W.R., Loh, A.: The Design and Implementation of Object Grammars. SCP (2014)

    Google Scholar 

  33. Wile, D.S.: Abstract Syntax from Concrete Syntax. In: ICSE. ACM (1997)

    Google Scholar 

  34. van den Brand, M.G.J., Vinju, J.J.: Rewriting with Layout. In: RULE (2000)

    Google Scholar 

  35. Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/XT 0.17. A Language and Toolset for Program Transformation. SCP 72(1-2), 52–70 (2008)

    MathSciNet  Google Scholar 

  36. Basten, H.J.S., Vinju, J.J.: Faster Ambiguity Detection by Grammar Filtering. In: LDTA (2010)

    Google Scholar 

  37. Erdweg, S., Rendel, T., Kästner, C., Ostermann, K.: Layout-Sensitive Generalized Parsing. In: Czarnecki, K., Hedin, G. (eds.) SLE 2012. LNCS, vol. 7745, pp. 244–263. Springer, Heidelberg (2013)

    CrossRef  Google Scholar 

  38. Salomon, D.J., Cormack, G.V.: Scannerless NSLR(1) Parsing of Programming Languages. In: PLDI 1989, pp. 170–178. ACM (1989)

    Google Scholar 

  39. Völter, M., Benz, S., Dietrich, C., Engelmann, B., Helander, M., Kats, L.C.L., Visser, E., Wachsmuth, G.: DSL Engineering. dslbook.org (2013)

    Google Scholar 

  40. Wang, M., Gibbons, J., Wu, N.: Incremental Updates for Efficient Bidirectional Transformations. In: ICFP 2011, pp. 392–403. ACM (2011)

    Google Scholar 

  41. Diskin, Z., Xiong, Y., Czarnecki, K.: From State- to Delta-Based Bidirectional Model Transformations: The Asymmetric Case. JOT 10, 1–25 (2011)

    CrossRef  Google Scholar 

  42. Diskin, Z., Xiong, Y., Czarnecki, K., Ehrig, H., Hermann, F., Orejas, F.: From State- to Delta-Based Bidirectional Model Transformations: The Symmetric Case. In: Whittle, J., Clark, T., Kühne, T. (eds.) MODELS 2011. LNCS, vol. 6981, pp. 304–318. Springer, Heidelberg (2011)

    CrossRef  Google Scholar 

  43. Hofmann, M., Pierce, B., Wagner, D.: Edit Lenses. In: POPL. ACM (2012)

    Google Scholar 

  44. de Jonge, M., Kats, L.C.L., Visser, E., Söderberg, E.: Natural and Flexible Error Recovery for Generated Modular Language Environments. ACM TOPLAS 34(4), 15:1–15:50 (2012)

    Google Scholar 

  45. Danvy, O.: Functional unparsing. JFP 8(6) (1998) 621–625

    Google Scholar 

  46. Asai, K., Kiselyov, O., Shan, C.-C.: Functional un|unparsing. Higher-Order and Symbolic Computation 24(4), 311–340 (2011)

    CrossRef  MATH  MathSciNet  Google Scholar 

  47. Zaytsev, V.: Formal Foundations for Semi-parsing. In: CSMR-WCRE (2014)

    Google Scholar 

  48. Bézivin, J., Kurtev, I.: Model-based Technology Integration with the Technical Space Concept. In: MIS. Springer (2005)

    Google Scholar 

  49. Parreiras, F.S., Staab, S., Winter, A.: On Marrying Ontological and Metamodeling Technical Spaces. In: ESEC-FSE, pp. 439–448. ACM (2007)

    Google Scholar 

  50. Bruneliére, H., Cabot, J., Jouault, F., Madiot, F.: MoDisco: A Generic and Extensible Framework for Model Driven Reverse Engineering. In: ASE (2010)

    Google Scholar 

  51. Ramón, Ó.S., Cuadrado, J.S., Molina, J.G.: Model-driven Reverse Engineering of Legacy Graphical User Interfaces. In: ASE, pp. 147–150. ACM (2010)

    Google Scholar 

  52. Rugaber, S., Stirewalt, K.: Model-Driven Reverse Engineering. IEEE Software 21(4), 45–53 (2004)

    CrossRef  Google Scholar 

  53. Diskin, Z.: Algebraic Models for Bidirectional Model Synchronization. In: Czarnecki, K., Ober, I., Bruel, J.-M., Uhl, A., Völter, M. (eds.) MODELS 2008. LNCS, vol. 5301, pp. 21–36. Springer, Heidelberg (2008)

    CrossRef  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Zaytsev, V., Bagge, A.H. (2014). Parsing in a Broad Sense. In: Dingel, J., Schulte, W., Ramos, I., Abrahão, S., Insfran, E. (eds) Model-Driven Engineering Languages and Systems. MODELS 2014. Lecture Notes in Computer Science, vol 8767. Springer, Cham. https://doi.org/10.1007/978-3-319-11653-2_4

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-11653-2_4

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-11652-5

  • Online ISBN: 978-3-319-11653-2

  • eBook Packages: Computer ScienceComputer Science (R0)