[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LR Parser for MCL
- To: info-mcl
- Subject: Re: LR Parser for MCL
- From: mj@cs.brown.edu (Mark Johnson)
- Date: 23 Jan 92 14:21:04 GMT
- Newsgroups: comp.lang.lisp.mcl
- Organization: Brown University Department of Computer Science
- References: <9201221833.AA15689@mipsmath>
- Reply-to: mj@cs.brown.edu (Mark Johnson)
- Sender: brunix!news
The LALR(1) parser-generator I wrote is sitting in the MACL archives
on cambridge.apple.com. It will run under any full CommonLisp,
however.
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.
Mark