The parser can used similar as XML Parser. But instead of an XML parser the chaperon parser need a lexicon and a grammar file. These files are specified in XML. The lexicon file is used tokenize a character stream into tokens. And the grammar is used to build a syntax tree with these tokens.

The XML grammar is not really so handy, so the Chaperon project also provides a grammar for a text grammar similar to yacc/bison, and a stylesheet for converting this text grammar format to the XML grammar format. So it is easier to write a grammar in this text format rather than directly in the XML format.

by Stephan Michels