A parser generator for common lisp, inspired by ESRAP


  • Parses strings, vectors (e.g. binary data) and lists
  • Allows parsing of nested sequences (e.g. trees, strings within lists, ...)
  • Simple interface, very similar to Esrap
  • Provides many specific and non-specific terminal symbols
  • Implements the standard PEG (parsing expression grammar) expressions as well as useful extensions
  • Packrat parsing can be enabled for individual PEG rules
  • Parsing expression rules are compiled
  • Parse tree transformations can be defined together with each PEG rule
  • Grammars can be made context aware:
    • Run parse results of a PEG rule through lisp code to influence parsing success
    • Share data between parse rules
  • Parsing rules can be parameterised
  • Uses separate namespace(s) for parse rules
  • Tracing of grammar rules
  • Meaningful parse error messages


First, define a set of grammar rules:
(defrule foo () "foo") (defrule bar () "bar") (defrule foobar () (and foo bar))
The rule foobar will parse the string "foobar".

Parsing is initiated by calling

(parseq 'foobar "foobar")
The result is the list ("foo" "bar").



Parseq can be installed through Quicklisp.