Description

This module is a collection of predicates and combinators for working with
Prolog's definite clause grammars (DCG). As much as possible, I've tried to
make these rules symmetric so that you can use them for both parsing and
generating.

Most of these predicates factor out patterns that I've noticed in my DCGs. Some
of them provide regex-like quantifiers similar to *, *?, {2}, etc.

Example

To match a single, lowercase word one might write a DCG like this. It consumes
as many lowercase letters as possible. On backtracking, it gives back one letter at a time: