Grammars for programming languages are traditionally
specified statically. They are hard to compose and
reuse due to ambiguities that inevitably arise.
PetitParser combines ideas from scannerless parsing,
parser combinators, parsing expression grammars and
packrat parsers to model grammars and parsers as
objects that can be reconfigured dynamically.
Through examples and benchmarks we demonstrate that
dynamic grammars are not only flexible but highly
practical.