Abstract
Parsing is the core of the front end of a compiler. The predictive recursive-descent parsing technology is most widely used in a traditional compiler design. It is straightforward and easy to implement. But since predictive recursive-descent parsing degrades into a structural programming, it results in a parser that is very hard to change, extend and maintain.
A pattern language is a set of related patterns that solve a common problem in a problem domain. This paper presents a pattern language for developing a framework for parsing in object-oriented compiler design based on the principle of the predictive recursive-descent parsing technology. It describes four patterns that address three design aspects in developing an object-oriented parser. Two alternative patterns are presented to provide alternative solutions to solve the recursion problem in the object-oriented software design. One is based on the Builder design pattern, and the other is based on the meta-programming technology. The parsers developed from this pattern language are easy to implement, easy to extend, and easy to maintain. This pattern language is intended to express a flexible and extensible design for parsing that can accommodate variations to its most extent.
Keywords
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, and Michael Stal. Pattern-Oriented Software Architecture: A System of Patterns. John Wiley & Sons, 1996.
Martin Fowler. Analysis Pattern: Reusable Object Models. Addison-Wesley, 1997.
Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.
Yun Mai and Michel de Champlain. An Extensible One-Pass Assembler Framework. Technical Report, Department of Electrical and Computer Engineering, Concordia University, Montreal, Canada, June 2000.
Yun Mai and Michel de Champlain. Design A Compiler Framework in Java. Technical Report, Department of Electrical and Computer Engineering, Concordia University, Montreal, Canada, November 2000.
Yun Mai and Michel de Champlain. A Pattern Language to Visitors. The 8th Conference PLoP ′2001, Monticello, Illinois, USA, September 2001.
Yun Mai and Michel de Champlain. Reflective Visitor Pattern. EuroPLoP ′2001 Writer’s workshop, Irsee, Germany, July 2001.
Thomas W. Parsons. Introduction To Compiler Construction. Freeman, 1992.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer Science+Business Media New York
About this chapter
Cite this chapter
Mai, Y., de Champlain, M. (2003). A Pattern Language For Parsing. In: D’Hondt, T. (eds) Technology of Object-Oriented Languages, Systems and Architectures. The Kluwer International Series in Engineering and Computer Science, vol 732. Springer, Boston, MA. https://doi.org/10.1007/978-1-4615-0413-9_7
Download citation
DOI: https://doi.org/10.1007/978-1-4615-0413-9_7
Publisher Name: Springer, Boston, MA
Print ISBN: 978-1-4613-5064-4
Online ISBN: 978-1-4615-0413-9
eBook Packages: Springer Book Archive