Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (10 sloc) 595 Bytes
This is a PEG or packrat parser forked from the Common Lisp one written by John Leuner; see <http://www.cliki.net/metapeg>.
To use the parser generator first load the library code:
CL-USER> (load "libmetapeg.lisp")
then call parse with your PEG grammar as the first argument:
CL-USER> (parse "mypeg.peg" "metapeg.lisp")
the lisp code for the resulting parser will be returned.
You can save this code to a file:
CL-USER> (write-parser-to-file (parse "mypeg.peg" "metapeg.lisp") "mypeg.lisp")
To use your parser, call the parse function again:
CL-USER> (parse "input-file" "mypeg.lisp")