Skip to main content

Paisley: Pattern Matching à la Carte

  • Conference paper
Theory and Practice of Model Transformations (ICMT 2012)

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

Abstract

Professional development of software dealing with structured models requires more systematic approach and semantic foundations than standard practice in general-purpose programming languages affords. One remedy is to move to domain-specific environments. Here, instead, we present a tool for the implementation of pattern matching as fundamental means of automated data extraction from complex models in a general-purpose programming language. The interface is simple but, thanks to elaborate and rigorous design, is also light-weight, portable, non-invasive, type-safe, modular and extensible. It is compatible with object-oriented data abstraction and has full support for nondeterminism by backtracking. The tool comes as a library consisting of two levels: elementary pattern constructs (generic, highly reusable) and pattern bindings for particular data models (specific, fairly reusable, user-definable). Applications use the library code in a small number of idiomatic ways, making pattern-matching code declarative in style (yet retaining richer host-language semantics), easily writable, readable and maintainable. Library and idiom together form a tightly embedded domain-specific language; no extension of the host language is required. The current implementation is in Java, but assumes only standard object-oriented features, and can hence be ported to other mainstream languages.

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. Blomer, J., Geiß, R., Jakumeit, E.: The GrGen.NET User Manual (2011), http://www.grgen.net

  2. Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/XT Tutorial, Examples, and Reference Manual (latest). Department of Information and Computing Sciences, Universiteit Utrecht, Utrecht, The Netherlands (2006), http://www.strategoxt.org

  3. Horn, T., Ebert, J.: The GReTL Transformation Language. In: Cabot, J., Visser, E. (eds.) ICMT 2011. LNCS, vol. 6707, pp. 183–197. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  4. Hosoya, H., Pierce, B.C.: Regular expression pattern matching. In: ACM SIGPLAN–SIGACT Symposium on Principles of Programming Languages (POPL), London, England (2001); full version in Journal of Functional Programming, 13(6), 961–1004 (November 2003)

    Google Scholar 

  5. Lepper, M., Trancón y Widemann, B.: Optimization of Visitor Performance by Reflection-Based Analysis. In: Cabot, J., Visser, E. (eds.) ICMT 2011. LNCS, vol. 6707, pp. 15–30. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  6. Liu, J., Myers, A.C.: JMatch: Iterable Abstract Pattern Matching for Java. In: Dahl, V. (ed.) PADL 2003. LNCS, vol. 2562, pp. 110–127. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  7. Odersky, M., Spoon, L., Venners, B.: Programming in Scala. artima, 2nd edn. (2010)

    Google Scholar 

  8. Sloane, A.M., Kats, L.C.L., Visser, E.: A pure object-oriented embedding of attribute grammars. Electronic Notes in Theoretical Computer Science 253 (2010), http://wiki.kiama.googlecode.com/hg/papers/LDTA09.pdf

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Trancón y Widemann, B., Lepper, M. (2012). Paisley: Pattern Matching à la Carte. In: Hu, Z., de Lara, J. (eds) Theory and Practice of Model Transformations. ICMT 2012. Lecture Notes in Computer Science, vol 7307. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-30476-7_16

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-30476-7_16

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-30475-0

  • Online ISBN: 978-3-642-30476-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics