Skip to content

Instantly share code, notes, and snippets.

@arathnim
Last active February 29, 2016 20:52
Show Gist options
  • Save arathnim/c0c54896dba04ff104dc to your computer and use it in GitHub Desktop.
Save arathnim/c0c54896dba04ff104dc to your computer and use it in GitHub Desktop.
(load "parmesan-test.cl")
(in-package parmesan)
(defparser symbol (intern (string-upcase (many+ letters))))
(defparser integer (parse-integer (many+ digits)))
(defparser quoted (between "'" (many (except "'")) "'"))
(defparser term (car ((choice quoted symbol integer sexp) (skip (many " ")))))
(defparser sexp (between "(" (manyc term)) ")"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment