Design

The major design goal of Chaperon was to make a clear separation of concerns between components: the models, the builders, the automata and the processors. The most distinguishing feature was the fact if the component hold a state or not.

Model
The model holds the structure for the grammar, lexicon and the pattern. The important feature was the easy manipulation of the model.
Builder
The purpose of the builders is to create the automata by using the models. Because of their strong dependencies to the model, the builders could only be used once, and needed an instance for every model.
Automata
The automata holds a finite state machine, but don't own a state. The automata presents a kind of compiled models. Because of the fact that they don't own a state, they could be used several times.
Processors
Compared to the automata, the processors holds the state in the parsing process. The Processors needs an automaton to dispatch a task. In most cases the processors are recycable; they can only be used for each task once.

The designs were chosen to give the greatest calculation time to the builders while making the parsing process as fast and least-memory-intensive as possible.

Another reason to separate automata and processor was to make most of the component part threadsafe.

The automata and processors can be excellent used in thin clients, because of the fact that automata and processor doesn't depend to the models and builders,

The processor impements a 'push' architecture, which means that events are pushed from the source to the parser. Most of the parser implements a 'pull' architecture, in which the parser pulls the event from the source. The architecture is similar to the SAX pipelines, and helps to integrate the components in such SAX pipelines.

by Stephan Michels