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.
- Aho, Alfred V., Kernighan, Brian W., Weinberger, Peter J., The AWK Programming Language, 1988, ISBN 0-201-07981-X. Google ScholarDigital Library
- 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 ScholarDigital Library
- Clark, James, XSL Transformations, Version 1.0, 1999, http://www.w3.org/TR/xslt.Google Scholar
- Clark, James, DeRose, Steve, XML Path Language (XPath), Version 1.0, 1999, http://www.w3.org/TR/xpath.Google Scholar
- Darcy, Joe, JSR 269: Pluggable Annotation Processing API, 2006, http://www.jcp.org/en/jsr/detail?id=269.Google Scholar
- Fraunhofer Institute For Computer Architecture And Software Technology, The Catalog of Compiler Construction Tools, 1996, http://catalog.compilertools.net/.Google Scholar
- 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 ScholarDigital Library
- 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 Scholar
- Hudson, Scott, Flannery, Frank C., Ananian, Scott, CUP parser generator, 1996, http://www2.cs.tum.edu/projects/cup/.Google Scholar
- 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 Scholar
- Klein, Gerwin, classgen, 1999, http://classgen.sourceforge.net/.Google Scholar
- Metamata, JavaCC and JJTree (parser generator), 1997, http://nlp.stanford.edu/nlp/javadoc/javaccdocs/.Google Scholar
- 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 ScholarDigital Library
- Schreiner, Axel T., el, Expression Language, 2005, http://www.cs.rit.edu/~ats/projects/el/doc/.Google Scholar
- Schreiner, Axel T., jay, LALR(1) parser generator, 2006, http://www.cs.rit.edu/~ats/projects/lp/doc/jay/package-summary.html.Google Scholar
- Schreiner, Axel T., lp, Language Processing (tutorial), 2005, http://www.cs.rit.edu/~ats/projects/lp/doc/.Google Scholar
- Schreiner, Axel T., oops3, Object-oriented parser system, 2008, http://www.cs.rit.edu/~ats/projects/oops3/doc/.Google Scholar
- Schreiner, Axel T., pj2, Compiler frontend generator, 2009, http://www.cs.rit.edu/~ats/projects/lp2/doc/pj2/package-summary.html.Google Scholar
- Schreiner, Axel T., vig, Visitor generator, 2008, http://www.cs.rit.edu/~ats/projects/lp2/doc/vig/package-summary.html.Google Scholar
- Schreiner, Axel T., wcs, Web compiler service, 2008, http://www.cs.rit.edu/~ats/projects/lp2/doc/wcs/package-summary.html.Google Scholar
- Sun Microsystems, Annotation Processing Tool, 2004, http://java.sun.com/j2se/1.5.0/docs/guide/apt/.Google Scholar
- Wikipedia, Comparison of parser generators, 2009, http://en.wikipedia.org/wiki/Comparison_of_parser_generators.Google Scholar
Index Terms
- A discipline of tree processing
Recommendations
Nez: practical open grammar language
Onward! 2016: Proceedings of the 2016 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and SoftwareNez is a PEG(Parsing Expressing Grammar)-based open grammar language that allows us to describe complex syntax constructs without action code. Since open grammars are declarative and free from a host programming language of parsers, software ...
A derivative-based parser generator for visibly Pushdown grammars
In this paper, we present a derivative-based, functional recognizer and parser generator for visibly pushdown grammars. The generated parser accepts ambiguous grammars and produces a parse forest containing all valid parse trees for an input string in ...
A Derivative-based Parser Generator for Visibly Pushdown Grammars
In this article, we present a derivative-based, functional recognizer and parser generator for visibly pushdown grammars. The generated parser accepts ambiguous grammars and produces a parse forest containing all valid parse trees for an input string in ...
Comments