[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LR Parser for MCL

The LALR(1) parser-generator I wrote is sitting in the MACL archives
on cambridge.apple.com.  It will run under any full CommonLisp,

It is a standard parser-generator: you give it a CF grammar in which
each production has an "action" (a Lisp function) that computes
the "value" of a parent node in terms of the values of its children,
and the generator calculates the LALR(1) tables and then builds a
new function (or more precisely - a Lisp form defining a function)
which, when evaluated, parses an input by repeatedly calling your
read function to get its input.

It's all pretty straight-forward - and very similar to YACC.  In fact,
it's simpler, since Lisp has first-class function objects, which means
that you don't have to copy bits of code text the way YACC does.