Subject: Re: simple lisp interpreter
From: rpw3@rpw3.org (Rob Warnock)
Date: Thu, 06 Sep 2007 03:25:00 -0500
Newsgroups: comp.lang.lisp
Message-ID: <X9idnZqScfLBJELbnZ2dnUVZ_qOknZ2d@speakeasy.net>
Matthias Buelow  <mkb@incubus.de> wrote:
+---------------
| Yes but the OP was asking whether the "Lisp language" can be parsed by
| an LL parser, by which I understand that he means in textual source-code
| form, otherwise it wouldn't make much sense.
+---------------

A better question might be whether the Common Lisp *reader* --
the CLHS function READ -- can usefully be implemented using an
LL parser. Having once written most of a CL READ in C, ISTR that
you need at least one and maybe in some rare cases two tokens
of read-ahead [when parsing dotted lists maybe?] to decide what
to do next using straightforward recursive descent [which is
sort of LL, right?]. It's not all that hard to do. [My reader
was less than 500 lines of C.]

But because of "#." and backquote & friends and other readmacros,
I doubt a *full* CL reader can be implemented using any kind of
"pure" or static table-driven parser, LL or otherwise, since you
need to be able to call back into Lisp at READ time.


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607