8.7 Refactoring the Naïve Parser

The recommended way to develop a Mozart application is to organize it as a collection of functors. This is generally known as modular programming. In this section, we are going to illustrate this style of software development by revisiting the naïve parser of Chapter 5.

A considerable advantage of modular programming is that it permits and encourages the development of reusable components. Collections of reusable software components are often called libraries. In Chapter 5, we have seen that both the trivial recognizer and the more interesting parser that builds parse trees actually share most of their code. We are going to write functors that provide the common functionality and abstract away from application specific processing.



Denys Duchier, Claire Gardent and Joachim Niehren
Version 1.3.99 (20050412)