Subject: [bug#52387] [PATCH 1/5] gnu: Add cl-maxpc.

From: Jacob MacDonald <[email-masked]>
Date: Mon, 13 Dec 2021 12:41:07 -0600

From 8e3384c13c54c6e4c559c51c39763ffbef19c60a Mon Sep 17 00:00:00 2001
From: Jacob MacDonald <[email-masked]>
Date: Wed, 8 Dec 2021 21:53:39 -0600
Subject: [PATCH 1/5] gnu: Add cl-maxpc.

* gnu/packages/lisp-xyz.scm (sbcl-maxpc, cl-maxpc, ecl-maxpc): New variables.
---
 gnu/packages/lisp-xyz.scm | 48 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index e25d0f5488..9cfd67d591 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -20245,3 +20245,51 @@ (define-public sbcl-cl-https-everywhere
 
 (define-public cl-https-everywhere
   (sbcl-package->cl-source-package sbcl-cl-https-everywhere))
+
+(define-public sbcl-maxpc
+  (let ((commit "e5e58d053039517d30fd59ab2d128256b87790d5")
+        (revision "1"))
+    (package
+      (name "sbcl-maxpc")
+      (version (git-version "0.0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/eugeneia/maxpc")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "15wrjbr2js6j67c1dd4p2qxj49q9iqv1lhb7cwdcwpn79crr39gf"))))
+      (build-system asdf-build-system/sbcl)
+      (home-page "https://mr.gy/software/maxpc/api.html")
+      (synopsis "Library for writing parsers and lexers based on combinatory parsing")
+      (description
+       "@emph{Max’s Parser Combinators} is a simple and pragmatic library for
+writing parsers and lexers based on combinatory parsing.  MaxPC is capable of
+parsing deterministic, context-free languages, provides powerful tools for
+parse tree transformation and error handling, and can operate on
+@dfn{sequences} and @dfn{streams}.  It supports unlimited backtracking, but
+does not implement @url{http://pdos.csail.mit.edu/~baford/packrat/thesis/,
+Packrat Parsing}.  Instead, MaxPC achieves good performance through its
+optimized primitives, and explicit separation of matching and capturing input.
+In practice, MaxPC parsers perform better on typical computer languages—when
+compared to Packrat parsers—at the expense of not producing linear-time
+parsers.
+
+@enumerate
+@item
+MaxPC is a complete rewrite of @url{https://github.com/eugeneia/mpc, MPC} with
+was in turn a fork of Drew Crampsie’s @url{http://smug.drewc.ca/, Smug}.
+@item
+See @url{https://mr.gy/blog/maxpc.html#section-3-1,
+MaxPC: Why? How? / Packrat Parsing} on why the book keeping costs of Packrat
+parsing diminish the gain in execution time for typical grammars and workloads.
+@end enumerate")
+      (license license:agpl3))))
+
+(define-public cl-maxpc
+  (sbcl-package->cl-source-package sbcl-maxpc))
+
+(define-public ecl-maxpc
+  (sbcl-package->ecl-package sbcl-maxpc))
-- 
2.34.0