Nothing Special   »   [go: up one dir, main page]

skip to main content
article

Visitor combination and traversal control

Published: 01 October 2001 Publication History

Abstract

The Visitor design pattern allows the encapsulation of polymorphic behavior outside the class hierarchy on which it operates. A common application of Visitor is the encapsulation of tree traversals. A clean separation can be made between the generic parts of the combinator set and the parts that are specific to a particular class hierarchy. The generic parts form a reusable framework. The generic parts form a reusable framework. The specific parts can be generated from a (tree) grammar. Due to this separation, programming with visitor combinators becomes a form of generic programming with significant reuse of (visitor) code.

References

[1]
Portland pattern repository. http://www.c2.com/cgi/wiki.]]
[2]
Document Object Model (DOM) Level 1 Specification Version 1.0, W3C Recommendation. Oct. 1998.]]
[3]
XSL Transformations (XSLT) Version 1.0, W3C Recommendation. Nov. 1999.]]
[4]
M. van den Brand, H. Jong, P. Klint, and P. Olivier, Efficient Annotated Terms. Software, Practice & Experience, 39(3):259-291, 2000.]]
[5]
H. Cirstea and C. Kirchner. Intorduction to the rewriting calculus. Rapport de recherche 3818, INRIA, Dec. 1999.]]
[6]
A. van Deursen and T. Kuipers. Building documentation generators. In Proceedings of the International Conference on Software Maintenance (ICSM '99), IEEE Computer Society, 1999.]]
[7]
E. M. Gagnon and L. J. Hendren. SableCC, an object-oriented compiler framework. In TOOLS USA 98 (Technology of Object-Oriented Languages and Systems). IEEE, 1998.]]
[8]
E. Gamma, R. Helm, R. Johnson, and J. Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wiley, 1994.]]
[9]
J. Heering, P. R. H. Hendrikes, P. Klint, and J. Rekers. The Syntax Definition Formalism SDF - Reference manual. SIGPLAN Notices, 24(11):43-75, 1989.]]
[10]
I. Herman and M. Marshall. GraphXML - An XML-based graph description format. In Symposium on Graph Drawing (GD 2000), volume 1984 of LNCS, pages 52-62. Springer, 2000. A full grammar for GraphXML can be found at http:/www.program-transformation.org/gb/.]]
[11]
P. Jansson and J. Jeuring. PolyP-a polytypic programming language extension. In POPL '97: 24th Symposium on Principles of Programming Languages, pages 470-482, Paris, France, 15-17 Jan. 1997.]]
[12]
G. Kiczales, J. Lamping, et al. Aspect-oriented programming. In Proceedings of ECOOP '97, number 1241 in LNCS. Springer Verlag, 1997.]]
[13]
E. Koutsofios. Drawing graphs with dot. Technical report, AT&T Bell Laboratories, Murray Hill, NJ, USA, Nov. 1996.]]
[14]
T. Kuhne. The translator pattern-external functionality with homomorphic mappings. In R. Ege, M. Singh, and B. Meyer, editors, The 23rd TOOLS conference USA '97, pages 48-62. IEEE Computer Sicuety, July 1998.]]
[15]
T. Kuipers and J. Visser. Object-oriented tree traversal with JJForester, In M. Van den Brand and D. Parigot, editors, Electronic Notes in Theoretical Computer Science, volume 44, Elsevier Science Publishers, 2001. Proc. of Workshop on Language Descriptions, Tools and Applications (LDTA).]]
[16]
R. Lammel. Typed Generic Traversal. Technical report, CWI,2001. To appear.]]
[17]
R. Lammel and J. Visser. Type-safe functional strategies. Manuscipt in preperation. Preliminary version in draft proceedings of the Scottish Functional Programming Workshop, St Andrews, 2000.]]
[18]
R. Lammel, J. Visser, and J. Kort. Dealing with large bananas. In J. Jeuring, editor, Workshop on Generic Programming, Ponte de Lima, July 2000. Technical Report UU-CS-2000-19, Universiteit Utrecht.]]
[19]
K. J. Lieberherr and B. Patt-Shamir. Traversals of Object Structures: Specification and Efficient Implementation. Technical Report NU-CCS-97-15, College of Computer Science, Northeastern University, Boston, MA, July 1997.]]
[20]
J. Ovlinger and M. Wand. A language for specifying recursive traversals of object structures. In Proceedings of the 1999 ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA'99), pages 70-81, 1999.]]
[21]
J. Palsberg and C. B. Jay. The essence of the visitor pattern. In Proceedings of COMPSAC'98, 22nd Annual International Computer Software and Applications Conference, pages 9-15, Vienna, Austria, August 1998.]]
[22]
E. Visser. Language independent traversals for program transformation. In J. Jeuring, editor, Workshop on Generic Programming, Ponte de Lima, July 2000. Technical Report UU-CS-2000-19, Universiteit Utrecht.]]
[23]
E. Visser. The Stratego Library (version 0.4.22) Institute of Information and Computing Sciences, Utrecht, The Netherlands, 2001. Most recent version at http://www.stratego-language.org/.]]
[24]
E. Visser, Z.-e.-A. Benaissa, and A. Tolmach. Building program optimizers with rewriting strategies. ACM SIGPLAN Notices, 34(1):13-26, January 1999. Proceedings of the International Conference on Functional Programming (ICFP'98).]]
[25]
J. Vlissides. Visitor in frameworks. C++ Report, 11(10), Nov. 1999.]]
[26]
L. Wall, R. L. Schwartz, T. Christiansen, and S. Potter. Programming Perl, Nutshell Handbook. O'Reilly & Associates, 2nd edition, 1996.]]

