6.5. Module Trailer

The module trailer is optional, comes right at the end of the grammar file, and takes the same form as the module header:

<Haskell code>

This section is used for placing auxiliary definitions that need to be in the same module as the parser. In small parsers, it often contains a hand-written lexical analyser too. There is no restriction on what can be placed in the module trailer, and any code in there is copied verbatim into the generated parser file.