CL-Opossum is a Common Lisp implementation of a Parsing Expression Grammar parser generator. It bootstraps itself. Memoization is supported. If you like cl-peg and metapeg but have seen their shortcomings, this is for you.


Source repository:

License: LLGPL

Quick assessment (2023-03-26)

  • You must chdir because bootstrap.lisp does its thing in the current directory.
  • The provided example grammar (example.peg) has mismatched parentheses.
  • Almost parses successfully, but the wrong data gets passed to the actions.

(DEFUN |parse-Identifier| () (BUILD-PARSER-FUNCTION "Identifier" (SEQ (MATCH-CHAR-CLASS "a-zA-Z_") (SEQ (MANY (MATCH-CHAR-CLASS "a-zA-Z0-9_")) (SEQ (|parse-Spacing|) (LIST ':ACTION NIL '|opossum-action-58|))))))

Here, |opossum-action-58| is supposed to receive the parsed identifier:

(defun |opossum-action-58| (data) (declare (ignorable data) (type list data)) (concatenate 'string (first data) (second data)) )

But instead, the data actually received is:

((" ") (:ACTION NIL OPOSSUM::|opossum-action-58|))