Cited By

View all
  • (2023)Simulating Software Evolution to Evaluate the Reliability of Early Decision-making among Design Alternatives toward MaintainabilityACM Transactions on Software Engineering and Methodology10.1145/356993132:3(1-38)Online publication date: 26-Apr-2023
  • (2017)Early Evaluation of Implementation Alternatives of Composite Data Structures Toward MaintainabilityACM Transactions on Software Engineering and Methodology10.1145/313273126:2(1-44)Online publication date: 5-Oct-2017
  • (2016)Compositional Language Engineering Using Generated, Extensible, Static Type-Safe VisitorsProceedings of the 12th European Conference on Modelling Foundations and Applications - Volume 976410.1007/978-3-319-42061-5_5(67-82)Online publication date: 6-Jul-2016
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 36, Issue 11
11/01/2001
380 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/504311
Issue’s Table of Contents
  • cover image ACM Conferences
    OOPSLA '01: Proceedings of the 16th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
    October 2001
    382 pages
    ISBN:1581133359
    DOI:10.1145/504282
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 2001
Published in SIGPLAN Volume 36, Issue 11

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)9
  • Downloads (Last 6 weeks)3
Reflects downloads up to 10 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Simulating Software Evolution to Evaluate the Reliability of Early Decision-making among Design Alternatives toward MaintainabilityACM Transactions on Software Engineering and Methodology10.1145/356993132:3(1-38)Online publication date: 26-Apr-2023
  • (2017)Early Evaluation of Implementation Alternatives of Composite Data Structures Toward MaintainabilityACM Transactions on Software Engineering and Methodology10.1145/313273126:2(1-44)Online publication date: 5-Oct-2017
  • (2016)Compositional Language Engineering Using Generated, Extensible, Static Type-Safe VisitorsProceedings of the 12th European Conference on Modelling Foundations and Applications - Volume 976410.1007/978-3-319-42061-5_5(67-82)Online publication date: 6-Jul-2016
  • (2014)Rewriting Object Models With Cycles and Nested CollectionsPart I of the Proceedings of the 6th International Symposium on Leveraging Applications of Formal Methods, Verification and Validation. Technologies for Mastering Change - Volume 880210.1007/978-3-662-45234-9_31(445-460)Online publication date: 8-Oct-2014
  • (2014)A survey report of enhancements to the visitor software designpatternSoftware—Practice & Experience10.1002/spe.216744:6(699-733)Online publication date: 1-Jun-2014
  • (2013)Walk Your Tree Any Way You WantTheory and Practice of Model Transformations10.1007/978-3-642-38883-5_3(33-49)Online publication date: 2013
  • (2009)Programming Errors in Traversal Programs Over Structured DataElectronic Notes in Theoretical Computer Science (ENTCS)10.1016/j.entcs.2009.09.045238:5(135-153)Online publication date: 1-Oct-2009
  • (2008)Stratego/XT 0.17. A language and toolset for program transformationScience of Computer Programming10.1016/j.scico.2007.11.00372:1-2(52-70)Online publication date: 1-Jun-2008
  • (2007)Transformation of structure-shy programsProceedings of the 2007 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation10.1145/1244381.1244385(11-20)Online publication date: 15-Jan-2007
  • (2007)Revealing the X/O Impedance MismatchDatatype-Generic Programming10.1007/978-3-540-76786-2_6(285-367)Online publication date: 2007
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media