skip to main content
10.1145/1596655.1596668acmconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
research-article

A discipline of tree processing

Published:27 August 2009Publication History

ABSTRACT

This paper discusses a set of new tools to facilitate the implementation of language processors in Java. First, by decoupling recognition based on grammars from tree building based on semantic actions we can choose to represent grammars in BNF or EBNF, and to parse based on LL, LR, or functional engines, and still completely control how trees represent structured input. Second, we use a Java custom annotation to generate tree factories, thus encouraging a more functional approach to backend processing by tree transformation. Third, we replace the traditional visitor design pattern in the backend by a more rule-oriented approach using inheritance on tree node classes for pattern matching. Taken together, language implementation turns into a problem of tree creation and transformation with concise, Java-based notations to focus on the algorithms.

References

  1. Aho, Alfred V., Kernighan, Brian W., Weinberger, Peter J., The AWK Programming Language, 1988, ISBN 0-201-07981-X. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Bravenboer, M., Kalleberg, K. T., Vermaas, R., and Visser, E., Stratego/XT 0.17. A Language and Toolset for Program Transformation. Science of Computer Programming, 72(1-2):52--70, June 2008. Special issue on experimental software and toolkits. Web site http://strategoxt.org/. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Clark, James, XSL Transformations, Version 1.0, 1999, http://www.w3.org/TR/xslt.Google ScholarGoogle Scholar
  4. Clark, James, DeRose, Steve, XML Path Language (XPath), Version 1.0, 1999, http://www.w3.org/TR/xpath.Google ScholarGoogle Scholar
  5. Darcy, Joe, JSR 269: Pluggable Annotation Processing API, 2006, http://www.jcp.org/en/jsr/detail?id=269.Google ScholarGoogle Scholar
  6. Fraunhofer Institute For Computer Architecture And Software Technology, The Catalog of Compiler Construction Tools, 1996, http://catalog.compilertools.net/.Google ScholarGoogle Scholar
  7. Gamma, Erich, Helm, Richard, Johnson, Ralph, and Vlissides, John, Design Patterns: Elements of Reusable Object-Oriented Software, pp. 331--344, 1995; ISBN 0-201-63361-2. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Heliotis, James E., Schreiner, Axel T., xv, XML Visitor Generator, 2009, http://www.cs.rit.edu/~ats/projects/lp2/doc/xv/package-summary.html.Google ScholarGoogle Scholar
  9. Hudson, Scott, Flannery, Frank C., Ananian, Scott, CUP parser generator, 1996, http://www2.cs.tum.edu/projects/cup/.Google ScholarGoogle Scholar
  10. Johnson, Stephen C., Lesk, Mike E., Language Development Tools, The Bell System Technical Journal, Vol. 57, No. 6, July-August 1978, pp. 245--265; ISBN 0-13-938532-0.Google ScholarGoogle Scholar
  11. Klein, Gerwin, classgen, 1999, http://classgen.sourceforge.net/.Google ScholarGoogle Scholar
  12. Metamata, JavaCC and JJTree (parser generator), 1997, http://nlp.stanford.edu/nlp/javadoc/javaccdocs/.Google ScholarGoogle Scholar
  13. Parr, Terrence J., Quong, Russel W., ANTLR: A Predicated-LL(k) Parser Generator, Software Practice and Experience, Vol. 25, No. 7, 1995, pp. 789--810. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Schreiner, Axel T., el, Expression Language, 2005, http://www.cs.rit.edu/~ats/projects/el/doc/.Google ScholarGoogle Scholar
  15. Schreiner, Axel T., jay, LALR(1) parser generator, 2006, http://www.cs.rit.edu/~ats/projects/lp/doc/jay/package-summary.html.Google ScholarGoogle Scholar
  16. Schreiner, Axel T., lp, Language Processing (tutorial), 2005, http://www.cs.rit.edu/~ats/projects/lp/doc/.Google ScholarGoogle Scholar
  17. Schreiner, Axel T., oops3, Object-oriented parser system, 2008, http://www.cs.rit.edu/~ats/projects/oops3/doc/.Google ScholarGoogle Scholar
  18. Schreiner, Axel T., pj2, Compiler frontend generator, 2009, http://www.cs.rit.edu/~ats/projects/lp2/doc/pj2/package-summary.html.Google ScholarGoogle Scholar
  19. Schreiner, Axel T., vig, Visitor generator, 2008, http://www.cs.rit.edu/~ats/projects/lp2/doc/vig/package-summary.html.Google ScholarGoogle Scholar
  20. Schreiner, Axel T., wcs, Web compiler service, 2008, http://www.cs.rit.edu/~ats/projects/lp2/doc/wcs/package-summary.html.Google ScholarGoogle Scholar
  21. Sun Microsystems, Annotation Processing Tool, 2004, http://java.sun.com/j2se/1.5.0/docs/guide/apt/.Google ScholarGoogle Scholar
  22. Wikipedia, Comparison of parser generators, 2009, http://en.wikipedia.org/wiki/Comparison_of_parser_generators.Google ScholarGoogle Scholar

Index Terms

  1. A discipline of tree processing

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            PPPJ '09: Proceedings of the 7th International Conference on Principles and Practice of Programming in Java
            August 2009
            200 pages
            ISBN:9781605585987
            DOI:10.1145/1596655

            Copyright © 2009 ACM

            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: 27 August 2009

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

            Acceptance Rates

            Overall Acceptance Rate29of58submissions,50%
          • Article Metrics

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

            Other Metrics

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader