Skip to main content

Walk Your Tree Any Way You Want

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

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

Abstract

Software transformations in the Nuthatch style are described as walks over trees (possibly graphs) that proceed in programmer-defined steps which may observe join points of the walk, may observe and affect state associated with the walk, may rewrite the walked tree, may contribute to a built tree, and must walk somewhere, typically along one branch or another. The approach blends well with OO programming. We have implemented the approach in the Nuthatch/J library for Java.

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 54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 72.00
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. Aho, A.V., Ullman, J.D.: Translations on a Context-Free Grammar. Information and Control 19(5), 439–475 (1971)

    Article  MathSciNet  Google Scholar 

  2. Balland, E., Brauner, P., Kopetz, R., Moreau, P.E., Reilles, A.: Tom: Piggybacking Rewriting on Java. In: Baader, F. (ed.) RTA 2007. LNCS, vol. 4533, pp. 36–47. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  3. Bravenboer, M., van Dam, A., Olmos, K., Visser, E.: Program Transformation with Scoped Dynamic Rewrite Rules. Fundamenta Informaticae 69(1-2), 123–178 (2006)

    MathSciNet  MATH  Google Scholar 

  4. Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/XT 0.17. A language and toolset for program transformation. Sci. Comput. Program. 72(1-2), 52–70 (2008)

    Article  MathSciNet  Google Scholar 

  5. Comon, H., Dauchet, M., Gilleron, R., Löding, C., Jacquemard, F., Lugiez, D., Tison, S., Tommasi, M.: Tree Automata Techniques and Applications (2007), http://www.grappa.univ-lille3.fr/tata (release October 12, 2007)

  6. Cordy, J.R.: The TXL source transformation language. Sci. Comput. Program. 61(3), 190–210 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  7. George, L., Wider, A., Scheidgen, M.: Type-Safe Model Transformation Languages as Internal DSLs in Scala. In: Hu, Z., de Lara, J. (eds.) ICMT 2012. LNCS, vol. 7307, pp. 160–175. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  8. Huet, G.: The Zipper. J. Funct. Program. 7(5), 549–554 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  9. Jouault, F., Allilaire, F., Bézivin, J., Kurtev, I.: ATL: A model transformation tool. Sci. Comput. Program. 72(1-2), 31–39 (2008)

    Article  MATH  Google Scholar 

  10. Kalleberg, K.T., Visser, E.: Combining Aspect-Oriented and Strategic Programming. In: Workshop on Rule-Based Programming (RULE 2005). ENTCS, vol. 147, pp. 5–30 (2006)

    Google Scholar 

  11. Kalleberg, K.T., Visser, E.: Strategic Graph Rewriting: Transforming and Traversing Terms with References. In: 6th Intl. Workshop on Reduction Strategies in Rewriting and Programming (WRS 2006) (2006), online publication

    Google Scholar 

  12. Kalleberg, K.T., Visser, E.: Fusing a Transformation Language with an Open Compiler. In: 7th Workshop on Language Descriptions, Tools and Applications (LDTA 2007). ENTCS, pp. 18–31. Elsevier (2007)

    Google Scholar 

  13. Klint, P., van der Storm, T., Vinju, J.J.: Rascal: A Domain Specific Language for Source Code Analysis and Manipulation. In: 9th IEEE Intl. Working Conf. on Source Code Analysis and Manipulation (SCAM 2009), pp. 168–177. IEEE CS (2009)

    Google Scholar 

  14. Lämmel, R.: The Sketch of a Polymorphic Symphony. In: Reduction Strategies in Rewriting and Programming (WRS 2002). ENTCS, vol. 70, pp. 135–155 (2002)

    Google Scholar 

  15. Lämmel, R., Peyton Jones, S.L.: Scrap your boilerplate: a practical design pattern for generic programming. In: ACM SIGPLAN Intl. Workshop on Types in Languages Design and Implementation (TLDI 2003), pp. 26–37. ACM (2003)

    Google Scholar 

  16. Lämmel, R., Thompson, S., Kaiser, M.: Programming errors in traversal programs over structured data. Sci. Comput. Program (2012) (in press), doi:10.1016/j.scico.2011.11.006

    Google Scholar 

  17. Lämmel, R., Visser, E., Visser, J.: Strategic programming meets adaptive programming. In: 2nd Intl. Conf. on Aspect-Oriented Software Development (AOSD 2003), pp. 168–177 (2003)

    Google Scholar 

  18. Lämmel, R., Visser, J.: A Strafunski Application Letter. In: Dahl, V. (ed.) PADL 2003. LNCS, vol. 2562, pp. 357–375. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  19. Lieberherr, K.J., Patt-Shamir, B., Orleans, D.: Traversals of object structures: Specification and Efficient Implementation. ACM Transactions on Programming Languages and Systems 26(2), 370–412 (2004)

    Article  Google Scholar 

  20. Mens, T., Van Gorp, P.: A taxonomy of model transformation. ENTCS, vol. 152, pp. 125–142 (2006)

    Google Scholar 

  21. Moreau, P.E., Reilles, A.: Rules and Strategies in Java. In: Reduction Strategies in Rewriting and Programming (WRS 2007). ENTCS, vol. 204, pp. 71–82 (2008)

    Google Scholar 

  22. Palsberg, J., Jay, C.B.: The Essence of the Visitor Pattern. In: 22nd Intl. Computer Software and Applications Conf (COMPSAC 1998), pp. 9–15. IEEE Computer Society (1998)

    Google Scholar 

  23. Ren, D., Erwig, M.: A generic recursion toolbox for Haskell or: scrap your boilerplate systematically. In: Proceedings of the ACM SIGPLAN Workshop on Haskell, pp. 13–24. ACM (2006)

    Google Scholar 

  24. Reynolds, J.C.: The Discoveries of Continuations. Lisp and Symbolic Computation 6(3-4), 233–248 (1993)

    Article  Google Scholar 

  25. Sloane, A.M.: Lightweight Language Processing in Kiama. In: Fernandes, J.M., Lämmel, R., Visser, J., Saraiva, J. (eds.) GTTSE 2009. LNCS, vol. 6491, pp. 408–425. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  26. Tisi, M., MartĂ­nez, S., Jouault, F., Cabot, J.: Refining Models with Rule-based Model Transformations. Tech. Rep. 7582, INRIA (2011)

    Google Scholar 

  27. Veldhuizen, T.L.: Expression templates. C++ Report 7(5), 26–31 (1995), reprinted in C++ Gems, ed. Stanley Lippman

    Google Scholar 

  28. Viera, M., Swierstra, S.D., Lempsink, E.: Haskell, do you read me?: constructing and composing efficient top-down parsers at runtime. In: 1st ACM SIGPLAN Symposium on Haskell (Haskell 2008), pp. 63–74. ACM (2008)

    Google Scholar 

  29. Visser, E., Benaissa, Z., Tolmach, A.: Building program optimizers with rewriting strategies. In: 3rd ACM SIGPLAN Intl. Conf. on Functional Programming, ICFP 1998, pp. 13–26. ACM Press (1998)

    Google Scholar 

  30. Visser, J.: Visitor combination and traversal control. In: 16th ACM SIGPLAN Conf. on Object Oriented Programming, OOPSLA 2001, pp. 270–282. ACM (2001)

    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-Verlag Berlin Heidelberg

About this paper

Cite this paper

Bagge, A.H., Lämmel, R. (2013). Walk Your Tree Any Way You Want. In: Duddy, K., Kappel, G. (eds) Theory and Practice of Model Transformations. ICMT 2013. Lecture Notes in Computer Science, vol 7909. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-38883-5_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-38883-5_3

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-38882-8

  • Online ISBN: 978-3-642-38883-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics